Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造代码优化
This commit is contained in:
@@ -205,8 +205,8 @@ div[class="o_content o_component_with_search_panel"] img[name="equipment_image"]
|
||||
|
||||
div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
||||
position: absolute;
|
||||
top: -52px;
|
||||
left: -55px;
|
||||
//top: -52px;
|
||||
//left: -55px;
|
||||
width: 80px;
|
||||
}
|
||||
|
||||
@@ -253,11 +253,11 @@ div[class="o_content o_component_with_search_panel"] .show_state span {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
|
||||
position: absolute;
|
||||
top: 55px;
|
||||
right: 43.5%;
|
||||
}
|
||||
//div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .row {
|
||||
// position: absolute;
|
||||
// top: 55px;
|
||||
// right: 43.5%;
|
||||
//}
|
||||
//------------------------------------------
|
||||
|
||||
.test_model > .o_form_label {
|
||||
@@ -270,10 +270,10 @@ div[class="o_content o_component_with_search_panel"] .o_kanban_primary_right > .
|
||||
right: 52%;
|
||||
}
|
||||
|
||||
div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
||||
|
||||
left: -95px;
|
||||
}
|
||||
//div[class="o_content o_component_with_search_panel"] .o_kanban_card_content button {
|
||||
//
|
||||
// left: -95px;
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
@@ -354,3 +354,25 @@ div:has(.o_required_modifier) > label::before {
|
||||
}
|
||||
|
||||
|
||||
// 2023-11-16 hy 新增
|
||||
.o_kanban_card_content .btn-group {
|
||||
position: unset;
|
||||
}
|
||||
|
||||
.o_kanban_card_content .btn-group button{
|
||||
top: 100px;
|
||||
left: 168px;
|
||||
}
|
||||
|
||||
|
||||
.o_kanban_primary_right {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: 168px;
|
||||
padding: 0;
|
||||
.row {
|
||||
>div {
|
||||
width: unset;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -688,45 +688,46 @@ class FunctionalToolAssembly(models.Model):
|
||||
|
||||
# 整体式刀具型号
|
||||
integral_code_id = fields.Many2one('stock.lot', string='整体式刀具序列号', readonly=True)
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.cutting.tool.material', string='整体式刀具型号', readonly=True)
|
||||
integral_name = fields.Char('整体式刀具名称', readonly=True)
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='整体式刀具型号', readonly=True)
|
||||
integral_name = fields.Char('整体式刀具名称', readonly=True, compute='_compute_auto_fill')
|
||||
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', string='整体式刀具品牌', readonly=True)
|
||||
|
||||
# 刀片型号
|
||||
blade_code_id = fields.Many2one('stock.lot', '刀片序列号', readonly=True)
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.cutting.tool.material', string='刀片型号', readonly=True)
|
||||
blade_name = fields.Char('刀片名称', readonly=True)
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀片型号', readonly=True)
|
||||
blade_name = fields.Char('刀片名称', readonly=True, compute='_compute_auto_fill')
|
||||
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True)
|
||||
|
||||
# 刀杆型号
|
||||
bar_code_id = fields.Many2one('stock.lot', '刀杆序列号', readonly=True)
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.cutting.tool.material', string='刀杆型号', readonly=True)
|
||||
bar_name = fields.Char('刀杆名称', readonly=True)
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀杆型号', readonly=True)
|
||||
bar_name = fields.Char('刀杆名称', readonly=True, compute='_compute_auto_fill')
|
||||
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', readonly=True)
|
||||
|
||||
# 刀盘型号
|
||||
pad_code_id = fields.Many2one('stock.lot', '刀盘序列号', readonly=True)
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.cutting.tool.material', string='刀盘型号', readonly=True)
|
||||
pad_name = fields.Char('刀盘名称', readonly=True)
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀盘型号', readonly=True)
|
||||
pad_name = fields.Char('刀盘名称', readonly=True, compute='_compute_auto_fill')
|
||||
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', readonly=True)
|
||||
|
||||
# 刀柄型号
|
||||
handle_code_id = fields.Many2one('stock.lot', '刀柄序列号', readonly=True)
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.cutting.tool.material', string='刀柄型号', readonly=True)
|
||||
handle_name = fields.Char('刀柄名称', readonly=True)
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀柄型号', readonly=True)
|
||||
handle_name = fields.Char('刀柄名称', readonly=True, compute='_compute_auto_fill')
|
||||
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', readonly=True)
|
||||
|
||||
# 夹头型号
|
||||
chuck_code_id = fields.Many2one('stock.lot', '夹头序列号', readonly=True)
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.cutting.tool.material', string='夹头型号', readonly=True)
|
||||
chuck_name = fields.Char('夹头名称', readonly=True)
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='夹头型号', readonly=True)
|
||||
chuck_name = fields.Char('夹头名称', readonly=True, compute='_compute_auto_fill')
|
||||
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True)
|
||||
|
||||
@api.depends('integral_code_id', 'blade_code_id', 'bar_code_id', 'pad_code_id', 'handle_code_id', 'chuck_code_id')
|
||||
def _compute_auto_fill(self):
|
||||
for record in self:
|
||||
if record.integral_code_id:
|
||||
record.cutting_tool_integral_model_id = record.integral_code_id.product_id.cutting_tool_material_id.id
|
||||
print(record.integral_code_id.product_id)
|
||||
record.cutting_tool_integral_model_id = record.integral_code_id.product_id.cutting_tool_model_id.id
|
||||
record.integral_name = record.integral_code_id.product_id.name
|
||||
record.sf_tool_brand_id_1 = record.integral_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -734,7 +735,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
record.integral_name = None
|
||||
record.sf_tool_brand_id_1 = None
|
||||
if record.blade_code_id:
|
||||
record.cutting_tool_blade_model_id = record.blade_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_blade_model_id = record.blade_code_id.product_id.cutting_tool_model_id.id
|
||||
record.blade_name = record.blade_code_id.product_id.name
|
||||
record.sf_tool_brand_id_2 = record.blade_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -742,7 +743,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
record.blade_name = None
|
||||
record.sf_tool_brand_id_2 = None
|
||||
if record.bar_code_id:
|
||||
record.cutting_tool_cutterbar_model_id = record.bar_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_cutterbar_model_id = record.bar_code_id.product_id.cutting_tool_model_id.id
|
||||
record.bar_name = record.bar_code_id.product_id.name
|
||||
record.sf_tool_brand_id_3 = record.bar_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -750,7 +751,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
record.bar_name = None
|
||||
record.sf_tool_brand_id_3 = None
|
||||
if record.pad_code_id:
|
||||
record.cutting_tool_cutterpad_model_id = record.pad_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_cutterpad_model_id = record.pad_code_id.product_id.cutting_tool_model_id.id
|
||||
record.pad_name = record.pad_code_id.product_id.name
|
||||
record.sf_tool_brand_id_4 = record.pad_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -758,7 +759,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
record.pad_name = None
|
||||
record.sf_tool_brand_id_4 = None
|
||||
if record.handle_code_id:
|
||||
record.cutting_tool_cutterhandle_model_id = record.handle_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_cutterhandle_model_id = record.handle_code_id.product_id.cutting_tool_model_id.id
|
||||
record.handle_name = record.handle_code_id.product_id.name
|
||||
record.sf_tool_brand_id_5 = record.handle_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -766,7 +767,7 @@ class FunctionalToolAssembly(models.Model):
|
||||
record.handle_name = None
|
||||
record.sf_tool_brand_id_5 = None
|
||||
if record.chuck_code_id:
|
||||
record.cutting_tool_cutterhead_model_id = record.chuck_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_cutterhead_model_id = record.chuck_code_id.product_id.cutting_tool_model_id.id
|
||||
record.chuck_name = record.chuck_code_id.product_id.name
|
||||
record.sf_tool_brand_id_6 = record.chuck_code_id.product_id.brand_id.id
|
||||
else:
|
||||
|
||||
@@ -796,7 +796,7 @@
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="待换功能刀具信息">
|
||||
<group>
|
||||
<group attrs="{'invisible': [('sf_functional_tool_assembly_id', '=', False)]}">
|
||||
<group>
|
||||
<field name="replacement_tool_name_id"/>
|
||||
<field name="replacement_tool_type_id"/>
|
||||
|
||||
@@ -17,7 +17,8 @@ class ToolChangeRequirementInformation(models.TransientModel):
|
||||
functional_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型', readonly=True)
|
||||
|
||||
# replacement_tool_code = fields.Char(string='待换功能刀具编码', readonly=True)
|
||||
replacement_tool_name_id = fields.Many2one('product.product', string='待换功能刀具名称', )
|
||||
replacement_tool_name_id = fields.Many2one('product.product', string='待换功能刀具名称',
|
||||
domain=[('name', '=', '功能刀具')])
|
||||
replacement_tool_type_id = fields.Many2one('sf.functional.cutting.tool.model', string='待换功能刀具类型')
|
||||
replacement_tool_coarse_middle_thin = fields.Selection([("1", "粗"), ('2', '中'), ('3', '精')],
|
||||
string='粗/中/精')
|
||||
@@ -139,42 +140,42 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
# 整体式刀具型号
|
||||
integral_code_id = fields.Many2one('stock.lot', string='整体式刀具序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '整体式刀具')])
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.cutting.tool.material', string='整体式刀具型号', readonly=True)
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='整体式刀具型号', readonly=True)
|
||||
integral_name = fields.Char('整体式刀具名称', readonly=True)
|
||||
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', string='整体式刀具品牌', readonly=True)
|
||||
|
||||
# 刀片型号
|
||||
blade_code_id = fields.Many2one('stock.lot', '刀片序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀片')])
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.cutting.tool.material', string='刀片型号', readonly=True)
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀片型号', readonly=True)
|
||||
blade_name = fields.Char('刀片名称', readonly=True)
|
||||
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', readonly=True)
|
||||
|
||||
# 刀杆型号
|
||||
bar_code_id = fields.Many2one('stock.lot', '刀杆序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀杆')])
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.cutting.tool.material', string='刀杆型号', readonly=True)
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀杆型号', readonly=True)
|
||||
bar_name = fields.Char('刀杆名称', readonly=True)
|
||||
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', readonly=True)
|
||||
|
||||
# 刀盘型号
|
||||
pad_code_id = fields.Many2one('stock.lot', '刀盘序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀盘')])
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.cutting.tool.material', string='刀盘型号', readonly=True)
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀盘型号', readonly=True)
|
||||
pad_name = fields.Char('刀盘名称', readonly=True)
|
||||
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', readonly=True)
|
||||
|
||||
# 刀柄型号
|
||||
handle_code_id = fields.Many2one('stock.lot', '刀柄序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀柄')])
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.cutting.tool.material', string='刀柄型号', readonly=True)
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀柄型号', readonly=True)
|
||||
handle_name = fields.Char('刀柄名称', readonly=True)
|
||||
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', readonly=True)
|
||||
|
||||
# 夹头型号
|
||||
chuck_code_id = fields.Many2one('stock.lot', '夹头序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '夹头')])
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.cutting.tool.material', string='夹头型号', readonly=True)
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='夹头型号', readonly=True)
|
||||
chuck_name = fields.Char('夹头名称', readonly=True, compute='_compute_auto_fill')
|
||||
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', readonly=True)
|
||||
|
||||
@@ -207,7 +208,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
def _compute_auto_fill(self):
|
||||
for record in self:
|
||||
if record.integral_code_id:
|
||||
record.cutting_tool_integral_model_id = record.integral_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_integral_model_id = record.integral_code_id.product_id.cutting_tool_model_id.id
|
||||
record.integral_name = record.integral_code_id.product_id.name
|
||||
record.sf_tool_brand_id_1 = record.integral_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -215,7 +216,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
record.integral_name = None
|
||||
record.sf_tool_brand_id_1 = None
|
||||
if record.blade_code_id:
|
||||
record.cutting_tool_blade_model_id = record.blade_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_blade_model_id = record.blade_code_id.product_id.cutting_tool_model_id.id
|
||||
record.blade_name = record.blade_code_id.product_id.name
|
||||
record.sf_tool_brand_id_2 = record.blade_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -223,7 +224,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
record.blade_name = None
|
||||
record.sf_tool_brand_id_2 = None
|
||||
if record.bar_code_id:
|
||||
record.cutting_tool_cutterbar_model_id = record.bar_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_cutterbar_model_id = record.bar_code_id.product_id.cutting_tool_model_id.id
|
||||
record.bar_name = record.bar_code_id.product_id.name
|
||||
record.sf_tool_brand_id_3 = record.bar_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -231,7 +232,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
record.bar_name = None
|
||||
record.sf_tool_brand_id_3 = None
|
||||
if record.pad_code_id:
|
||||
record.cutting_tool_cutterpad_model_id = record.pad_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_cutterpad_model_id = record.pad_code_id.product_id.cutting_tool_model_id.id
|
||||
record.pad_name = record.pad_code_id.product_id.name
|
||||
record.sf_tool_brand_id_4 = record.pad_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -239,7 +240,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
record.pad_name = None
|
||||
record.sf_tool_brand_id_4 = None
|
||||
if record.handle_code_id:
|
||||
record.cutting_tool_cutterhandle_model_id = record.handle_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_cutterhandle_model_id = record.handle_code_id.product_id.cutting_tool_model_id.id
|
||||
record.handle_name = record.handle_code_id.product_id.name
|
||||
record.sf_tool_brand_id_5 = record.handle_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -247,7 +248,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
record.handle_name = None
|
||||
record.sf_tool_brand_id_5 = None
|
||||
if record.chuck_code_id:
|
||||
record.cutting_tool_cutterhead_model_id = record.chuck_code_id.product_id.cutting_tool_material_id.id
|
||||
record.cutting_tool_cutterhead_model_id = record.chuck_code_id.product_id.cutting_tool_model_id.id
|
||||
record.chuck_name = record.chuck_code_id.product_id.name
|
||||
record.sf_tool_brand_id_6 = record.chuck_code_id.product_id.brand_id.id
|
||||
else:
|
||||
@@ -302,12 +303,12 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
'barcode_id': stock_lot.id,
|
||||
'functional_tool_name_id': self.functional_tool_name_id.id,
|
||||
'mrs_cutting_tool_type_id': self.functional_tool_type_id.id,
|
||||
'cutting_tool_integral_model_id': self.cutting_tool_integral_model_id.id,
|
||||
'cutting_tool_blade_model_id': self.cutting_tool_blade_model_id.id,
|
||||
'cutting_tool_cutterbar_model_id': self.cutting_tool_cutterbar_model_id.id,
|
||||
'cutting_tool_cutterpad_model_id': self.cutting_tool_cutterpad_model_id.id,
|
||||
'cutting_tool_cutterhandle_model_id': self.cutting_tool_cutterhandle_model_id.id,
|
||||
'cutting_tool_cutterhead_model_id': self.cutting_tool_cutterhead_model_id.id,
|
||||
'cutting_tool_integral_model_id': self.integral_code_id.product_id.id,
|
||||
'cutting_tool_blade_model_id': self.blade_code_id.product_id.id,
|
||||
'cutting_tool_cutterbar_model_id': self.bar_code_id.product_id.id,
|
||||
'cutting_tool_cutterpad_model_id': self.pad_code_id.product_id.id,
|
||||
'cutting_tool_cutterhandle_model_id': self.handle_code_id.product_id.id,
|
||||
'cutting_tool_cutterhead_model_id': self.chuck_code_id.product_id.id,
|
||||
'diameter': self.functional_tool_diameter,
|
||||
'tool_grade': None,
|
||||
'machining_accuracy': None,
|
||||
|
||||
@@ -4,7 +4,6 @@ from odoo import SUPERUSER_ID, _, api, fields, models
|
||||
from odoo.osv import expression
|
||||
|
||||
|
||||
|
||||
class SfLocation(models.Model):
|
||||
_inherit = 'stock.location'
|
||||
|
||||
@@ -201,7 +200,6 @@ class SfLocation(models.Model):
|
||||
j_str = str(j + 1).zfill(3) # 确保是两位数,如果不足两位,左侧补0
|
||||
return area_type_barcode + self.channel + self.direction + '-' + self.barcode + '-' + i_str + '-' + j_str
|
||||
|
||||
|
||||
# def generate_barcode(self, i, j):
|
||||
# # 这里是你生成barcode的代码
|
||||
# area_type_barcode = self.location_id.barcode
|
||||
@@ -217,26 +215,51 @@ class SfProcurementGroup(models.Model):
|
||||
修改路线多规则条件选取
|
||||
"""
|
||||
if warehouse_id:
|
||||
domain = expression.AND([['|', ('warehouse_id', '=', warehouse_id.id), ('warehouse_id', '=', False)], domain])
|
||||
domain = expression.AND(
|
||||
[['|', ('warehouse_id', '=', warehouse_id.id), ('warehouse_id', '=', False)], domain])
|
||||
Rule = self.env['stock.rule']
|
||||
res = self.env['stock.rule']
|
||||
if route_ids:
|
||||
res = Rule.search(expression.AND([[('route_id', 'in', route_ids.ids)], domain]), order='route_sequence, sequence', limit=1)
|
||||
res_list = Rule.search(expression.AND([[('route_id', 'in', route_ids.ids)], domain]),
|
||||
order='route_sequence, sequence')
|
||||
for res1 in res_list:
|
||||
if product_id.categ_id in res1.location_dest_id.product_type or product_id.categ_id in res1.location_src_id.product_type:
|
||||
res = res1
|
||||
if not res:
|
||||
res = Rule.search(expression.AND([[('route_id', 'in', route_ids.ids)], domain]),
|
||||
order='route_sequence, sequence', limit=1)
|
||||
|
||||
if not res and packaging_id:
|
||||
packaging_routes = packaging_id.route_ids
|
||||
if packaging_routes:
|
||||
res = Rule.search(expression.AND([[('route_id', 'in', packaging_routes.ids)], domain]), order='route_sequence, sequence', limit=1)
|
||||
if not res:
|
||||
product_routes = product_id.route_ids | product_id.categ_id.total_route_ids
|
||||
if product_routes:
|
||||
res = Rule.search(expression.AND([[('route_id', 'in', product_routes.ids)], domain]), order='route_sequence, sequence', limit=1)
|
||||
if not res and warehouse_id:
|
||||
warehouse_routes = warehouse_id.route_ids
|
||||
if warehouse_routes:
|
||||
res_list = Rule.search(expression.AND([[('route_id', 'in', warehouse_routes.ids)], domain]), order='route_sequence, sequence')
|
||||
res_list = Rule.search(expression.AND([[('route_id', 'in', packaging_routes.ids)], domain]),
|
||||
order='route_sequence, sequence')
|
||||
for res1 in res_list:
|
||||
if product_id.categ_id in res1.location_dest_id.product_type or product_id.categ_id in res1.location_src_id.product_type:
|
||||
res = res1
|
||||
if not res:
|
||||
res = Rule.search(expression.AND([[('route_id', 'in', packaging_routes.ids)], domain]),
|
||||
order='route_sequence, sequence', limit=1)
|
||||
if not res:
|
||||
res = Rule.search(expression.AND([[('route_id', 'in', warehouse_routes.ids)], domain]), order='route_sequence, sequence', limit=1)
|
||||
return res
|
||||
product_routes = product_id.route_ids | product_id.categ_id.total_route_ids
|
||||
if product_routes:
|
||||
res_list = Rule.search(expression.AND([[('route_id', 'in', product_routes.ids)], domain]),
|
||||
order='route_sequence, sequence')
|
||||
for res1 in res_list:
|
||||
if product_id.categ_id in res1.location_dest_id.product_type or product_id.categ_id in res1.location_src_id.product_type:
|
||||
res = res1
|
||||
if not res:
|
||||
res = Rule.search(expression.AND([[('route_id', 'in', product_routes.ids)], domain]),
|
||||
order='route_sequence, sequence', limit=1)
|
||||
if not res and warehouse_id:
|
||||
warehouse_routes = warehouse_id.route_ids
|
||||
if warehouse_routes:
|
||||
res_list = Rule.search(expression.AND([[('route_id', 'in', warehouse_routes.ids)], domain]),
|
||||
order='route_sequence, sequence')
|
||||
for res1 in res_list:
|
||||
if product_id.categ_id in res1.location_dest_id.product_type or product_id.categ_id in res1.location_src_id.product_type:
|
||||
res = res1
|
||||
if not res:
|
||||
res = Rule.search(expression.AND([[('route_id', 'in', warehouse_routes.ids)], domain]),
|
||||
order='route_sequence, sequence', limit=1)
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user