changeset af0e374fc258 in modules/account_invoice_stock:default
details:
https://hg.tryton.org/modules/account_invoice_stock?cmd=changeset;node=af0e374fc258
description:
Add method to post invoices by batch
issue10054
review333811002
diffstat:
account.py | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diffs (26 lines):
diff -r 8a5e54db6bda -r af0e374fc258 account.py
--- a/account.py Wed Feb 17 13:37:08 2021 +0000
+++ b/account.py Sat Feb 27 15:23:46 2021 +0100
@@ -1,6 +1,6 @@
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
-from trytond.model import ModelSQL, ModelView, Workflow, fields
+from trytond.model import ModelSQL, fields
from trytond.pool import Pool, PoolMeta
from trytond.pyson import Eval, If
from trytond.transaction import Transaction
@@ -10,12 +10,10 @@
__name__ = 'account.invoice'
@classmethod
- @ModelView.button
- @Workflow.transition('posted')
- def post(cls, invoices):
+ def _post(cls, invoices):
pool = Pool()
Move = pool.get('stock.move')
- super().post(invoices)
+ super()._post(invoices)
moves = sum((l.stock_moves for i in invoices for l in i.lines), ())
if moves:
Move.__queue__.update_unit_price(moves)