Merge branch 'refs/heads/develop' into feature/tool_standard_library_process

This commit is contained in:
liaodanlong
2025-04-14 15:24:22 +08:00
6 changed files with 55 additions and 28 deletions

View File

@@ -38,6 +38,7 @@
'web.assets_qweb': [
],
'web.assets_backend': [
'sf_tool_management/static/src/change.scss'
]
},

View File

@@ -387,7 +387,7 @@ class FunctionalToolAssembly(models.Model):
else:
raise ValidationError('刀柄选择错误,请重新确认!!!')
else:
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', barcode)])
location = self.env['sf.shelf.location'].sudo().search([('barcode', '=', barcode.upper())])
if location:
if location == record.integral_freight_barcode_id:
tool_assembly_id.integral_verify = True
@@ -782,10 +782,11 @@ class FunctionalToolAssembly(models.Model):
"""根据BOM对刀具物料进行初始配置"""
options = bom.get('options')
# 配置刀柄信息
for handle_id in bom.get('handle_ids'):
handle_ids = self._get_old_tool_material_lot(bom.get('handle_ids'))
for handle_id in handle_ids:
if handle_id:
if not self.handle_product_id:
self.handle_product_id = handle_id.id
self.handle_product_id = handle_id.product_id.id
break
# 刀柄之外的物料配置
@@ -820,19 +821,20 @@ class FunctionalToolAssembly(models.Model):
location_id = self.env['stock.location'].search([('name', '=', '刀具房')])
stock_quant = self.env['stock.quant'].sudo().search(
[('location_id', '=', location_id.id), ('product_id', 'in', material_ids.ids), ('quantity', '>', '0')],
order='lot_id', limit=1)
order='lot_id')
if stock_quant:
return stock_quant.lot_id
return [quant.lot_id for quant in stock_quant]
else:
raise ValidationError(f'{material_ids[0].cutting_tool_material_id.name}】物料库存不足,请先进行盘点或采购')
def _get_shelf_location_lot(self, lot_id):
def _get_shelf_location_lot(self, lot_ids):
"""根据所给的刀具物料批次号,返回一个刀具物料货位、批次信息"""
location_lots = self.env['sf.shelf.location.lot'].sudo().search([('lot_id', '=', lot_id.id)])
if not location_lots:
raise ValidationError(f'没有查询到批次为【{lot_id.name}】物料的货位信息!')
else:
return location_lots[0]
for lot_id in lot_ids:
location_lots = self.env['sf.shelf.location.lot'].sudo().search([('lot_id', '=', lot_id.id)])
if location_lots:
return location_lots[0]
raise ValidationError(f'{lot_ids[0].product_id.cutting_tool_material_id.name}】物料在货位库存不足,请先进行盘点入库')
def _get_inventory_bom(self, inventory_id):
"""获取BOM的刀具物料产品信息"""

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 B

View File

@@ -1,17 +1,41 @@
.modal-content .o_cp_buttons {
display:none
}
// .modal-content .o_cp_buttons {
// display:none
// }
.modal-content .o_control_panel {
display:none
}
// .modal-content .o_control_panel {
// display:none
// }
.modal-content .o_list_button {
// .modal-content .o_list_button {
// }
// .o_form_view .o_field_widget .o_list_renderer {
// width: 100%!important;
// margin:0 auto;
// overflow: auto;
// }
.o_field_widget.o_readonly_modifier.o_field_char.text-success[name=handle_freight_rfid],
.o_field_widget.o_readonly_modifier.o_field_many2one.text-success[name=integral_freight_barcode_id] {
a.text-success{
span {
color: #999;
}
}
&::after{
content: '';
display: block;
width: 18px;
height: 18px;
background: url('/sf_tool_management/static/images/replaceIcon.png') no-repeat center center;
background-size: 100%;
}
}
.o_form_view .o_field_widget .o_list_renderer {
width: 100%!important;
margin:0 auto;
overflow: auto;
}
.o_field_widget.o_readonly_modifier.o_field_char.text-success[name=handle_freight_rfid] {
display: flex;
align-items: center;
> span {
color: #999;
}
}

View File

@@ -534,7 +534,7 @@
<group>
<field name="handle_code_id" string="序列号" placeholder="请选择"
options="{'no_create': True, 'no_quick_create': True}"/>
<field name="handle_freight_rfid" string="Rfid"/>
<field name="handle_freight_rfid" string="Rfid" decoration-success="handle_freight_rfid"/>
<field name="handle_product_id" string="名称"/>
<field name="cutting_tool_cutterhandle_model_id" string="型号"/>
<field name="handle_specification_id" string="规格"/>
@@ -555,14 +555,14 @@
</div>
<group>
<group>
<field name="integral_freight_barcode_id" string="货位"/>
<field name="integral_freight_barcode_id" string="货位" decoration-success="integral_verify == True"/>
<field name="integral_lot_id" string="批次"/>
<field name="integral_product_id" string="名称"/>
<field name="cutting_tool_integral_model_id" string="型号"/>
<field name="integral_specification_id" string="规格"/>
<field name="sf_tool_brand_id_1" string="品牌"/>
</group>
<group>
<group invisible="1">
<field name="integral_verify" string="" readonly="1"/>
</group>
</group>

View File

@@ -150,4 +150,4 @@ access_sf_shelf_lot_group_user,sf.shelf.location.lot.group_user,model_sf_shelf_l
access_ir_model_group_sf_stock_user,ir_model_group_sf_stock_user,base.model_ir_model,sf_base.group_sf_stock_user,1,1,0,0
access_mrp_workorder_group_sf_stock_user,mrp_workorder_group_sf_stock_user,mrp.model_mrp_workorder,sf_base.group_sf_stock_user,1,0,0,0
access_mrp_workorder_group_sf_stock_user,mrp_workorder_group_sf_stock_user,mrp.model_mrp_workorder,sf_base.group_sf_stock_user,1,1,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
150
151
152
153