diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-11-17 13:05:15 +0100 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-11-17 13:05:15 +0100 |
| commit | c9fce1a40441a559c8a36d4ca1d6b2deaf9cae1f (patch) | |
| tree | c546573f84b79f3277ac4d418c6cf932cb45f54e | |
| parent | e3b90ba1d45f9d8c23852b92bcf672b435f43cc6 (diff) | |
| parent | f69b0cade1ed064ad77a04a3421cabcca255a308 (diff) | |
[MERGE] forward port of branch saas-3 up to f69b0ca
| -rw-r--r-- | addons/mrp/report/price.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/addons/mrp/report/price.py b/addons/mrp/report/price.py index eafb8e146fe..38966915840 100644 --- a/addons/mrp/report/price.py +++ b/addons/mrp/report/price.py @@ -42,6 +42,8 @@ class report_custom(report_rml): rml_obj.localcontext.update({'lang':context.get('lang',False)}) company_currency = user_pool.browse(cr, uid, uid).company_id.currency_id company_currency_symbol = company_currency.symbol or company_currency.name + product_uom_digits = rml_obj.get_digits(dp='Product Unit of Measure') + purchase_price_digits = rml_obj.get_digits(dp='Product Price') def process_bom(bom, currency_id, factor=1): xml = '<row>' sum = 0 @@ -63,7 +65,7 @@ class report_custom(report_rml): 'uom': prod.uom_po_id.id, 'date': time.strftime('%Y-%m-%d'), })[pricelist.id] - main_sp_price = """<b>"""+rml_obj.formatLang(price)+' '+ (company_currency_symbol)+"""</b>\r\n""" + main_sp_price = """<b>"""+rml_obj.formatLang(price, digits=purchase_price_digits)+' '+ (company_currency_symbol)+"""</b>\r\n""" sum += prod_qtty*price std_price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, prod.standard_price, to_uom_id=product_uom.id) main_strd_price = str(std_price) + '\r\n' @@ -78,11 +80,11 @@ class report_custom(report_rml): 'uom': prod.uom_po_id.id, 'date': time.strftime('%Y-%m-%d'), })[pricelist.id] - sellers_price += """<i>"""+rml_obj.formatLang(price) +' '+ (company_currency_symbol) +"""</i>\r\n""" + sellers_price += """<i>"""+rml_obj.formatLang(price, digits=purchase_price_digits) +' '+ (company_currency_symbol) +"""</i>\r\n""" xml += """<col para='yes'> """+ prod_name +""" </col> <col para='yes'> """+ main_sp_name + sellers + """ </col> - <col f='yes'>"""+ rml_obj.formatLang(prod_qtty) +' '+ product_uom_name +"""</col> - <col f='yes'>"""+ rml_obj.formatLang(float(main_strd_price)) +' '+ (company_currency_symbol) +"""</col> + <col f='yes'>"""+ rml_obj.formatLang(prod_qtty, digits=product_uom_digits) +' '+ product_uom_name +"""</col> + <col f='yes'>"""+ rml_obj.formatLang(float(main_strd_price), digits=purchase_price_digits) +' '+ (company_currency_symbol) +"""</col> <col f='yes'>""" + main_sp_price + sellers_price + """</col>'""" xml += '</row>' @@ -140,8 +142,6 @@ class report_custom(report_rml): </row> """ % (_('Components'), _('Components suppliers'), _('Quantity'),_('Cost Price per Unit of Measure'), _('Supplier Price per Unit of Measure')) - purchase_price_digits = rml_obj.get_digits(dp='Product Price') - for product in product_pool.browse(cr, uid, ids, context=context): product_uom_name = to_xml(product.uom_id.name) bom_id = bom_pool._bom_find(cr, uid, product_id=product.id, context=context) |
