-
-
Notifications
You must be signed in to change notification settings - Fork 715
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD][12.0] new module product_brut_weight
- Loading branch information
1 parent
a7b66e9
commit 2d8a66e
Showing
15 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
====================== | ||
Products - Brut Weight | ||
====================== | ||
|
||
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (C) 2021 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
"name": "Products - Brut Weight", | ||
"summary": "Add Brut Weight field on product and template models", | ||
"version": "12.0.1.0.1", | ||
"category": "Stock", | ||
"author": "GRAP,Odoo Community Association (OCA)", | ||
"maintainers": ["legalsylvain"], | ||
"website": "https://github.com/OCA/product-attribute", | ||
"license": "AGPL-3", | ||
"depends": ["stock"], | ||
"data": [ | ||
"views/view_product_product.xml", | ||
"views/view_product_template.xml", | ||
], | ||
"demo": [ | ||
"demo/product_product.xml", | ||
], | ||
"images": [ | ||
"static/description/product_product_form.png", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2021 - Today: GRAP (http://www.grap.coop) | ||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
deLicense AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
--> | ||
<odoo> | ||
|
||
<record id="product_strawberry_jam" model="product.product"> | ||
<field name="name">Strawberry Jam</field> | ||
<field name="uom_id" ref="uom.product_uom_unit" /> | ||
<field name="uom_po_id" ref="uom.product_uom_unit" /> | ||
<field name="weight">0.250</field> | ||
<field name="brut_weight">0.410</field> | ||
<field name="list_price">2.70</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * product_brut_weight | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2021-08-03 13:56+0000\n" | ||
"PO-Revision-Date: 2021-08-03 13:56+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: product_brut_weight | ||
#: model:ir.model.fields,field_description:product_brut_weight.field_product_product__brut_weight | ||
#: model:ir.model.fields,field_description:product_brut_weight.field_product_template__brut_weight | ||
msgid "Brut Weight" | ||
msgstr "Poids Brut" | ||
|
||
#. module: product_brut_weight | ||
#: model:ir.model,name:product_brut_weight.model_product_product | ||
msgid "Product" | ||
msgstr "Article" | ||
|
||
#. module: product_brut_weight | ||
#: model:ir.model,name:product_brut_weight.model_product_template | ||
msgid "Product Template" | ||
msgstr "Modèle d'article" | ||
|
||
#. module: product_brut_weight | ||
#: model:product.product,name:product_brut_weight.product_strawberry_jam | ||
#: model:product.template,name:product_brut_weight.product_strawberry_jam_product_template | ||
msgid "Strawberry Jam" | ||
msgstr "Confiture de fraise" | ||
|
||
#. module: product_brut_weight | ||
#: model:product.product,uom_name:product_brut_weight.product_strawberry_jam | ||
#: model:product.template,uom_name:product_brut_weight.product_strawberry_jam_product_template | ||
msgid "Unit(s)" | ||
msgstr "Unité(s)" | ||
|
||
#. module: product_brut_weight | ||
#: model:ir.model.fields,help:product_brut_weight.field_product_product__brut_weight | ||
#: model:ir.model.fields,help:product_brut_weight.field_product_template__brut_weight | ||
msgid "Weight of the product, packaging included." | ||
msgstr "Poids de l'article, conditionnement compris." | ||
|
||
#. module: product_brut_weight | ||
#: model:product.product,weight_uom_name:product_brut_weight.product_strawberry_jam | ||
#: model:product.template,weight_uom_name:product_brut_weight.product_strawberry_jam_product_template | ||
msgid "kg" | ||
msgstr "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import product_product | ||
from . import product_template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (C) 2021 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
from odoo.addons import decimal_precision as dp | ||
|
||
|
||
class ProductProduct(models.Model): | ||
_inherit = "product.product" | ||
|
||
brut_weight = fields.Float( | ||
string="Brut Weight", | ||
digits=dp.get_precision('Stock Weight'), | ||
help="Weight of the product, packaging included.", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (C) 2021 - Today: GRAP (http://www.grap.coop) | ||
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import fields, models | ||
from odoo.addons import decimal_precision as dp | ||
|
||
|
||
class ProductTemplate(models.Model): | ||
_inherit = "product.template" | ||
|
||
brut_weight = fields.Float( | ||
string="Brut Weight", | ||
related="product_variant_ids.brut_weight", | ||
digits=dp.get_precision('Stock Weight'), | ||
help="Weight of the product, packaging included.", | ||
readonly=False, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Sylvain LE GAL (https://www.twitter.com/legalsylvain) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This module extends the functionality of stock module to support brut weight. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Adds the brut weight on picking model. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* Go to 'Inventory > Master Data > Product' and edit items. | ||
|
||
* Go to 'Inventory' tab, and fill the "Brut Weight" value. | ||
|
||
.. figure:: ../static/description/product_product_form.png |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2021 - Today: GRAP (http://www.grap.coop) | ||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
--> | ||
<odoo> | ||
|
||
<record id="view_product_product_form_variant" model="ir.ui.view"> | ||
<field name="model">product.product</field> | ||
<field name="inherit_id" ref="product.product_variant_easy_edit_view" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='weight']/.." position="after"> | ||
<label for="brut_weight"/> | ||
<div class="o_row"> | ||
<field name="brut_weight"/> | ||
<span><field name="weight_uom_name"/></span> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (C) 2021 - Today: GRAP (http://www.grap.coop) | ||
@author: Sylvain LE GAL (https://twitter.com/legalsylvain) | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
--> | ||
<odoo> | ||
|
||
<record id="view_product_template_form" model="ir.ui.view"> | ||
<field name="model">product.template</field> | ||
<field name="inherit_id" ref="product.product_template_form_view" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='weight']/.." position="after"> | ||
<label for="brut_weight" attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/> | ||
<div class="o_row" name="brut_weight" attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"> | ||
<field name="brut_weight"/> | ||
<span><field name="weight_uom_name"/></span> | ||
</div> | ||
</xpath> | ||
</field> | ||
</record> | ||
|
||
</odoo> |