fix 11 weight

This commit is contained in:
ivan deng
2019-03-29 14:55:43 +08:00
parent ba19facc8b
commit 515a036ee7
2 changed files with 8 additions and 8 deletions

View File

@@ -11,9 +11,9 @@ class SaleOrder(models.Model):
get_param = self.env['ir.config_parameter'].sudo().get_param
product_weight_in_lbs_param = get_param('product.weight_in_lbs')
if product_weight_in_lbs_param == '1':
return self.env.ref('uom.product_uom_lb').name
return self.env.ref('product.product_uom_lb').name
else:
return self.env.ref('uom.product_uom_kgm').name
return self.env.ref('product.product_uom_kgm').name
weight = fields.Float(string='Total Weight', compute='_compute_weight')
# 重量显示的单位

View File

@@ -2,17 +2,17 @@
<odoo>
<data>
<template id="app_report_saleorder_document" inherit_id="sale.report_saleorder_document">
<xpath expr="//table[hasclass('table', 'table-sm')]/thead/tr/th[1]" position="before">
<t t-set="colspan" t-value="colspan+2"/>
<xpath expr="//tbody[hasclass('sale_tbody')]//td" position="attributes">
<attribute name="colspan">9</attribute>
</xpath>
<!--xpath 特殊处理因为加载另的插件会影响顺序要精确定位可用th[contains(text(), 'Quantity')]-->
<xpath expr="//div[@class='page']/table[1]/thead/tr/th[@class='text-right'][1]" position="after">
<xpath expr="//div[@class='page']/t/table/thead/tr/th[@class='text-right'][1]" position="after">
<th class="text-right app_sunpop"><strong>Weight Unit</strong></th>
<th class="text-right app_sunpop"><strong>Weight Subtotal</strong></th>
</xpath>
<xpath expr="//div[@class='page']/table[1]/tbody/t/tr[1]/t/td[@class='text-right'][1]" position="after">
<td class="text-right app_sunpop"><span t-field="line.weight_unit"/></td>
<td class="text-right app_sunpop"><span t-field="line.weight"/></td>
<xpath expr="//div[@class='page']/t/table/tbody/t/t[2]/tr/td[@class='text-right'][1]" position="after">
<td class="text-right app_sunpop"><span t-field="l.weight_unit"/></td>
<td class="text-right app_sunpop"><span t-field="l.weight"/></td>
</xpath>
<xpath expr="//div[@class='page']//p[@t-field='doc.note']" position="before">
<p>