mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update ver
This commit is contained in:
@@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': 'App Product Weight in Sales Order',
|
'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',
|
'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,
|
'sequence': 10,
|
||||||
'license': 'LGPL-3',
|
'license': 'LGPL-3',
|
||||||
'description': """
|
'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。
|
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)
|
Support kg(s) or lb(s)
|
||||||
""",
|
""",
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
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"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2018-12-14 04:46+0000\n"
|
"POT-Creation-Date: 2019-01-02 15:10+0000\n"
|
||||||
"PO-Revision-Date: 2018-12-14 04:46+0000\n"
|
"PO-Revision-Date: 2019-01-02 15:10+0000\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: <>\n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@@ -15,11 +15,6 @@ msgstr ""
|
|||||||
"Content-Transfer-Encoding: \n"
|
"Content-Transfer-Encoding: \n"
|
||||||
"Plural-Forms: \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
|
#. module: app_product_weight_sale
|
||||||
#: model:ir.model,name:app_product_weight_sale.model_sale_order
|
#: model:ir.model,name:app_product_weight_sale.model_sale_order
|
||||||
msgid "Sale Order"
|
msgid "Sale Order"
|
||||||
@@ -32,8 +27,8 @@ msgstr "销售订单行"
|
|||||||
|
|
||||||
#. module: app_product_weight_sale
|
#. module: app_product_weight_sale
|
||||||
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order__weight_total
|
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order__weight_total
|
||||||
msgid "Total Weight(kg)"
|
msgid "Total Weight"
|
||||||
msgstr "总重量(kg)"
|
msgstr "总重量"
|
||||||
|
|
||||||
#. module: app_product_weight_sale
|
#. module: app_product_weight_sale
|
||||||
#: model_terms:ir.ui.view,arch_db:app_product_weight_sale.sale_weight_line_form
|
#: 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
|
#. module: app_product_weight_sale
|
||||||
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_line__weight
|
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_line__weight
|
||||||
msgid "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
|
#. module: app_product_weight_sale
|
||||||
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_line__weight_subtotal
|
#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_line__weight_subtotal
|
||||||
|
|||||||
@@ -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_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)
|
weight_subtotal = fields.Float(string='Weight Subtotal', compute='_compute_weight', store=True)
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
@api.depends('product_id', 'product_uom', 'product_qty')
|
@api.depends('product_id', 'product_uom', 'product_uom_qty')
|
||||||
def _compute_weight(self):
|
def _compute_weight(self):
|
||||||
for line in self:
|
for line in self:
|
||||||
weight = 0
|
weight = 0
|
||||||
weight_subtotal = 0
|
weight_subtotal = 0
|
||||||
if line.product_id and line.product_id.weight:
|
if line.product_id and line.product_id.weight:
|
||||||
weight = line.product_id.weight / line.product_uom.factor
|
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 = weight
|
||||||
line.weight_subtotal = weight_subtotal
|
line.weight_subtotal = weight_subtotal
|
||||||
|
|
||||||
|
|||||||
BIN
app_product_weight_sale/static/description/demo2.jpg
Normal file
BIN
app_product_weight_sale/static/description/demo2.jpg
Normal file
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 |
@@ -29,6 +29,13 @@
|
|||||||
<img class="oe_screenshot" src="product_weight.jpg">
|
<img class="oe_screenshot" src="product_weight.jpg">
|
||||||
</div>
|
</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">
|
<div class="oe_demo oe_screenshot">
|
||||||
<h3 class='oe_mt32'>
|
<h3 class='oe_mt32'>
|
||||||
Get product weight and total weight in order.
|
Get product weight and total weight in order.
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<field name="inherit_id" ref="sale.view_order_tree"/>
|
<field name="inherit_id" ref="sale.view_order_tree"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='amount_total']" position="before">
|
<xpath expr="//field[@name='amount_total']" position="before">
|
||||||
<field name="weight_total"/>
|
<field name="weight_total" sum="Total Weight"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<field name="inherit_id" ref="sale.view_quotation_tree"/>
|
<field name="inherit_id" ref="sale.view_quotation_tree"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//field[@name='amount_total']" position="before">
|
<xpath expr="//field[@name='amount_total']" position="before">
|
||||||
<field name="weight_total"/>
|
<field name="weight_total" sum="Total Weight"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<newline/>
|
<newline/>
|
||||||
</xpath>
|
</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"/>
|
||||||
<field name="weight_subtotal"/>
|
<field name="weight_subtotal"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|||||||
Reference in New Issue
Block a user