Do not reverse commission when canceling invoice with move
issue10845 review387121002 (grafted from 8edc569fdc8713d2726b0d88970df1f6d6b45f75) --HG-- branch : 6.0
This commit is contained in:
1 parent
a6eeebaa8d
commit
165ecd487a
1 file changed
+3
-1
+3
-1
@@ -86,11 +86,13 @@ class Invoice(metaclass=PoolMeta):
|
||||
pool = Pool()
|
||||
Commission = pool.get('commission')
|
||||
|
||||
invoices_to_revert_commission = [x for x in invoices if not x.move]
|
||||
|
||||
super(Invoice, cls).cancel(invoices)
|
||||
|
||||
to_delete = []
|
||||
to_save = []
|
||||
for sub_invoices in grouped_slice(invoices):
|
||||
for sub_invoices in grouped_slice(invoices_to_revert_commission):
|
||||
ids = [i.id for i in sub_invoices]
|
||||
to_delete += Commission.search([
|
||||
('invoice_line', '=', None),
|
||||
|
||||
Reference in new issue
Block a user