diff --git a/asset.py b/asset.py index ddfcd21..2e32d3f 100644 --- a/asset.py +++ b/asset.py @@ -48,6 +48,10 @@ class Asset(SymbolMixin, ModelSQL, ModelView): ], depends=['product_uom', 'product']) symbol = fields.Function(fields.Char(string='UOM', readonly=True), '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', model_name='investment.rate') rate = fields.Function(fields.Numeric(string='Current Rate', @@ -278,6 +282,7 @@ class Asset(SymbolMixin, ModelSQL, ModelView): 'name': record[1], 'product_uom': record[2], 'symbol': record[3], + 'asset_symbol': record[0], } for name in names: diff --git a/locale/de.po b/locale/de.po index 99f1889..1de7cbe 100644 --- a/locale/de.po +++ b/locale/de.po @@ -206,6 +206,10 @@ msgctxt "field:investment.asset,symbol:" msgid "UOM" msgstr "Einheit" +msgctxt "field:investment.asset,asset_symbol:" +msgid "Symbol" +msgstr "Symbol" + msgctxt "field:investment.asset,wkn:" msgid "NSIN" msgstr "WKN" diff --git a/locale/en.po b/locale/en.po index 809e7ee..7e3c6f3 100644 --- a/locale/en.po +++ b/locale/en.po @@ -166,6 +166,10 @@ msgctxt "field:investment.asset,symbol:" msgid "UOM" msgstr "UOM" +msgctxt "field:investment.asset,asset_symbol:" +msgid "Symbol" +msgstr "Symbol" + msgctxt "field:investment.asset,wkn:" msgid "NSIN" msgstr "NSIN" diff --git a/tests/test_asset.py b/tests/test_asset.py index 6af868b..256331f 100644 --- a/tests/test_asset.py +++ b/tests/test_asset.py @@ -87,6 +87,7 @@ class AssetTestCase(ModuleTestCase): company=company, product = product) self.assertEqual(asset.symbol, 'usd/u') + self.assertEqual(asset.asset_symbol.symbol, 'usd/u') # check ranges Asset.write(*[ diff --git a/view/asset_list.xml b/view/asset_list.xml index bfa9123..67abbdb 100644 --- a/view/asset_list.xml +++ b/view/asset_list.xml @@ -3,14 +3,13 @@ The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. --> - + - - +