diff options
Diffstat (limited to 'addons/sale_quotation_builder/models/product_template.py')
| -rw-r--r-- | addons/sale_quotation_builder/models/product_template.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/addons/sale_quotation_builder/models/product_template.py b/addons/sale_quotation_builder/models/product_template.py new file mode 100644 index 00000000..91a10749 --- /dev/null +++ b/addons/sale_quotation_builder/models/product_template.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import fields, models, api +from odoo.tools.translate import html_translate + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + quotation_only_description = fields.Html('Quotation Only Description', sanitize_attributes=False, + translate=html_translate, help="The quotation description (not used on eCommerce)") + + quotation_description = fields.Html('Quotation Description', compute='_compute_quotation_description', + help="This field uses the Quotation Only Description if it is defined, otherwise it will try to read the eCommerce Description.") + + def _compute_quotation_description(self): + for record in self: + if record.quotation_only_description: + record.quotation_description = record.quotation_only_description + elif hasattr(record, 'website_description') and record.website_description: + record.quotation_description = record.website_description + else: + record.quotation_description = '' |
