asset: Feld 'symbol' in übersetzter form
This commit is contained in:
parent
813a794db4
commit
7dd7c9a140
1 changed files with 7 additions and 4 deletions
11
asset.py
11
asset.py
|
@ -236,9 +236,12 @@ class Asset(SymbolMixin, ModelSQL, ModelView):
|
|||
tab_templ = ProdTempl.__table__()
|
||||
tab_prod = Product.__table__()
|
||||
tab_uom = Uom.__table__()
|
||||
tab_uom2 = Uom.__table__()
|
||||
tab_cur = Currency.__table__()
|
||||
|
||||
# get translated symbol-column from UOM
|
||||
(tab1, join1, col1) = Uom.symbol._get_translation_column(Uom, 'symbol')
|
||||
tab_symb = join1.select(tab1.id, col1.as_('symbol'))
|
||||
|
||||
query = tab_asset.join(tab_prod,
|
||||
condition=tab_asset.product==tab_prod.id,
|
||||
).join(tab_templ,
|
||||
|
@ -247,13 +250,13 @@ class Asset(SymbolMixin, ModelSQL, ModelView):
|
|||
condition=tab_templ.default_uom==tab_uom.id,
|
||||
).join(tab_cur,
|
||||
condition=tab_asset.currency==tab_cur.id,
|
||||
).join(tab_uom2,
|
||||
condition=tab_asset.uom==tab_uom2.id,
|
||||
).join(tab_symb,
|
||||
condition=tab_asset.uom==tab_symb.id,
|
||||
).select(
|
||||
tab_asset.id,
|
||||
tab_templ.name,
|
||||
tab_uom.category.as_('product_uom'),
|
||||
Concat2(tab_cur.symbol, '/', tab_uom2.symbol).as_('symbol'),
|
||||
Concat2(tab_cur.symbol, '/', tab_symb.symbol).as_('symbol'),
|
||||
)
|
||||
return (query, tab_asset)
|
||||
|
||||
|
|
Loading…
Reference in a new issue