exprt wizard begonnen
This commit is contained in:
parent
7b160d84af
commit
00dd70e877
7 changed files with 142 additions and 8 deletions
25
invoice.py
Normal file
25
invoice.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# This file is part of the cashbook-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
|
||||
|
||||
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue