line: Feld 'feature'

This commit is contained in:
Frederik Jaeckel 2022-12-21 21:55:08 +01:00
parent 7c1fb44cae
commit af0c825607
5 changed files with 19 additions and 0 deletions

View file

@ -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