mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
fix 11 weight
This commit is contained in:
@@ -11,9 +11,9 @@ class SaleOrder(models.Model):
|
|||||||
get_param = self.env['ir.config_parameter'].sudo().get_param
|
get_param = self.env['ir.config_parameter'].sudo().get_param
|
||||||
product_weight_in_lbs_param = get_param('product.weight_in_lbs')
|
product_weight_in_lbs_param = get_param('product.weight_in_lbs')
|
||||||
if product_weight_in_lbs_param == '1':
|
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:
|
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')
|
weight = fields.Float(string='Total Weight', compute='_compute_weight')
|
||||||
# 重量显示的单位
|
# 重量显示的单位
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<template id="app_report_saleorder_document" inherit_id="sale.report_saleorder_document">
|
<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">
|
<xpath expr="//tbody[hasclass('sale_tbody')]//td" position="attributes">
|
||||||
<t t-set="colspan" t-value="colspan+2"/>
|
<attribute name="colspan">9</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
<!--xpath 特殊处理,因为加载另的插件会影响顺序,要精确定位,可用th[contains(text(), 'Quantity')]-->
|
<!--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 Unit</strong></th>
|
||||||
<th class="text-right app_sunpop"><strong>Weight Subtotal</strong></th>
|
<th class="text-right app_sunpop"><strong>Weight Subtotal</strong></th>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//div[@class='page']/table[1]/tbody/t/tr[1]/t/td[@class='text-right'][1]" position="after">
|
<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="line.weight_unit"/></td>
|
<td class="text-right app_sunpop"><span t-field="l.weight_unit"/></td>
|
||||||
<td class="text-right app_sunpop"><span t-field="line.weight"/></td>
|
<td class="text-right app_sunpop"><span t-field="l.weight"/></td>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//div[@class='page']//p[@t-field='doc.note']" position="before">
|
<xpath expr="//div[@class='page']//p[@t-field='doc.note']" position="before">
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
Reference in New Issue
Block a user