diff --git a/app_sale_order_weight/__init__.py b/app_product_weight_sale/__init__.py similarity index 100% rename from app_sale_order_weight/__init__.py rename to app_product_weight_sale/__init__.py diff --git a/app_sale_order_weight/__manifest__.py b/app_product_weight_sale/__manifest__.py similarity index 100% rename from app_sale_order_weight/__manifest__.py rename to app_product_weight_sale/__manifest__.py diff --git a/app_product_weight_sale/i18n/zh_CN.po b/app_product_weight_sale/i18n/zh_CN.po new file mode 100644 index 00000000..b0a0dd49 --- /dev/null +++ b/app_product_weight_sale/i18n/zh_CN.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * app_product_weight_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0+e-20180617\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-07-20 17:42+0000\n" +"PO-Revision-Date: 2018-07-20 17:42+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: app_product_weight_sale +#: model:ir.ui.view,arch_db:app_product_weight_sale.sale_weight_line_form +msgid " kg" +msgstr " 公斤" + +#. module: app_product_weight_sale +#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_total_weight +msgid "Total Weight(kg)" +msgstr "总重量(kg)" + +#. module: app_product_weight_sale +#: model:ir.ui.view,arch_db:app_product_weight_sale.sale_weight_line_form +msgid "Total Weight:" +msgstr "总重量:" + +#. module: app_product_weight_sale +#: model:ir.model.fields,field_description:app_product_weight_sale.field_sale_order_line_weight +msgid "Weight(kg)" +msgstr "公斤" + diff --git a/app_sale_order_weight/models/__init__.py b/app_product_weight_sale/models/__init__.py similarity index 100% rename from app_sale_order_weight/models/__init__.py rename to app_product_weight_sale/models/__init__.py diff --git a/app_sale_order_weight/models/sale_order.py b/app_product_weight_sale/models/sale_order.py similarity index 100% rename from app_sale_order_weight/models/sale_order.py rename to app_product_weight_sale/models/sale_order.py diff --git a/app_sale_order_weight/models/sale_order_line.py b/app_product_weight_sale/models/sale_order_line.py similarity index 71% rename from app_sale_order_weight/models/sale_order_line.py rename to app_product_weight_sale/models/sale_order_line.py index d6cc3744..31e3ba86 100644 --- a/app_sale_order_weight/models/sale_order_line.py +++ b/app_product_weight_sale/models/sale_order_line.py @@ -4,19 +4,21 @@ from odoo import api, fields, models, _ + # Record the net weight of the order line class SaleOrderLine(models.Model): _inherit = 'sale.order.line' weight = fields.Float(string='Weight(kg)', compute='_compute_weight', - inverse='_set_weight', store=True) + inverse='_set_weight', store=True) + @api.multi + @api.depends('product_id', 'product_uom_qty') def _compute_weight(self): for line in self: weight = 0 if line.product_id and line.product_id.weight: - weight += (line.product_id.weight - * line.product_uom_qty / line.product_uom.factor) + weight += (line.product_id.weight * line.product_uom_qty / line.product_uom.factor) line.weight = weight @api.one diff --git a/app_sale_order_weight/static/description/banner.jpg b/app_product_weight_sale/static/description/banner.jpg similarity index 100% rename from app_sale_order_weight/static/description/banner.jpg rename to app_product_weight_sale/static/description/banner.jpg diff --git a/app_sale_order_weight/static/description/icon.png b/app_product_weight_sale/static/description/icon.png similarity index 100% rename from app_sale_order_weight/static/description/icon.png rename to app_product_weight_sale/static/description/icon.png diff --git a/app_sale_order_weight/static/description/index.html b/app_product_weight_sale/static/description/index.html similarity index 100% rename from app_sale_order_weight/static/description/index.html rename to app_product_weight_sale/static/description/index.html diff --git a/app_sale_order_weight/static/description/sale_weight.png b/app_product_weight_sale/static/description/sale_weight.png similarity index 100% rename from app_sale_order_weight/static/description/sale_weight.png rename to app_product_weight_sale/static/description/sale_weight.png diff --git a/app_sale_order_weight/static/description/sale_weight_product.png b/app_product_weight_sale/static/description/sale_weight_product.png similarity index 100% rename from app_sale_order_weight/static/description/sale_weight_product.png rename to app_product_weight_sale/static/description/sale_weight_product.png diff --git a/app_sale_order_weight/views/sale_order_views.xml b/app_product_weight_sale/views/sale_order_views.xml similarity index 100% rename from app_sale_order_weight/views/sale_order_views.xml rename to app_product_weight_sale/views/sale_order_views.xml diff --git a/app_sale_order_weight/i18n/zh_CN.po b/app_sale_order_weight/i18n/zh_CN.po deleted file mode 100644 index 15c8d7cc..00000000 --- a/app_sale_order_weight/i18n/zh_CN.po +++ /dev/null @@ -1,47 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * app_sale_order_weight -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 11.0+e-20180429\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-17 15:47+0000\n" -"PO-Revision-Date: 2018-06-17 15:47+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: app_sale_order_weight -#: model:ir.ui.view,arch_db:app_sale_order_weight.sale_weight_line_form -msgid " kg" -msgstr " kg" - -#. module: app_sale_order_weight -#: model:ir.model.fields,field_description:app_sale_order_weight.field_sale_order_line_weight_net -msgid "Net Weight(kg)" -msgstr "重量(kg)" - -#. module: app_sale_order_weight -#: model:ir.model,name:app_sale_order_weight.model_sale_order -msgid "Quotation" -msgstr "报价单" - -#. module: app_sale_order_weight -#: model:ir.model,name:app_sale_order_weight.model_sale_order_line -msgid "Sales Order Line" -msgstr "销售订单行" - -#. module: app_sale_order_weight -#: model:ir.model.fields,field_description:app_sale_order_weight.field_sale_order_total_weight_net -msgid "Total Weight (kg)" -msgstr "Total Weight (kg)" - -#. module: app_sale_order_weight -#: model:ir.ui.view,arch_db:app_sale_order_weight.sale_weight_line_form -msgid "Total Weight:" -msgstr "Total Weight:" -