Skip to content

Commit a807805

Browse files
committed
[FIX] Add silent_compute into _compute_computed_list_price to avoid verbose logger
when the method is call from product.update_from_planned_price.wizard
1 parent 17e8be2 commit a807805

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

product_planned_price/models/product_template.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ def _compute_computed_list_price(self):
132132
recs = self.filtered(
133133
lambda x: x.list_price_type in [
134134
'manual', 'by_margin', 'other_currency'])
135-
_logger.info('Get computed_list_price for %s "manual", "by_margin"'
136-
' and "other_currency" products' % (len(recs)))
135+
if not self.env.context.get('silent_compute'):
136+
_logger.info('Get computed_list_price for %s "manual", "by_margin"'
137+
' and "other_currency" products' % (len(recs)))
137138
company = self.env.company
138139
date = fields.Date.today()
139140
(self - recs).computed_list_price = 0.0

product_planned_price/wizards/product_update_from_planned_price_wizard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ def confirm(self):
2020
products = self.env[active_model].browse(active_ids)
2121
# Hacemos esto para forzar el recomputo antes de llamar la metodo, presumimos que tiene que ver con los depends del _compute_computed_list_price Pero no lo queremos tocar en v16
2222
for prod in products:
23-
prod._compute_computed_list_price()
23+
prod.with_context(silent_compute=True)._compute_computed_list_price()
2424
products._update_prices_from_planned()

0 commit comments

Comments
 (0)