1、更新功能刀具编码生成规则;
This commit is contained in:
@@ -503,32 +503,21 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
|||||||
# functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
# functional_tool_cutting_type = fields.Char(string='功能刀具切削类型', readonly=False)
|
||||||
# res_partner_id = fields.Many2one('res.partner', '智能工厂', domain="[('is_factory', '=', True)]")
|
# res_partner_id = fields.Many2one('res.partner', '智能工厂', domain="[('is_factory', '=', True)]")
|
||||||
|
|
||||||
@api.depends('after_assembly_functional_tool_type_id', 'integral_specification_id', 'bar_specification_id',
|
@api.depends('after_assembly_functional_tool_type_id', 'cutting_tool_cutterhandle_model_id',
|
||||||
'pad_specification_id', 'handle_specification_id', 'after_assembly_tool_loading_length')
|
'after_assembly_functional_tool_diameter', 'after_assembly_tool_loading_length',
|
||||||
|
'after_assembly_knife_tip_r_angle', 'after_assembly_functional_tool_length',
|
||||||
|
'after_assembly_handle_length')
|
||||||
def _compute_code(self):
|
def _compute_code(self):
|
||||||
for obj in self:
|
for obj in self:
|
||||||
str_1 = 'GNDJ-%s' % obj.after_assembly_functional_tool_type_id.code
|
if obj.cutting_tool_cutterhandle_model_id:
|
||||||
str_2 = ''
|
code = obj.cutting_tool_cutterhandle_model_id.code.split('-', 1)[0]
|
||||||
if obj.handle_specification_id:
|
str_1 = '%s-GNDJ-%s-D%sL%sR%sB%sH%s' % (
|
||||||
if obj.integral_specification_id:
|
code, obj.after_assembly_functional_tool_type_id.code, obj.after_assembly_functional_tool_diameter,
|
||||||
str_2 = '%s-D%sL%sB%sH%s-' % (
|
obj.after_assembly_tool_loading_length, obj.after_assembly_knife_tip_r_angle,
|
||||||
str_1, obj.integral_specification_id.blade_diameter, obj.after_assembly_tool_loading_length,
|
round(obj.after_assembly_functional_tool_length, 3), obj.after_assembly_handle_length)
|
||||||
obj.integral_specification_id.blade_length, obj.handle_specification_id.total_length)
|
obj.code = '%s-%s' % (str_1, self._get_code(str_1))
|
||||||
elif obj.bar_specification_id:
|
|
||||||
str_2 = '%s-D%sL%sB%sH%s-' % (
|
|
||||||
str_1, obj.bar_specification_id.cutter_arbor_diameter, obj.after_assembly_tool_loading_length,
|
|
||||||
obj.bar_specification_id.blade_length, obj.handle_specification_id.total_length)
|
|
||||||
elif obj.pad_specification_id:
|
|
||||||
str_2 = '%s-D%sL%sB%sH%s-' % (
|
|
||||||
str_1, obj.pad_specification_id.cutter_head_diameter, obj.after_assembly_tool_loading_length,
|
|
||||||
obj.pad_specification_id.cut_depth_max, obj.handle_specification_id.total_length,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
obj.code = str_2
|
|
||||||
return True
|
|
||||||
obj.code = str_2 + str(self._get_code(str_2))
|
|
||||||
else:
|
else:
|
||||||
obj.code = str_2
|
obj.code = ''
|
||||||
|
|
||||||
def _get_code(self, str_2):
|
def _get_code(self, str_2):
|
||||||
functional_tool_assembly = self.env['sf.functional.cutting.tool.entity'].sudo().search(
|
functional_tool_assembly = self.env['sf.functional.cutting.tool.entity'].sudo().search(
|
||||||
|
|||||||
Reference in New Issue
Block a user