Skip to content
Snippets Groups Projects
Commit ae2cbfa2 authored by oco-odoo's avatar oco-odoo Committed by wan
Browse files

[FIX] account: make open_action() work with actions targetting both...

[FIX] account: make open_action() work with actions targetting both account.move and account.move.line
parent 40f0c28d
Branches
Tags
No related merge requests found
......@@ -494,10 +494,12 @@ class account_journal(models.Model):
'search_default_journal_id': self.id,
})
domain_type_field = action['res_model'] == 'account.move.line' and 'move_id.type' or 'type' # The model can be either account.move or account.move.line
if self.type == 'sale':
action['domain'] = [('move_id.type', 'in', ('out_invoice', 'out_refund', 'out_receipt'))]
action['domain'] = [(domain_type_field, 'in', ('out_invoice', 'out_refund', 'out_receipt'))]
elif self.type == 'purchase':
action['domain'] = [('move_id.type', 'in', ('in_invoice', 'in_refund', 'in_receipt'))]
action['domain'] = [(domain_type_field, 'in', ('in_invoice', 'in_refund', 'in_receipt'))]
return action
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment