diff --git a/website_sale_product_library/__init__.py b/website_sale_product_library/__init__.py index c05036f..899bcc9 100644 --- a/website_sale_product_library/__init__.py +++ b/website_sale_product_library/__init__.py @@ -1 +1,2 @@ -#from . import controllers +from . import models + diff --git a/website_sale_product_library/models/__init__.py b/website_sale_product_library/models/__init__.py new file mode 100644 index 0000000..510f3bd --- /dev/null +++ b/website_sale_product_library/models/__init__.py @@ -0,0 +1 @@ +from . import product_template \ No newline at end of file diff --git a/website_sale_product_library/models/product_template.py b/website_sale_product_library/models/product_template.py new file mode 100644 index 0000000..8a87056 --- /dev/null +++ b/website_sale_product_library/models/product_template.py @@ -0,0 +1,17 @@ +from odoo import api, models, fields + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + @api.model + def _search_get_detail(self, website, order, options): + search_details = super()._search_get_detail(website, order, options) + search_details['search_fields'].append('autor') + search_details['fetch_fields'].append('autor') + search_details['search_fields'].append('editorial') + search_details['fetch_fields'].append('editorial') + search_details['search_fields'].append('subtitle') + search_details['fetch_fields'].append('subtitle') + search_details['search_fields'].remove('description') + search_details['search_fields'].remove('description_sale') + return search_details \ No newline at end of file