diff --git a/CHANGELOG b/CHANGELOG index 3838ecbd27..f743f2d1c9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Add domain to invoice's journal * Add optional taxes date on invoice line * Convert Invoice.update_taxes into dualmethod * Rename invoice state from cancel to cancelled diff --git a/invoice.py b/invoice.py index c4bd81d9dc..ac492aaf9a 100644 --- a/invoice.py +++ b/invoice.py @@ -116,7 +116,13 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin): currency_date = fields.Function(fields.Date('Currency Date'), 'on_change_with_currency_date') journal = fields.Many2One('account.journal', 'Journal', required=True, - states=_states, depends=_depends) + states=_states, + domain=[ + If(Eval('type') == 'out', + ('type', '=', 'revenue'), + ('type', '=', 'expense')) + ], + depends=_depends + ['type']) move = fields.Many2One('account.move', 'Move', readonly=True, domain=[ ('company', '=', Eval('company', -1)),