Merge PR #900 into 12.0

Signed-off-by max3903
This commit is contained in:
OCA-git-bot
2020-05-16 14:43:45 +00:00
4 changed files with 35 additions and 1 deletions

View File

@@ -19,6 +19,7 @@
],
'data': [
'security/ir.model.access.csv',
'views/product_template.xml',
'views/res_config_settings.xml',
'views/stock_location_view.xml',
],

View File

@@ -1,6 +1,6 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from . import stock_location_limit
from . import stock_location
from . import product_template

View File

@@ -0,0 +1,17 @@
# Copyright (C) 2020 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo import fields, models
class ProductTemplate(models.Model):
_inherit = "product.template"
equivalent_product_ids = fields.Many2many(
comodel_name='product.template',
relation='product_template_equivalence',
column1='main_product_id',
column2='equiv_product_id',
string='Equivalent Products',
help="Products of equivalent volume to compute the remaining capacity "
"of an inventory location."
)

View File

@@ -0,0 +1,16 @@
<odoo>
<record id="view_product_template_form_limit" model="ir.ui.view">
<field name="name">product.template.form</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='group_lots_and_weight']"
position="inside">
<field name="equivalent_product_ids" widget="many2many_tags"
domain="[('id', '!=', active_id)]"/>
</xpath>
</field>
</record>
</odoo>