Skip to content

Commit

Permalink
[FIX] Change actions using _for_xml_id
Browse files Browse the repository at this point in the history
  • Loading branch information
vib-adhoc committed Oct 24, 2022
1 parent b3ad4c8 commit a8fd81a
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions product_prices_update/wizards/wizard_update_prices.py
Expand Up @@ -36,18 +36,16 @@ def change_prices(self):
if not active_ids:
raise UserError(_('You must select at least one product'))
if self.check is True:
actions = self.env.ref(
action_read = self.env["ir.actions.actions"]._for_xml_id(
'product_prices_update.action_prices_update_wizard_result')
if actions:
action_read = actions.sudo().read()[0]
action_read['context'] = {
'product_tmpl_ids': active_ids,
'price_type': self.price_type,
'price_discount': self.price_discount,
'price_surcharge': self.price_surcharge,
'price_round': self.price_round,
}
return action_read
action_read['context'] = {
'product_tmpl_ids': active_ids,
'price_type': self.price_type,
'price_discount': self.price_discount,
'price_surcharge': self.price_surcharge,
'price_round': self.price_round,
}
return action_read
else:
for prodct in self.env['product.template'].browse(
active_ids):
Expand Down

0 comments on commit a8fd81a

Please sign in to comment.