line: felder löschen bei änderung von bookingtype
This commit is contained in:
parent
7999440de7
commit
3db6822f26
3 changed files with 23 additions and 5 deletions
10
splitline.py
10
splitline.py
|
@ -67,6 +67,8 @@ class SplitLine(ModelSQL, ModelView):
|
|||
amount = fields.Numeric(string='Amount', digits=(16, Eval('currency_digits', 2)),
|
||||
required=True, states=STATES, depends=DEPENDS+['currency_digits'])
|
||||
|
||||
date = fields.Function(fields.Date(string='Date', readonly=True),
|
||||
'on_change_with_date')
|
||||
target = fields.Function(fields.Reference(string='Target', readonly=True,
|
||||
selection=sel_target), 'on_change_with_target')
|
||||
currency = fields.Function(fields.Many2One(model_name='currency.currency',
|
||||
|
@ -134,6 +136,14 @@ class SplitLine(ModelSQL, ModelView):
|
|||
if self.splittype == 'tr':
|
||||
self.category = None
|
||||
|
||||
@fields.depends('line', '_parent_line.date')
|
||||
def on_change_with_date(self, name=None):
|
||||
""" get date of line
|
||||
"""
|
||||
if self.line:
|
||||
if self.line.date is not None:
|
||||
return self.line.date
|
||||
|
||||
@fields.depends('splittype', 'category', 'booktransf')
|
||||
def on_change_with_target(self, name=None):
|
||||
""" get category or cashbook
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue