[imp] add packaging information to bnn information

This commit is contained in:
Niels Göttsch 2024-07-24 21:54:45 +02:00
parent 76a0ba86b0
commit f17c61bc7a
8 changed files with 69 additions and 23 deletions

View file

@ -34,6 +34,7 @@ Changelog
:1.0.0: Initial module. :1.0.0: Initial module.
:1.1.0: Add packaging
Bug Tracker Bug Tracker
=========== ===========

View file

@ -6,7 +6,7 @@
"category": "Product", "category": "Product",
"version": "16.0.1.0.0", "version": "16.0.1.0.0",
"depends": ["product"], "depends": ["product"],
"data": ["views/product_template_bnn_view.xml"], "data": ["views/product_bnn_views.xml"],
"assets": {}, "assets": {},
"license": "LGPL-3", "license": "LGPL-3",
"installable": True, "installable": True,

View 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()

View file

@ -4,7 +4,10 @@ from odoo import fields, models
class ProductTemplate(models.Model): class ProductTemplate(models.Model):
_inherit = "product.template" _inherit = "product.template"
manufacturer_abbr = fields.Char(string="Manufacturer Abbreviation")
# Should be moved to product.product at some point
additional_information = fields.Char() additional_information = fields.Char()
quality = fields.Char() quality = fields.Char()
origin = fields.Char() origin = fields.Char()
manufacturer_abbr = fields.Char(string="Manufacturer Abbreviation") packaging_qty = fields.Float(string="Packaging Quantity")
packaging_name = fields.Char()

View file

@ -1,2 +1,3 @@
:1.0.0: Initial module. :1.0.0: Initial module.
:1.1.0: Add packaging

View file

@ -392,6 +392,8 @@ ul.auto-toc {
<tbody valign="top"> <tbody valign="top">
<tr class="field"><th class="field-name">1.0.0:</th><td class="field-body">Initial module.</td> <tr class="field"><th class="field-name">1.0.0:</th><td class="field-body">Initial module.</td>
</tr> </tr>
<tr class="field"><th class="field-name">1.1.0:</th><td class="field-body">Add packaging</td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>

View 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>

View file

@ -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>