From 6a408088e11a46672f6cd6d835ca9fb9ef233fb3 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Mon, 8 Aug 2016 15:23:14 +0200 Subject: [PATCH] Apply invoice's account clause only when the account is set The account domain on invoice field is applied when the party is set, but it should only be applied when the account is set. This gives an invalid domain when the party is set and the account is not set. issue5766 review32391002 --- statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statement.py b/statement.py index 1533b0e5da..fac5cf7d51 100644 --- a/statement.py +++ b/statement.py @@ -558,7 +558,7 @@ class Line(ModelSQL, ModelView): invoice = fields.Many2One('account.invoice', 'Invoice', domain=[ If(Bool(Eval('party')), [('party', '=', Eval('party'))], []), - If(Bool(Eval('party')), [('account', '=', Eval('account'))], []), + If(Bool(Eval('account')), [('account', '=', Eval('account'))], []), If(Eval('_parent_statement', {}).get('state') == 'draft', ('state', '=', 'posted'), ('state', '!=', '')),