Skip to content

Commit

Permalink
temp rebasing PR 579 (b2fbfc2)
Browse files Browse the repository at this point in the history
  • Loading branch information
roboadhoc committed Jan 23, 2024
2 parents 62d3dc7 + b2fbfc2 commit 75852cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion product_ux/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ def _get_contextual_pricelist(self):
pricelist_id_or_name = self._context.get('pricelist')
if isinstance(pricelist_id_or_name, list):
pricelist_id_or_name = pricelist_id_or_name[0]
# Si viene una lista en pricelist actualizamos contexto para que si se llama super, este reciba un entero
self = self.with_context(pricelist=pricelist_id_or_name)
if isinstance(pricelist_id_or_name, str):
pricelist_data = self.env['product.pricelist'].name_search(pricelist_id_or_name, operator='ilike', limit=1)
pricelist_data = self.env['product.pricelist'].name_search(pricelist_id_or_name, operator='=', limit=1)
if pricelist_data:
return self.env['product.pricelist'].browse(pricelist_data[0][0])
else:
Expand Down

0 comments on commit 75852cc

Please sign in to comment.