mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] stock_putaway_product_form: black, isort, prettier
This commit is contained in:
@@ -8,11 +8,7 @@
|
|||||||
"author": "Akretion, Odoo Community Association (OCA)",
|
"author": "Akretion, Odoo Community Association (OCA)",
|
||||||
"license": "AGPL-3",
|
"license": "AGPL-3",
|
||||||
"depends": ["stock"],
|
"depends": ["stock"],
|
||||||
"external_dependencies": {
|
"external_dependencies": {"python": ["openupgradelib"]},
|
||||||
"python": [
|
|
||||||
"openupgradelib",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
"data": ["views/product.xml"],
|
"data": ["views/product.xml"],
|
||||||
"demo": ["demo/putaway_strategies.xml"],
|
"demo": ["demo/putaway_strategies.xml"],
|
||||||
"maintainers": ["kevinkhao", "sebastienbeau"],
|
"maintainers": ["kevinkhao", "sebastienbeau"],
|
||||||
|
|||||||
@@ -1,36 +1,31 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<!--Shows simplest case for categories -->
|
<!--Shows simplest case for categories -->
|
||||||
<record id="putaway_strat_1" model="product.putaway">
|
<record id="putaway_strat_1" model="product.putaway">
|
||||||
<field name="name">Putaway Strategy 1</field>
|
<field name="name">Putaway Strategy 1</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="putaway_strat_1_line_1" model="stock.fixed.putaway.strat">
|
<record id="putaway_strat_1_line_1" model="stock.fixed.putaway.strat">
|
||||||
<field name="product_id" ref="product.product_product_11"/>
|
<field name="product_id" ref="product.product_product_11" />
|
||||||
<field name="putaway_id" ref="stock_putaway_product_form.putaway_strat_1"/>
|
<field name="putaway_id" ref="stock_putaway_product_form.putaway_strat_1" />
|
||||||
<field name="fixed_location_id" ref="stock.stock_location_shop0"/>
|
<field name="fixed_location_id" ref="stock.stock_location_shop0" />
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="putaway_strat_1_line_2" model="stock.fixed.putaway.strat">
|
<record id="putaway_strat_1_line_2" model="stock.fixed.putaway.strat">
|
||||||
<field name="category_id" ref="product.product_category_5"/>
|
<field name="category_id" ref="product.product_category_5" />
|
||||||
<field name="putaway_id" ref="stock_putaway_product_form.putaway_strat_1"/>
|
<field name="putaway_id" ref="stock_putaway_product_form.putaway_strat_1" />
|
||||||
<field name="fixed_location_id" ref="stock.stock_location_shop0"/>
|
<field name="fixed_location_id" ref="stock.stock_location_shop0" />
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<!--Shows inherited case for categories-->
|
<!--Shows inherited case for categories-->
|
||||||
<record id="putaway_strat_2" model="product.putaway">
|
<record id="putaway_strat_2" model="product.putaway">
|
||||||
<field name="name">Putaway Strategy 2</field>
|
<field name="name">Putaway Strategy 2</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="putaway_strat_2_line_1" model="stock.fixed.putaway.strat">
|
<record id="putaway_strat_2_line_1" model="stock.fixed.putaway.strat">
|
||||||
<field name="category_id" ref="product.product_category_1"/>
|
<field name="category_id" ref="product.product_category_1" />
|
||||||
<field name="putaway_id" ref="stock_putaway_product_form.putaway_strat_2"/>
|
<field name="putaway_id" ref="stock_putaway_product_form.putaway_strat_2" />
|
||||||
<field name="fixed_location_id" ref="stock.stock_location_stock"/>
|
<field name="fixed_location_id" ref="stock.stock_location_stock" />
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="putaway_strat_2_line_2" model="stock.fixed.putaway.strat">
|
<record id="putaway_strat_2_line_2" model="stock.fixed.putaway.strat">
|
||||||
<field name="category_id" ref="product.product_category_all"/>
|
<field name="category_id" ref="product.product_category_all" />
|
||||||
<field name="putaway_id" ref="stock_putaway_product_form.putaway_strat_2"/>
|
<field name="putaway_id" ref="stock_putaway_product_form.putaway_strat_2" />
|
||||||
<field name="fixed_location_id" ref="stock.stock_location_stock"/>
|
<field name="fixed_location_id" ref="stock.stock_location_stock" />
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from openupgradelib import openupgrade
|
from openupgradelib import openupgrade
|
||||||
|
|
||||||
_logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
@@ -9,11 +10,12 @@ _logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
def post_init_hook(cr, registry):
|
def post_init_hook(cr, registry):
|
||||||
openupgrade.logged_query(
|
openupgrade.logged_query(
|
||||||
cr, """
|
cr,
|
||||||
|
"""
|
||||||
UPDATE stock_fixed_putaway_strat sfps
|
UPDATE stock_fixed_putaway_strat sfps
|
||||||
SET product_tmpl_id=pp.product_tmpl_id
|
SET product_tmpl_id=pp.product_tmpl_id
|
||||||
FROM product_product pp
|
FROM product_product pp
|
||||||
WHERE pp.id=sfps.product_id AND
|
WHERE pp.id=sfps.product_id AND
|
||||||
sfps.product_tmpl_id <> pp.product_tmpl_id
|
sfps.product_tmpl_id <> pp.product_tmpl_id
|
||||||
"""
|
""",
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -20,15 +20,11 @@ class ProductTemplate(models.Model):
|
|||||||
|
|
||||||
def _find_closest_categ_match(self, categ, putaway_lines):
|
def _find_closest_categ_match(self, categ, putaway_lines):
|
||||||
"""Returns the putaway line with the nearest product category"""
|
"""Returns the putaway line with the nearest product category"""
|
||||||
lines_match_categ = putaway_lines.filtered(
|
lines_match_categ = putaway_lines.filtered(lambda r: r.category_id == categ)
|
||||||
lambda r: r.category_id == categ
|
|
||||||
)
|
|
||||||
if lines_match_categ:
|
if lines_match_categ:
|
||||||
return lines_match_categ[0]
|
return lines_match_categ[0]
|
||||||
elif categ.parent_id:
|
elif categ.parent_id:
|
||||||
return self._find_closest_categ_match(
|
return self._find_closest_categ_match(categ.parent_id, putaway_lines)
|
||||||
categ.parent_id, putaway_lines
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
return self.env["stock.fixed.putaway.strat"]
|
return self.env["stock.fixed.putaway.strat"]
|
||||||
|
|
||||||
@@ -50,9 +46,9 @@ class ProductTemplate(models.Model):
|
|||||||
categ = rec.categ_id
|
categ = rec.categ_id
|
||||||
categs = self._get_categ_and_parents(categ)
|
categs = self._get_categ_and_parents(categ)
|
||||||
# get matching lines from our category or its parents
|
# get matching lines from our category or its parents
|
||||||
product_putaway_categ_lines = self.env[
|
product_putaway_categ_lines = self.env["stock.fixed.putaway.strat"].search(
|
||||||
"stock.fixed.putaway.strat"
|
[("category_id", "in", categs.ids)]
|
||||||
].search([("category_id", "in", categs.ids)])
|
)
|
||||||
# from these, get the matching putaway.strats and find
|
# from these, get the matching putaway.strats and find
|
||||||
# the lowest-level category match
|
# the lowest-level category match
|
||||||
product_putaways = product_putaway_categ_lines.mapped("putaway_id")
|
product_putaways = product_putaway_categ_lines.mapped("putaway_id")
|
||||||
|
|||||||
@@ -5,14 +5,15 @@ from odoo import api, fields, models
|
|||||||
|
|
||||||
|
|
||||||
class PutAwayStrategy(models.Model):
|
class PutAwayStrategy(models.Model):
|
||||||
_inherit = 'product.putaway'
|
_inherit = "product.putaway"
|
||||||
|
|
||||||
# Remove product domain to allow to select product templates
|
# Remove product domain to allow to select product templates
|
||||||
product_location_ids = fields.One2many(domain=[])
|
product_location_ids = fields.One2many(domain=[])
|
||||||
|
|
||||||
def _get_putaway_rule(self, product):
|
def _get_putaway_rule(self, product):
|
||||||
return super(PutAwayStrategy, self.with_context(
|
return super(
|
||||||
filter_putaway_rule=True))._get_putaway_rule(product)
|
PutAwayStrategy, self.with_context(filter_putaway_rule=True)
|
||||||
|
)._get_putaway_rule(product)
|
||||||
|
|
||||||
|
|
||||||
class FixedPutAwayStrategy(models.Model):
|
class FixedPutAwayStrategy(models.Model):
|
||||||
@@ -26,23 +27,25 @@ class FixedPutAwayStrategy(models.Model):
|
|||||||
ondelete="cascade",
|
ondelete="cascade",
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.depends('product_id')
|
@api.depends("product_id")
|
||||||
def _compute_product_tmpl_id(self):
|
def _compute_product_tmpl_id(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
if rec.product_id:
|
if rec.product_id:
|
||||||
rec.product_tmpl_id = rec.product_id.product_tmpl_id
|
rec.product_tmpl_id = rec.product_id.product_tmpl_id
|
||||||
else:
|
else:
|
||||||
params = self.env.context.get('params', {})
|
params = self.env.context.get("params", {})
|
||||||
if params.get('model', '') == 'product.template':
|
if params.get("model", "") == "product.template":
|
||||||
rec.product_tmpl_id = params.get('id', False)
|
rec.product_tmpl_id = params.get("id", False)
|
||||||
|
|
||||||
def filtered(self, func):
|
def filtered(self, func):
|
||||||
res = super(FixedPutAwayStrategy, self).filtered(func)
|
res = super(FixedPutAwayStrategy, self).filtered(func)
|
||||||
if res or not self.env.context.get('filter_putaway_rule'):
|
if res or not self.env.context.get("filter_putaway_rule"):
|
||||||
return res
|
return res
|
||||||
product = func.__closure__[0].cell_contents
|
product = func.__closure__[0].cell_contents
|
||||||
if product._name != 'product.product':
|
if product._name != "product.product":
|
||||||
return res
|
return res
|
||||||
return self.with_context(filter_putaway_rule=False).filtered(
|
return self.with_context(filter_putaway_rule=False).filtered(
|
||||||
lambda x: (x.product_tmpl_id == product.product_tmpl_id and
|
lambda x: (
|
||||||
not x.product_id))
|
x.product_tmpl_id == product.product_tmpl_id and not x.product_id
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|||||||
@@ -13,114 +13,90 @@ class TestProductPutaway(TransactionCase):
|
|||||||
ProductAttributeValue = self.env["product.attribute.value"]
|
ProductAttributeValue = self.env["product.attribute.value"]
|
||||||
TemplateAttributeLine = self.env["product.template.attribute.line"]
|
TemplateAttributeLine = self.env["product.template.attribute.line"]
|
||||||
ref = self.env.ref
|
ref = self.env.ref
|
||||||
self.product_tmpl_chair = ref(
|
self.product_tmpl_chair = ref("product.product_product_11_product_template")
|
||||||
"product.product_product_11_product_template"
|
|
||||||
)
|
|
||||||
self.product_product_chair = ref("product.product_product_11")
|
self.product_product_chair = ref("product.product_product_11")
|
||||||
self.category_services = ref("product.product_category_3")
|
self.category_services = ref("product.product_category_3")
|
||||||
self.putaway_line_1 = ref(
|
self.putaway_line_1 = ref("stock_putaway_product_form.putaway_strat_1_line_1")
|
||||||
"stock_putaway_product_form.putaway_strat_1_line_1"
|
self.putaway_line_2 = ref("stock_putaway_product_form.putaway_strat_1_line_2")
|
||||||
)
|
self.putaway_line_3 = ref("stock_putaway_product_form.putaway_strat_2_line_1")
|
||||||
self.putaway_line_2 = ref(
|
self.putaway_line_4 = ref("stock_putaway_product_form.putaway_strat_2_line_2")
|
||||||
"stock_putaway_product_form.putaway_strat_1_line_2"
|
|
||||||
)
|
|
||||||
self.putaway_line_3 = ref(
|
|
||||||
"stock_putaway_product_form.putaway_strat_2_line_1"
|
|
||||||
)
|
|
||||||
self.putaway_line_4 = ref(
|
|
||||||
"stock_putaway_product_form.putaway_strat_2_line_2"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add a product with variants
|
# Add a product with variants
|
||||||
self.template = ProductTemplate.create({
|
self.template = ProductTemplate.create(
|
||||||
'name': 'Product test',
|
{"name": "Product test", "type": "consu"}
|
||||||
'type': 'consu',
|
)
|
||||||
})
|
self.size_attribute = ProductAttribute.create(
|
||||||
self.size_attribute = ProductAttribute.create({
|
{"name": "Test size", "sequence": 1}
|
||||||
'name': 'Test size',
|
)
|
||||||
'sequence': 1,
|
self.size_m = ProductAttributeValue.create(
|
||||||
})
|
{"name": "Size M", "attribute_id": self.size_attribute.id, "sequence": 1}
|
||||||
self.size_m = ProductAttributeValue.create({
|
)
|
||||||
'name': 'Size M',
|
self.size_l = ProductAttributeValue.create(
|
||||||
'attribute_id': self.size_attribute.id,
|
{"name": "Size L", "attribute_id": self.size_attribute.id, "sequence": 2}
|
||||||
'sequence': 1,
|
)
|
||||||
})
|
self.template_attribute_lines = TemplateAttributeLine.create(
|
||||||
self.size_l = ProductAttributeValue.create({
|
{
|
||||||
'name': 'Size L',
|
"product_tmpl_id": self.template.id,
|
||||||
'attribute_id': self.size_attribute.id,
|
"attribute_id": self.size_attribute.id,
|
||||||
'sequence': 2,
|
"value_ids": [(6, 0, [self.size_m.id, self.size_l.id])],
|
||||||
})
|
}
|
||||||
self.template_attribute_lines = TemplateAttributeLine.create({
|
)
|
||||||
'product_tmpl_id': self.template.id,
|
|
||||||
'attribute_id': self.size_attribute.id,
|
|
||||||
'value_ids': [(6, 0, [self.size_m.id, self.size_l.id])],
|
|
||||||
})
|
|
||||||
self.template.create_variant_ids()
|
self.template.create_variant_ids()
|
||||||
|
|
||||||
def test_tmpl_has_putaways_from_products(self):
|
def test_tmpl_has_putaways_from_products(self):
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
self.putaway_line_1,
|
self.putaway_line_1, self.product_tmpl_chair.product_tmpl_putaway_ids,
|
||||||
self.product_tmpl_chair.product_tmpl_putaway_ids,
|
|
||||||
)
|
)
|
||||||
self.putaway_line_1.product_id = self.env["product.product"]
|
self.putaway_line_1.product_id = self.env["product.product"]
|
||||||
self.assertNotIn(
|
self.assertNotIn(
|
||||||
self.putaway_line_1,
|
self.putaway_line_1, self.product_tmpl_chair.product_tmpl_putaway_ids,
|
||||||
self.product_tmpl_chair.product_tmpl_putaway_ids,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_tmpl_has_putaways_from_category_simple(self):
|
def test_tmpl_has_putaways_from_category_simple(self):
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
self.putaway_line_2,
|
self.putaway_line_2, self.product_tmpl_chair.product_putaway_categ_ids,
|
||||||
self.product_tmpl_chair.product_putaway_categ_ids,
|
|
||||||
)
|
)
|
||||||
self.product_tmpl_chair.categ_id = self.category_services
|
self.product_tmpl_chair.categ_id = self.category_services
|
||||||
self.assertNotIn(
|
self.assertNotIn(
|
||||||
self.putaway_line_2,
|
self.putaway_line_2, self.product_tmpl_chair.product_putaway_categ_ids,
|
||||||
self.product_tmpl_chair.product_putaway_categ_ids,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_tmpl_has_putaways_from_category_parent(self):
|
def test_tmpl_has_putaways_from_category_parent(self):
|
||||||
# chair is under category: all/saleable/office
|
# chair is under category: all/saleable/office
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
self.putaway_line_3,
|
self.putaway_line_3, self.product_tmpl_chair.product_putaway_categ_ids,
|
||||||
self.product_tmpl_chair.product_putaway_categ_ids,
|
|
||||||
)
|
)
|
||||||
self.assertNotIn(
|
self.assertNotIn(
|
||||||
self.putaway_line_4,
|
self.putaway_line_4, self.product_tmpl_chair.product_putaway_categ_ids,
|
||||||
self.product_tmpl_chair.product_putaway_categ_ids,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_apply_putaway(self):
|
def test_apply_putaway(self):
|
||||||
# Create one strategy line for product template and other with a
|
# Create one strategy line for product template and other with a
|
||||||
# specific variant
|
# specific variant
|
||||||
location = self.env.ref('stock.stock_location_shop0')
|
location = self.env.ref("stock.stock_location_shop0")
|
||||||
location1 = location.copy({
|
location1 = location.copy(
|
||||||
'name': 'Location test 1',
|
{"name": "Location test 1", "location_id": location.id}
|
||||||
'location_id': location.id
|
)
|
||||||
})
|
location2 = location.copy(
|
||||||
location2 = location.copy({
|
{"name": "Location test 2", "location_id": location.id}
|
||||||
'name': 'Location test 2',
|
)
|
||||||
'location_id': location.id
|
|
||||||
})
|
|
||||||
variant1 = self.template.product_variant_ids[0]
|
variant1 = self.template.product_variant_ids[0]
|
||||||
variant2 = self.template.product_variant_ids[1]
|
variant2 = self.template.product_variant_ids[1]
|
||||||
putaway = self.putawayObj.create({'name': 'Putaway for test'})
|
putaway = self.putawayObj.create({"name": "Putaway for test"})
|
||||||
val_list = [
|
val_list = [
|
||||||
{
|
{
|
||||||
'putaway_id': putaway.id,
|
"putaway_id": putaway.id,
|
||||||
'product_tmpl_id': self.template.id,
|
"product_tmpl_id": self.template.id,
|
||||||
'fixed_location_id': location1.id,
|
"fixed_location_id": location1.id,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'putaway_id': putaway.id,
|
"putaway_id": putaway.id,
|
||||||
'product_id': variant2.id,
|
"product_id": variant2.id,
|
||||||
'fixed_location_id': location2.id,
|
"fixed_location_id": location2.id,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
self.putawayLineObj.create(val_list)
|
self.putawayLineObj.create(val_list)
|
||||||
location_applied = putaway._get_putaway_rule(
|
location_applied = putaway._get_putaway_rule(variant1).fixed_location_id
|
||||||
variant1).fixed_location_id
|
|
||||||
self.assertEqual(location_applied, location1)
|
self.assertEqual(location_applied, location1)
|
||||||
location_applied = putaway._get_putaway_rule(
|
location_applied = putaway._get_putaway_rule(variant2).fixed_location_id
|
||||||
variant2).fixed_location_id
|
|
||||||
self.assertEqual(location_applied, location2)
|
self.assertEqual(location_applied, location2)
|
||||||
|
|||||||
@@ -1,39 +1,52 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). -->
|
<!-- License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
<record id="view_template_form_putaway" model="ir.ui.view">
|
<record id="view_template_form_putaway" model="ir.ui.view">
|
||||||
<field name="name">product.template.product.form</field>
|
<field name="name">product.template.product.form</field>
|
||||||
<field name="model">product.template</field>
|
<field name="model">product.template</field>
|
||||||
<field name="inherit_id" ref="product.product_template_form_view"/>
|
<field name="inherit_id" ref="product.product_template_form_view" />
|
||||||
<field name="groups_id" eval="[(4,ref('stock.group_stock_manager'))]"/>
|
<field name="groups_id" eval="[(4,ref('stock.group_stock_manager'))]" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//page[@name='inventory']" position="inside">
|
<xpath expr="//page[@name='inventory']" position="inside">
|
||||||
<div name="putaway" groups="stock.group_adv_location" string="Putaway strategies">
|
<div
|
||||||
<field name="product_variant_ids" invisible="1"/>
|
name="putaway"
|
||||||
<group name="putaway_products" string="Put Away Strategies by products"
|
groups="stock.group_adv_location"
|
||||||
attrs="{'invisible': [('is_product_variant', '=', True)]}">
|
string="Putaway strategies"
|
||||||
|
>
|
||||||
|
<field name="product_variant_ids" invisible="1" />
|
||||||
|
<group
|
||||||
|
name="putaway_products"
|
||||||
|
string="Put Away Strategies by products"
|
||||||
|
attrs="{'invisible': [('is_product_variant', '=', True)]}"
|
||||||
|
>
|
||||||
<group>
|
<group>
|
||||||
<p class="oe_grey">
|
<p class="oe_grey">
|
||||||
The rules defined per product will be applied before the rules defined per product category.
|
The rules defined per product will be applied before the rules defined per product category.
|
||||||
<div>Keep empty product field to apply strategy to all variants.</div>
|
<div
|
||||||
|
>Keep empty product field to apply strategy to all variants.</div>
|
||||||
</p>
|
</p>
|
||||||
</group>
|
</group>
|
||||||
<field name="product_tmpl_putaway_ids" nolabel="1">
|
<field name="product_tmpl_putaway_ids" nolabel="1">
|
||||||
<tree editable="top">
|
<tree editable="top">
|
||||||
<field name="product_id" domain="[('product_tmpl_id', '=', parent.id)]"/>
|
<field
|
||||||
<field name="putaway_id"/>
|
name="product_id"
|
||||||
<field name="fixed_location_id"/>
|
domain="[('product_tmpl_id', '=', parent.id)]"
|
||||||
|
/>
|
||||||
|
<field name="putaway_id" />
|
||||||
|
<field name="fixed_location_id" />
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
<group name="putaway_categ" string="Put Away Strategies by category"
|
<group
|
||||||
attrs="{'readonly': 1}">
|
name="putaway_categ"
|
||||||
<field name="product_putaway_categ_ids"
|
string="Put Away Strategies by category"
|
||||||
nolabel="1">
|
attrs="{'readonly': 1}"
|
||||||
|
>
|
||||||
|
<field name="product_putaway_categ_ids" nolabel="1">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="category_id"/>
|
<field name="category_id" />
|
||||||
<field name="putaway_id" widget="selection"/>
|
<field name="putaway_id" widget="selection" />
|
||||||
<field name="fixed_location_id"/>
|
<field name="fixed_location_id" />
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
@@ -41,20 +54,26 @@
|
|||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="view_product_form_putaway" model="ir.ui.view">
|
<record id="view_product_form_putaway" model="ir.ui.view">
|
||||||
<field name="name">product.product.form.putaway</field>
|
<field name="name">product.product.form.putaway</field>
|
||||||
<field name="model">product.product</field>
|
<field name="model">product.product</field>
|
||||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
<field name="inherit_id" ref="product.product_normal_form_view" />
|
||||||
<field name="groups_id" eval="[(4,ref('stock.group_stock_manager'))]"/>
|
<field name="groups_id" eval="[(4,ref('stock.group_stock_manager'))]" />
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//group[@name='putaway_categ']" position="before">
|
<xpath expr="//group[@name='putaway_categ']" position="before">
|
||||||
<group name="putaway_products" string="Put Away Strategies by products"
|
<group
|
||||||
attrs="{'invisible': [('is_product_variant', '=', False)]}">
|
name="putaway_products"
|
||||||
<field name="product_product_putaway_ids" groups="stock.group_adv_location" nolabel="1">
|
string="Put Away Strategies by products"
|
||||||
|
attrs="{'invisible': [('is_product_variant', '=', False)]}"
|
||||||
|
>
|
||||||
|
<field
|
||||||
|
name="product_product_putaway_ids"
|
||||||
|
groups="stock.group_adv_location"
|
||||||
|
nolabel="1"
|
||||||
|
>
|
||||||
<tree editable="bottom">
|
<tree editable="bottom">
|
||||||
<field name="putaway_id"/>
|
<field name="putaway_id" />
|
||||||
<field name="fixed_location_id"/>
|
<field name="fixed_location_id" />
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
Reference in New Issue
Block a user