busca por autor, editorial y subtítulo en la web y quita las
descripciones de la búsqueda
This commit is contained in:
parent
8ba30e579d
commit
5234d8ffc8
3 changed files with 20 additions and 1 deletions
|
@ -1 +1,2 @@
|
|||
#from . import controllers
|
||||
from . import models
|
||||
|
||||
|
|
1
website_sale_product_library/models/__init__.py
Normal file
1
website_sale_product_library/models/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from . import product_template
|
17
website_sale_product_library/models/product_template.py
Normal file
17
website_sale_product_library/models/product_template.py
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue