trytonpsk-hotel/statement.py

22 lines
651 B
Python
Raw Normal View History

2022-10-13 22:27:24 +02:00
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
2022-07-08 22:09:07 +02:00
2022-10-13 22:27:24 +02:00
from trytond.pool import PoolMeta
2022-07-08 22:09:07 +02:00
class StatementLine(metaclass=PoolMeta):
__name__ = 'account.statement.line'
2022-10-06 02:39:28 +02:00
@classmethod
def _get_source(cls):
return super(StatementLine, cls)._get_source() + [
'hotel.booking', 'hotel.folio'
]
2022-07-08 22:09:07 +02:00
@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()