line: symbol für akt. kurs
This commit is contained in:
parent
9e44d3a11f
commit
d04ba0c385
5 changed files with 24 additions and 4 deletions
10
book.py
10
book.py
|
@ -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
|
||||
|
|
7
line.py
7
line.py
|
@ -34,7 +34,9 @@ class Line(metaclass=PoolMeta):
|
|||
digits=(16, If(
|
||||
Eval('currency_digits', 2) > Eval('quantity_digits', 2),
|
||||
Eval('currency_digits', 2), Eval('quantity_digits', 2))),
|
||||
depends=['currency_digits', 'quantity_digits']),
|
||||
states={
|
||||
'invisible': Eval('feature', '') != 'asset',
|
||||
}, depends=['currency_digits', 'quantity_digits', 'feature']),
|
||||
'on_change_with_asset_rate')
|
||||
|
||||
@fields.depends('quantity', 'amount', 'currency_digits', 'quantity_digits')
|
||||
|
@ -56,7 +58,8 @@ class Line(metaclass=PoolMeta):
|
|||
""" get quantity-unit of asset
|
||||
"""
|
||||
if self.cashbook:
|
||||
return self.cashbook.quantity_uom.id
|
||||
if self.cashbook.quantity_uom:
|
||||
return self.cashbook.quantity_uom.id
|
||||
|
||||
@fields.depends('cashbook', '_parent_cashbook.quantity_digits')
|
||||
def on_change_with_quantity_digits(self, name=None):
|
||||
|
|
|
@ -50,6 +50,10 @@ msgctxt "field:cashbook.book,symbol:"
|
|||
msgid "Symbol"
|
||||
msgstr "Symbol"
|
||||
|
||||
msgctxt "field:cashbook.book,asset_symbol:"
|
||||
msgid "Symbol"
|
||||
msgstr "Symbol"
|
||||
|
||||
msgctxt "field:cashbook.book,quantity:"
|
||||
msgid "Quantity"
|
||||
msgstr "Anzahl"
|
||||
|
|
|
@ -42,6 +42,10 @@ msgctxt "field:cashbook.book,symbol:"
|
|||
msgid "Symbol"
|
||||
msgstr "Symbol"
|
||||
|
||||
msgctxt "field:cashbook.book,asset_symbol:"
|
||||
msgid "Symbol"
|
||||
msgstr "Symbol"
|
||||
|
||||
msgctxt "field:cashbook.book,quantity:"
|
||||
msgid "Quantity"
|
||||
msgstr "Quantity"
|
||||
|
|
|
@ -26,8 +26,7 @@ full copyright notices and license terms. -->
|
|||
<label name="diff_percent" xalign="0.0" string="%" xexpand="1"/>
|
||||
</group>
|
||||
<label name="current_rate"/>
|
||||
<field name="current_rate"/>
|
||||
|
||||
<field name="current_rate" symbol="asset_symbol"/>
|
||||
</xpath>
|
||||
|
||||
<xpath expr="/form/notebook/page[@id='pggeneral']" position="after">
|
||||
|
|
Loading…
Reference in a new issue