From 6b60ad2bf03e63c2d42ad6a4c515f1b805a01de7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 27 Feb 2021 15:23:46 +0100 Subject: [PATCH] Add method to post invoices by batch issue10054 review333811002 --- account.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/account.py b/account.py index cadb7e18f4..31927dd552 100644 --- a/account.py +++ b/account.py @@ -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 @@ class Invoice(metaclass=PoolMeta): __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)