From 166a9e13a9d77c81f90834450950e1bc70b75dc2 Mon Sep 17 00:00:00 2001 From: Frederik Jaeckel Date: Wed, 4 Jan 2023 17:12:46 +0100 Subject: [PATCH] =?UTF-8?q?asset:=20spalte=20'einheit'=20entf=C3=A4llt,=20?= =?UTF-8?q?Spalte=20'Kurs'=20hat=20nun=20die=20Einheit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- asset.py | 5 +++++ locale/de.po | 4 ++++ locale/en.po | 4 ++++ tests/test_asset.py | 1 + view/asset_list.xml | 5 ++--- 5 files changed, 16 insertions(+), 3 deletions(-) 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. --> - + - - +