trytond-patches/limit_invoices_in_creit_not...

23 lines
981 B
Diff

diff -r 80fed5f82f06 invoice.py
--- a/trytond/trytond/modules/account_invoice/invoice.py Fri Nov 27 14:42:58 2015 +0100
+++ b/trytond/trytond/modules/account_invoice/invoice.py Fri Nov 27 14:43:25 2015 +0100
@@ -14,7 +14,7 @@
from trytond.wizard import Wizard, StateView, StateTransition, StateAction, \
Button
from trytond import backend
-from trytond.pyson import If, Eval, Bool, Id
+from trytond.pyson import PYSONEncoder, If, Eval, Bool, Id
from trytond.tools import reduce_ids, grouped_slice
from trytond.transaction import Transaction
from trytond.pool import Pool
@@ -2773,6 +2773,9 @@
credit_invoices = Invoice.credit(invoices, refund=refund)
data = {'res_id': [i.id for i in credit_invoices]}
+ action['pyson_domain'] = PYSONEncoder().encode([
+ ('id', 'in', [i.id for i in credit_invoices]),
+ ])
if len(credit_invoices) == 1:
action['views'].reverse()
return action, data