summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas (vin) <vin@odoo.com>2020-09-23 09:11:14 +0000
committerNicolas (vin) <vin@odoo.com>2020-09-23 10:20:47 +0000
commitf9ef2c8cd980ecb9eee22d4cc43d5291953471ef (patch)
tree8f6a2b87729d1835da200ddb350c4e66b7c1c4ce /addons
parentb12b6eb91995fc8b9580fc97e4b49ac83d3e761a (diff)
[FIX] account: Fix automatic wizard issues
When coming from the dashboard (dashboard => Bills to pay => Bill) The context contains information about the purchase journal and not the move line, causing an issue in the wizard. This change will make sure the context always contains the necessary move line information Task id #2344722 closes odoo/odoo#58316 Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_move.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py
index 2905ff4764d..18bce175ac5 100644
--- a/addons/account/models/account_move.py
+++ b/addons/account/models/account_move.py
@@ -4664,7 +4664,12 @@ class AccountMoveLine(models.Model):
def action_automatic_entry(self):
[action] = self.env.ref('account.account_automatic_entry_wizard_action').read()
- action['context'] = self.env.context
+ # Force the values of the move line in the context to avoid issues
+ ctx = dict(self.env.context)
+ ctx['active_id'] = self.id
+ ctx['active_ids'] = self.ids
+ ctx['active_model'] = 'account.move.line'
+ action['context'] = ctx
return action
@api.model