line: Feld 'feature'
This commit is contained in:
parent
7c1fb44cae
commit
af0c825607
5 changed files with 19 additions and 0 deletions
9
line.py
9
line.py
|
@ -82,6 +82,8 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
|
|||
)])
|
||||
category_view = fields.Function(fields.Char(string='Category', readonly=True),
|
||||
'on_change_with_category_view', searcher='search_category_view')
|
||||
feature = fields.Function(fields.Char(string='Feature', readonly=True,
|
||||
states={'invisible': True}), 'on_change_with_feature')
|
||||
|
||||
bookingtype = fields.Selection(string='Type', required=True,
|
||||
help='Type of Booking', selection=sel_bookingtype,
|
||||
|
@ -598,6 +600,13 @@ class Line(SecondCurrencyMixin, Workflow, ModelSQL, ModelView):
|
|||
self.booktransf = None
|
||||
self.currency2nd = self.on_change_with_currency2nd()
|
||||
|
||||
@fields.depends('cashbook', '_parent_cashbook.btype')
|
||||
def on_change_with_feature(self, name=None):
|
||||
""" get feature-set
|
||||
"""
|
||||
if self.cashbook:
|
||||
return self.cashbook.btype.feature
|
||||
|
||||
@fields.depends('description')
|
||||
def on_change_with_descr_short(self, name=None):
|
||||
""" to speed up list-view
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue