diff options
| author | William Henrotin <whe@odoo.com> | 2018-08-28 14:50:37 +0200 |
|---|---|---|
| committer | Simon Lejeune <sle@openerp.com> | 2018-09-10 17:22:56 +0200 |
| commit | da00534e5b7a3e569038e59cd5c6596d3bec6cba (patch) | |
| tree | 388027feb44c1209231b75166552b58cd78391d3 | |
| parent | 86ff929ad6718d2bfb691dd272aa3f353406ff4f (diff) | |
[IMP] product: uom on product packaging
If the 'Unit of Measure' setting is enable. We would like to see the
product uom on on the product packaging.
| -rw-r--r-- | addons/product/models/product.py | 1 | ||||
| -rw-r--r-- | addons/product/views/product_views.xml | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/addons/product/models/product.py b/addons/product/models/product.py index becbe1e7491..aafc17190a5 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -593,6 +593,7 @@ class ProductPackaging(models.Model): product_id = fields.Many2one('product.product', string='Product') qty = fields.Float('Contained Quantity', help="The total number of products you can have per pallet or box.") barcode = fields.Char('Barcode', copy=False, help="Barcode used for packaging identification.") + product_uom_id = fields.Many2one('uom.uom', related='product_id.uom_id') class SupplierInfo(models.Model): diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml index 9eebf162865..fdff0b02a3c 100644 --- a/addons/product/views/product_views.xml +++ b/addons/product/views/product_views.xml @@ -478,6 +478,7 @@ <field name="product_id"/> <field name="name" string="Packaging"/> <field name="qty"/> + <field name="product_uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom"/> </tree> </field> </record> @@ -509,7 +510,11 @@ <field name="product_id" required='True' attrs="{'readonly': [('id', '!=', False)]}"/> </group> <group name="qty"> - <field name="qty"/> + <label for="qty" string="Contained quantity"/> + <div class="o_row"> + <field name="qty"/> + <field name="product_uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom"/> + </div> <field name="barcode"/> </group> </group> |
