[IMP] nfu_product,nfu_product_bnn_attributes: add multi-company to product.packagings
This commit is contained in:
parent
870c8c7a80
commit
142ce7f48a
12 changed files with 86 additions and 27 deletions
|
|
@ -32,7 +32,8 @@ NFU Product
|
||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
* 1.0.0: Initial module.
|
- 16.0.1.0.0: Initial module.
|
||||||
|
- 16.0.1.1.0: Add multi company to product packagings
|
||||||
|
|
||||||
|
|
||||||
Bug Tracker
|
Bug Tracker
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,12 @@
|
||||||
"author": "BAKEUP",
|
"author": "BAKEUP",
|
||||||
"website": "https://www.bakeup.org",
|
"website": "https://www.bakeup.org",
|
||||||
"category": "product",
|
"category": "product",
|
||||||
"version": "16.0.1.0.0",
|
"version": "16.0.1.1.0",
|
||||||
"depends": ["product", "product_multi_company"],
|
"depends": ["product_multi_company"],
|
||||||
"data": ["views/product_product_views.xml", "views/product_template_views.xml"],
|
"data": [
|
||||||
|
"views/product_packaging_views.xml",
|
||||||
|
"views/product_product_views.xml",
|
||||||
|
"views/product_template_views.xml",
|
||||||
|
],
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
from . import product_packaging
|
||||||
14
nfu_product/models/product_packaging.py
Normal file
14
nfu_product/models/product_packaging.py
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
from odoo import api, models
|
||||||
|
|
||||||
|
|
||||||
|
class ProductPackaging(models.Model):
|
||||||
|
_inherit = ["multi.company.abstract", "product.packaging"]
|
||||||
|
_name = "product.packaging"
|
||||||
|
|
||||||
|
@api.model_create_multi
|
||||||
|
def create(self, vals_list):
|
||||||
|
res = super().create(vals_list)
|
||||||
|
for packaging in res:
|
||||||
|
product = packaging.product_id
|
||||||
|
packaging.company_ids = product.company_ids
|
||||||
|
return res
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
* 1.0.0: Initial module.
|
- 16.0.1.0.0: Initial module.
|
||||||
|
- 16.0.1.1.0: Add multi company to product packagings
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -389,7 +389,8 @@ ul.auto-toc {
|
||||||
<div class="section" id="changelog">
|
<div class="section" id="changelog">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-1">Changelog</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-1">Changelog</a></h1>
|
||||||
<ul class="simple">
|
<ul class="simple">
|
||||||
<li>1.0.0: Initial module.</li>
|
<li>16.0.1.0.0: Initial module.</li>
|
||||||
|
<li>16.0.1.1.0: Add multi company to product packagings</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="bug-tracker">
|
<div class="section" id="bug-tracker">
|
||||||
|
|
|
||||||
41
nfu_product/views/product_packaging_views.xml
Normal file
41
nfu_product/views/product_packaging_views.xml
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<odoo>
|
||||||
|
<record id="product_packaging_tree_view" model="ir.ui.view">
|
||||||
|
<field name="name">product.packaging.tree.inherit.companies</field>
|
||||||
|
<field name="model">product.packaging</field>
|
||||||
|
<field name="inherit_id" ref="product.product_packaging_tree_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//field[@name='company_id']" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="//field[@name='company_id']" position="after">
|
||||||
|
<field
|
||||||
|
name="company_ids"
|
||||||
|
options="{'no_create': True}"
|
||||||
|
groups="base.group_multi_company"
|
||||||
|
optional="hide"
|
||||||
|
widget="many2many_tags"
|
||||||
|
/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="product_packaging_form_view" model="ir.ui.view">
|
||||||
|
<field name="name">product.packaging.form.inherit.companies</field>
|
||||||
|
<field name="model">product.packaging</field>
|
||||||
|
<field name="inherit_id" ref="product.product_packaging_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//group[@name='qty']/field[@name='company_id']" position="attributes">
|
||||||
|
<attribute name="invisible">1</attribute>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr="////group[@name='qty']/field[@name='company_id']" position="after">
|
||||||
|
<field
|
||||||
|
name="company_ids"
|
||||||
|
options="{'no_create': True}"
|
||||||
|
groups="base.group_multi_company"
|
||||||
|
widget="many2many_tags"
|
||||||
|
/>
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
</odoo>
|
||||||
|
|
@ -33,9 +33,10 @@ Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
|
||||||
:1.0.0: Initial module.
|
- 16.0.1.0.0: Initial module.
|
||||||
:1.1.0: Add packaging
|
- 16.0.1.1.0: Add packaging
|
||||||
:1.1.1: inherit package company if from product
|
- 16.0.1.1.1: inherit package company if from product
|
||||||
|
- 16.0.1.2.0: Add Multi company to packaging
|
||||||
|
|
||||||
Bug Tracker
|
Bug Tracker
|
||||||
===========
|
===========
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
"author": "BAKEUP",
|
"author": "BAKEUP",
|
||||||
"website": "https://www.bakeup.org",
|
"website": "https://www.bakeup.org",
|
||||||
"category": "Product",
|
"category": "Product",
|
||||||
"version": "16.0.1.1.1",
|
"version": "16.0.1.2.0",
|
||||||
"depends": ["product"],
|
"depends": ["nfu_product"],
|
||||||
"data": ["views/product_bnn_views.xml"],
|
"data": ["views/product_bnn_views.xml"],
|
||||||
"assets": {},
|
"assets": {},
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ class ProductTemplate(models.Model):
|
||||||
"qty": qty,
|
"qty": qty,
|
||||||
"product_id": product_product.id,
|
"product_id": product_product.id,
|
||||||
"sales": True,
|
"sales": True,
|
||||||
"company_id": product_product.company_id.id,
|
"company_ids": product_product.company_ids.ids,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
return res
|
return res
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
:1.0.0: Initial module.
|
- 16.0.1.0.0: Initial module.
|
||||||
:1.1.0: Add packaging
|
- 16.0.1.1.0: Add packaging
|
||||||
:1.1.1: inherit package company if from product
|
- 16.0.1.1.1: inherit package company if from product
|
||||||
|
- 16.0.1.2.0: Add Multi company to packaging
|
||||||
|
|
@ -386,18 +386,12 @@ ul.auto-toc {
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="changelog">
|
<div class="section" id="changelog">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-1">Changelog</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-1">Changelog</a></h1>
|
||||||
<table class="docutils field-list" frame="void" rules="none">
|
<ul class="simple">
|
||||||
<col class="field-name" />
|
<li>16.0.1.0.0: Initial module.</li>
|
||||||
<col class="field-body" />
|
<li>16.0.1.1.0: Add packaging</li>
|
||||||
<tbody valign="top">
|
<li>16.0.1.1.1: inherit package company if from product</li>
|
||||||
<tr class="field"><th class="field-name">1.0.0:</th><td class="field-body">Initial module.</td>
|
<li>16.0.1.2.0: Add Multi company to packaging</li>
|
||||||
</tr>
|
</ul>
|
||||||
<tr class="field"><th class="field-name">1.1.0:</th><td class="field-body">Add packaging</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="field"><th class="field-name">1.1.1:</th><td class="field-body">inherit package company if from product</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="section" id="bug-tracker">
|
<div class="section" id="bug-tracker">
|
||||||
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
|
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue