# This file is part of the hotel module for Tryton. # 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 from trytond.wizard import Button, StateTransition, StateView, Wizard, StateReport from trytond.pyson import Eval from trytond.i18n import gettext from trytond.exceptions import UserError from trytond.report import Report 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()