[imp] add packaging information to bnn information
This commit is contained in:
parent
76a0ba86b0
commit
f17c61bc7a
8 changed files with 69 additions and 23 deletions
|
|
@ -34,6 +34,7 @@ Changelog
|
|||
|
||||
|
||||
:1.0.0: Initial module.
|
||||
:1.1.0: Add packaging
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
"category": "Product",
|
||||
"version": "16.0.1.0.0",
|
||||
"depends": ["product"],
|
||||
"data": ["views/product_template_bnn_view.xml"],
|
||||
"data": ["views/product_bnn_views.xml"],
|
||||
"assets": {},
|
||||
"license": "LGPL-3",
|
||||
"installable": True,
|
||||
|
|
|
|||
12
nfu_product_bnn_attributes/models/product_product.py
Normal file
12
nfu_product_bnn_attributes/models/product_product.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
from odoo import models
|
||||
|
||||
|
||||
class ProductProduct(models.Model):
|
||||
_inherit = "product.product"
|
||||
|
||||
# Should be moved to product.product at some point
|
||||
# additional_information = fields.Char()
|
||||
# quality = fields.Char()
|
||||
# origin = fields.Char()
|
||||
# packaging_qty = fields.Float(string="Packaging Quantity")
|
||||
# packaging_name = fields.Char()
|
||||
|
|
@ -4,7 +4,10 @@ from odoo import fields, models
|
|||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
manufacturer_abbr = fields.Char(string="Manufacturer Abbreviation")
|
||||
# Should be moved to product.product at some point
|
||||
additional_information = fields.Char()
|
||||
quality = fields.Char()
|
||||
origin = fields.Char()
|
||||
manufacturer_abbr = fields.Char(string="Manufacturer Abbreviation")
|
||||
packaging_qty = fields.Float(string="Packaging Quantity")
|
||||
packaging_name = fields.Char()
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
|
||||
:1.0.0: Initial module.
|
||||
:1.0.0: Initial module.
|
||||
:1.1.0: Add packaging
|
||||
|
|
@ -392,6 +392,8 @@ ul.auto-toc {
|
|||
<tbody valign="top">
|
||||
<tr class="field"><th class="field-name">1.0.0:</th><td class="field-body">Initial module.</td>
|
||||
</tr>
|
||||
<tr class="field"><th class="field-name">1.1.0:</th><td class="field-body">Add packaging</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
|
|||
47
nfu_product_bnn_attributes/views/product_bnn_views.xml
Normal file
47
nfu_product_bnn_attributes/views/product_bnn_views.xml
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<record id="product_template_form_view" model="ir.ui.view">
|
||||
<field name="name">product.template.view.inherit.bnn</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<page name="general_information" position="after">
|
||||
<page name="bnn" string="BNN Information">
|
||||
<group>
|
||||
<group name="bnn_information">
|
||||
<field name="manufacturer_abbr"/>
|
||||
<field name="additional_information"/>
|
||||
<field name="quality"/>
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
<group name="bnn_packaging">
|
||||
<field name="packaging_name"/>
|
||||
<field name="packaging_qty"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</page>
|
||||
</field>
|
||||
</record>
|
||||
<!--
|
||||
Should be moved to product.product at some point
|
||||
<record id="product_normal_form_view" model="ir.ui.view">
|
||||
<field name="name">product.product.form.inherit.bnn</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="inherit_id" ref="nfu_product_bnn_attributes.product_template_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="bnn_information" position="inside">
|
||||
<field name="additional_information"/>
|
||||
<field name="quality"/>
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
<page name="bnn" position="inside">
|
||||
<group name="bnn_packaging">
|
||||
<field name="packaging_name"/>
|
||||
<field name="packaging_qty"/>
|
||||
</group>
|
||||
</page>
|
||||
</field>
|
||||
</record> -->
|
||||
</odoo>
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<odoo>
|
||||
<record id="product_template_bnn_view" model="ir.ui.view">
|
||||
<field name="name">product.template.bnn.view</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='general_information']" position="after">
|
||||
<page name="bnn" string="BNN Information">
|
||||
<group>
|
||||
<field name="additional_information"/>
|
||||
<field name="manufacturer_abbr"/>
|
||||
<field name="quality"/>
|
||||
<field name="origin"/>
|
||||
</group>
|
||||
</page>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Loading…
Reference in a new issue