diff --git a/website_description_internal/__init__.py b/website_description_internal/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/website_description_internal/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/website_description_internal/__manifest__.py b/website_description_internal/__manifest__.py new file mode 100644 index 0000000..1a07c5c --- /dev/null +++ b/website_description_internal/__manifest__.py @@ -0,0 +1,10 @@ +{ + 'name': 'Website Descrition Internal', + 'version': '16.0.1.0.0', + 'summary': 'Sobrescribe el campo website_description y devuelve el campo internal description.', + 'author': 'Criptomart', + 'depends': ['product','website_sale'], + 'data': [], + 'installable': True, + 'application': False, +} diff --git a/website_description_internal/models/__init__.py b/website_description_internal/models/__init__.py new file mode 100644 index 0000000..e8fa8f6 --- /dev/null +++ b/website_description_internal/models/__init__.py @@ -0,0 +1 @@ +from . import product_template diff --git a/website_description_internal/models/product_template.py b/website_description_internal/models/product_template.py new file mode 100644 index 0000000..05641fa --- /dev/null +++ b/website_description_internal/models/product_template.py @@ -0,0 +1,15 @@ +from odoo import models, fields, api + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + website_description = fields.Html( + string='Website Description', + compute='_compute_website_description', + store=True + ) + + @api.depends('description') + def _compute_website_description(self): + for record in self: + record.website_description = record.description