Add domain to invoice's journal

issue5175
review310491002
This commit is contained in:
Abraham Cabezas committed 2020-10-11 13:02:20 +02:00
1 parent 293215a3ae
commit c6481ee9d5
2 files changed
+8 -1

No files matched your search

+1
View File
@@ -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
+7 -1
View File
@@ -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)),