line: symbol für akt. kurs

This commit is contained in:
Frederik Jaeckel 2022-12-25 11:36:12 +01:00
parent 9e44d3a11f
commit d04ba0c385
5 changed files with 24 additions and 4 deletions

10
book.py
View file

@ -59,6 +59,9 @@ class Book(SymbolMixin, metaclass=PoolMeta):
}, depends=DEPENDS2+['feature', 'lines', 'asset_uomcat'])
symbol = fields.Function(fields.Char(string='Symbol', readonly=True),
'on_change_with_symbol')
asset_symbol = fields.Function(fields.Many2One(string='Symbol',
readonly=True, model_name='cashbook.book'),
'on_change_with_asset_symbol')
quantity = fields.Function(fields.Numeric(string='Quantity',
help='Quantity of assets until to date', readonly=True,
digits=(16, Eval('quantity_digits', 4)),
@ -238,6 +241,13 @@ class Book(SymbolMixin, metaclass=PoolMeta):
result[name][record[0]] = values[name]
return result
@fields.depends('id')
def on_change_with_asset_symbol(self, name=None):
""" get current cashbook to enable usage of 'symbol'
in the form
"""
return self.id
@fields.depends('quantity_uom', 'currency')
def on_change_with_symbol(self, name=None):
""" get symbol for asset