account_invoice_xrechnung/invoice.py
Frederik Jaeckel 08b8768dd4 formatting
2024-12-10 15:21:55 +01:00

25 lines
756 B
Python

# -*- coding: utf-8 -*-
# This file is part of the account-invoice-xrechnung-module
# from m-ds for Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from trytond.pool import PoolMeta
from trytond.pyson import Eval, And, Or, Bool
class InvoiceLine(metaclass=PoolMeta):
__name__ = 'account.invoice.line'
@classmethod
def __setup__(cls):
super(InvoiceLine, cls).__setup__()
cls.unit.states['required'] = Or(
cls.unit.states['required'],
And(
Eval('type') == 'line',
Eval('quantity', None) != None,
),
)
cls.unit.depends.extend(['type', 'quantity'])
# end Invoice