changeset 8ec8bd03e679 in modules/account_invoice:default
details: 
https://hg.tryton.org/modules/account_invoice?cmd=changeset;node=8ec8bd03e679
description:
        Add domain to invoice's journal

        issue5175
        review310491002
diffstat:

 CHANGELOG  |  1 +
 invoice.py |  8 +++++++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r a34e1c79a2fe -r 8ec8bd03e679 CHANGELOG
--- a/CHANGELOG Fri Oct 09 22:01:50 2020 +0200
+++ b/CHANGELOG Sun Oct 11 13:02:20 2020 +0200
@@ -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 -r a34e1c79a2fe -r 8ec8bd03e679 invoice.py
--- a/invoice.py        Fri Oct 09 22:01:50 2020 +0200
+++ b/invoice.py        Sun Oct 11 13:02:20 2020 +0200
@@ -116,7 +116,13 @@
     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)),

Reply via email to