diff options
| author | Martin Trigaux <mat@odoo.com> | 2020-05-25 07:04:52 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2020-08-17 09:09:02 +0000 |
| commit | 6156f98288b16f6c84d36bacf16d5a66a661abb3 (patch) | |
| tree | 7a760d990d660640fed108a5d1fb5c8ce62a52e5 /addons/mrp_account | |
| parent | d5c16492397047ceb97a0879aa61f068a0eeeca8 (diff) | |
[FIX] *: adapt action content retrieval
Use _for_xml_id to replace all the self.env.ref().read()[0]
This has the advantage of having a single point of control and to add
the fields filtering and model verification.
Add sudo for other operations on ir.actions.*
Diffstat (limited to 'addons/mrp_account')
| -rw-r--r-- | addons/mrp_account/models/mrp_production.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mrp_account/models/mrp_production.py b/addons/mrp_account/models/mrp_production.py index b53b38d5a95..d193a98eecd 100644 --- a/addons/mrp_account/models/mrp_production.py +++ b/addons/mrp_account/models/mrp_production.py @@ -79,7 +79,7 @@ class MrpProduction(models.Model): def action_view_stock_valuation_layers(self): self.ensure_one() domain = [('id', 'in', (self.move_raw_ids + self.move_finished_ids + self.scrap_ids.move_id).stock_valuation_layer_ids.ids)] - action = self.env.ref('stock_account.stock_valuation_layer_action').read()[0] + action = self.env["ir.actions.actions"]._for_xml_id("stock_account.stock_valuation_layer_action") context = literal_eval(action['context']) context.update(self.env.context) context['no_at_date'] = True |
