update ver

This commit is contained in:
ivan deng
2019-01-03 18:34:22 +08:00
parent 7803090ad1
commit 9bcf4a9cc0
7 changed files with 26 additions and 19 deletions

View File

@@ -3,12 +3,12 @@
{
'name': 'App Product Weight in Sales Order',
'version': '11.19.01.02',
'version': '11.19.01.03',
'summary': 'Add Product sku weight in Sale Order, product weight, sale weight, sale order weight, total weight, kg kg(s) lb lb(s) support',
'sequence': 10,
'license': 'LGPL-3',
'description': """
Add product sku weight in Sale Order. Unit of measure auto weight, kg kg(s) lb lb(s) support.
Add product sku weight in Sale Order. Unit of measure auto weight, kg kg(s) lb lb(s) support. weight sale order.
Calculates total weight of a sale order, which is the sum of individual weights of each unit of the products in the order。
Support kg(s) or lb(s)
""",

View File

@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e-20181123\n"
"Project-Id-Version: Odoo Server 12.0+e-20181221\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-12-14 04:46+0000\n"
"PO-Revision-Date: 2018-12-14 04:46+0000\n"
"POT-Creation-Date: 2019-01-02 15:10+0000\n"
"PO-Revision-Date: 2019-01-02 15:10+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,11 +15,6 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: app_product_weight_sale
#: model_terms:ir.ui.view,arch_db:app_product_weight_sale.sale_weight_line_form
msgid "<span> kg</span>"
msgstr ""
#. module: app_product_weight_sale
#: model:ir.model,name:app_product_weight_sale.model_sale_order
msgid "Sale Order"
@@ -32,8 +27,8 @@ msgstr "销售订单行"
#. module: app_product_weight_sale
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order__weight_total
msgid "Total Weight(kg)"
msgstr "总重量(kg)"
msgid "Total Weight"
msgstr "总重量"
#. module: app_product_weight_sale
#: model_terms:ir.ui.view,arch_db:app_product_weight_sale.sale_weight_line_form
@@ -43,7 +38,12 @@ msgstr "总重量"
#. module: app_product_weight_sale
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_line__weight
msgid "Weight"
msgstr "单"
msgstr "单位重量"
#. module: app_product_weight_sale
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order__weight_uom_name
msgid "Weight Measure"
msgstr "重量单位名"
#. module: app_product_weight_sale
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_line__weight_subtotal

View File

@@ -11,18 +11,18 @@ class SaleOrderLine(models.Model):
# 显示的单位,影响性能暂时不使用
# weight_uom_name = fields.Char(string='Weight Measure', related='product_id.weight_uom_id.name', readonly=True)
weight = fields.Float(string='Weight', compute='_compute_weight', readonly=True)
weight = fields.Float(string='Weight', compute='_compute_weight', store=True)
weight_subtotal = fields.Float(string='Weight Subtotal', compute='_compute_weight', store=True)
@api.multi
@api.depends('product_id', 'product_uom', 'product_qty')
@api.depends('product_id', 'product_uom', 'product_uom_qty')
def _compute_weight(self):
for line in self:
weight = 0
weight_subtotal = 0
if line.product_id and line.product_id.weight:
weight = line.product_id.weight / line.product_uom.factor
weight_subtotal += (weight * line.product_qty)
weight_subtotal += (weight * line.product_uom_qty)
line.weight = weight
line.weight_subtotal = weight_subtotal

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 135 KiB

View File

@@ -29,6 +29,13 @@
<img class="oe_screenshot" src="product_weight.jpg">
</div>
<div class="oe_demo oe_screenshot">
<h3 class='oe_mt32'>
Show product total weight in list view.
</h3>
<img class="oe_screenshot" src="demo2.jpg">
</div>
<div class="oe_demo oe_screenshot">
<h3 class='oe_mt32'>
Get product weight and total weight in order.

View File

@@ -9,7 +9,7 @@
<field name="inherit_id" ref="sale.view_order_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='amount_total']" position="before">
<field name="weight_total"/>
<field name="weight_total" sum="Total Weight"/>
</xpath>
</field>
</record>
@@ -20,7 +20,7 @@
<field name="inherit_id" ref="sale.view_quotation_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='amount_total']" position="before">
<field name="weight_total"/>
<field name="weight_total" sum="Total Weight"/>
</xpath>
</field>
</record>
@@ -39,7 +39,7 @@
</div>
<newline/>
</xpath>
<xpath expr="//field[@name='order_line']/tree/field[@name='product_uom']" position="after">
<xpath expr="//field[@name='order_line']/tree//field[@name='product_uom']" position="after">
<field name="weight"/>
<field name="weight_subtotal"/>
</xpath>