asset: spalte 'einheit' entfällt, Spalte 'Kurs' hat nun die Einheit

This commit is contained in:
Frederik Jaeckel 2023-01-04 17:12:46 +01:00
parent d9403e4946
commit 166a9e13a9
5 changed files with 16 additions and 3 deletions

View file

@ -48,6 +48,10 @@ class Asset(SymbolMixin, ModelSQL, ModelView):
], depends=['product_uom', 'product']) ], depends=['product_uom', 'product'])
symbol = fields.Function(fields.Char(string='UOM', readonly=True), symbol = fields.Function(fields.Char(string='UOM', readonly=True),
'get_name_symbol', searcher='search_uom_symbol') 'get_name_symbol', searcher='search_uom_symbol')
asset_symbol = fields.Function(fields.Many2One(string='Symbol',
readonly=True, model_name='investment.asset'),
'get_name_symbol')
rates = fields.One2Many(string='Rates', field='asset', rates = fields.One2Many(string='Rates', field='asset',
model_name='investment.rate') model_name='investment.rate')
rate = fields.Function(fields.Numeric(string='Current Rate', rate = fields.Function(fields.Numeric(string='Current Rate',
@ -278,6 +282,7 @@ class Asset(SymbolMixin, ModelSQL, ModelView):
'name': record[1], 'name': record[1],
'product_uom': record[2], 'product_uom': record[2],
'symbol': record[3], 'symbol': record[3],
'asset_symbol': record[0],
} }
for name in names: for name in names:

View file

@ -206,6 +206,10 @@ msgctxt "field:investment.asset,symbol:"
msgid "UOM" msgid "UOM"
msgstr "Einheit" msgstr "Einheit"
msgctxt "field:investment.asset,asset_symbol:"
msgid "Symbol"
msgstr "Symbol"
msgctxt "field:investment.asset,wkn:" msgctxt "field:investment.asset,wkn:"
msgid "NSIN" msgid "NSIN"
msgstr "WKN" msgstr "WKN"

View file

@ -166,6 +166,10 @@ msgctxt "field:investment.asset,symbol:"
msgid "UOM" msgid "UOM"
msgstr "UOM" msgstr "UOM"
msgctxt "field:investment.asset,asset_symbol:"
msgid "Symbol"
msgstr "Symbol"
msgctxt "field:investment.asset,wkn:" msgctxt "field:investment.asset,wkn:"
msgid "NSIN" msgid "NSIN"
msgstr "NSIN" msgstr "NSIN"

View file

@ -87,6 +87,7 @@ class AssetTestCase(ModuleTestCase):
company=company, company=company,
product = product) product = product)
self.assertEqual(asset.symbol, 'usd/u') self.assertEqual(asset.symbol, 'usd/u')
self.assertEqual(asset.asset_symbol.symbol, 'usd/u')
# check ranges # check ranges
Asset.write(*[ Asset.write(*[

View file

@ -3,14 +3,13 @@
The COPYRIGHT file at the top level of this repository contains the The COPYRIGHT file at the top level of this repository contains the
full copyright notices and license terms. --> full copyright notices and license terms. -->
<tree> <tree>
<field name="name" expand="2"/> <field name="name" expand="1"/>
<field name="change_day1" /> <field name="change_day1" />
<field name="change_month1" /> <field name="change_month1" />
<field name="change_month3" /> <field name="change_month3" />
<field name="change_month6" /> <field name="change_month6" />
<field name="date"/> <field name="date"/>
<field name="rate"/> <field name="rate" symbol="asset_symbol"/>
<field name="symbol"/>
<field name="isin"/> <field name="isin"/>
<field name="wkn" /> <field name="wkn" />
</tree> </tree>