trytonpsk-hotel/statement.py

26 lines
908 B
Python
Raw Normal View History

2022-09-30 21:22:38 +02:00
# This file is part of the hotel module for Tryton.
2022-07-08 22:09:07 +02:00
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from datetime import date
from decimal import Decimal
from trytond.model import fields, ModelView, ModelSQL, Workflow
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
2022-09-30 21:22:38 +02:00
from trytond.wizard import Button, StateTransition, StateView, Wizard, StateReport
2022-07-08 22:09:07 +02:00
from trytond.pyson import Eval
from trytond.i18n import gettext
from trytond.exceptions import UserError
2022-09-30 21:22:38 +02:00
from trytond.report import Report
2022-07-08 22:09:07 +02:00
class StatementLine(metaclass=PoolMeta):
__name__ = 'account.statement.line'
@classmethod
def post_move(cls, lines):
super(StatementLine, cls).post_move(lines)
for s in lines:
if s.invoice and s.move and s.invoice.state != 'paid':
s.invoice.auto_reconcile()