Add method to post invoices by batch

issue10054
review333811002
This commit is contained in:
Cédric Krier committed 2021-02-27 15:23:46 +01:00
1 parent 7fc6668ea3
commit 6f3bbbeb4f
1 file changed
+2 -4
+2 -4
View File
@@ -29,13 +29,11 @@ class Invoice(metaclass=PoolMeta):
return super()._journal_types(invoice_type) + ['commission']
@classmethod
@ModelView.button
@Workflow.transition('posted')
def post(cls, invoices):
def _post(cls, invoices):
# Create commission only the first time the invoice is posted
to_commission = [i for i in invoices
if i.state not in ['posted', 'paid']]
super(Invoice, cls).post(invoices)
super()._post(invoices)
cls.create_commissions(to_commission)
@classmethod