mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
@@ -19,6 +19,7 @@
|
||||
],
|
||||
'data': [
|
||||
'security/ir.model.access.csv',
|
||||
'views/product_template.xml',
|
||||
'views/res_config_settings.xml',
|
||||
'views/stock_location_view.xml',
|
||||
],
|
||||
|
||||
@@ -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
|
||||
|
||||
17
stock_location_limit_product/models/product_template.py
Normal file
17
stock_location_limit_product/models/product_template.py
Normal 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."
|
||||
)
|
||||
16
stock_location_limit_product/views/product_template.xml
Normal file
16
stock_location_limit_product/views/product_template.xml
Normal 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>
|
||||
Reference in New Issue
Block a user