1、功能刀具清单模型添加功能刀具类型、加工材料、寿命字段;2、删除供应商的地址和email必填;3、优化功能刀具组装单模型,新增五种物料的货位字段,修改继承关系,添加根据货位获取刀具物料信息功能;
This commit is contained in:
@@ -222,72 +222,104 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
image = fields.Binary('图片')
|
||||
|
||||
# 功能刀具组装信息
|
||||
# 整体式刀具型号
|
||||
# ===============整体式刀具型号=================
|
||||
integral_freight_barcode = fields.Char('整体式刀具货位')
|
||||
integral_code_id = fields.Many2one('stock.lot', string='整体式刀具序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '整体式刀具'),
|
||||
('tool_material_status', '=', '可用')])
|
||||
integral_product_id = fields.Many2one('product.product', string='整体式刀具名称',
|
||||
compute='_compute_integral_product_id', store=True)
|
||||
cutting_tool_integral_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='整体式刀具型号',
|
||||
related='integral_code_id.product_id.cutting_tool_model_id')
|
||||
integral_name = fields.Char('整体式刀具名称', related='integral_code_id.product_id.name')
|
||||
related='integral_product_id.cutting_tool_model_id')
|
||||
integral_specification_id = fields.Many2one('sf.tool.materials.basic.parameters', string='整体式刀具规格',
|
||||
related='integral_code_id.product_id.specification_id')
|
||||
related='integral_product_id.specification_id')
|
||||
sf_tool_brand_id_1 = fields.Many2one('sf.machine.brand', string='整体式刀具品牌',
|
||||
related='integral_code_id.product_id.brand_id')
|
||||
related='integral_product_id.brand_id')
|
||||
|
||||
# 刀片型号
|
||||
@api.depends('integral_freight_barcode')
|
||||
def _compute_integral_product_id(self):
|
||||
pass
|
||||
|
||||
# ===============刀片型号====================
|
||||
blade_freight_barcode = fields.Char('刀片货位')
|
||||
blade_code_id = fields.Many2one('stock.lot', '刀片序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀片'),
|
||||
('tool_material_status', '=', '可用')])
|
||||
blade_product_id = fields.Many2one('product.product', string='刀片名称', compute='_compute_blade_product_id',
|
||||
store=True)
|
||||
cutting_tool_blade_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀片型号',
|
||||
related='blade_code_id.product_id.cutting_tool_model_id')
|
||||
blade_name = fields.Char('刀片名称', related='blade_code_id.product_id.name')
|
||||
related='blade_product_id.cutting_tool_model_id')
|
||||
blade_specification_id = fields.Many2one('sf.tool.materials.basic.parameters', string='刀片规格',
|
||||
related='blade_code_id.product_id.specification_id')
|
||||
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', related='blade_code_id.product_id.brand_id')
|
||||
related='blade_product_id.specification_id')
|
||||
sf_tool_brand_id_2 = fields.Many2one('sf.machine.brand', '刀片品牌', related='blade_product_id.brand_id')
|
||||
|
||||
# 刀杆型号
|
||||
@api.depends('blade_freight_barcode')
|
||||
def _compute_blade_product_id(self):
|
||||
pass
|
||||
|
||||
# ====================刀杆型号==================
|
||||
bar_freight_barcode = fields.Char('刀杆货位')
|
||||
bar_code_id = fields.Many2one('stock.lot', '刀杆序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀杆'),
|
||||
('tool_material_status', '=', '可用')])
|
||||
bar_product_id = fields.Many2one('product.product', string='刀杆名称', compute='_compute_bar_product_id',
|
||||
store=True)
|
||||
cutting_tool_cutterbar_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀杆型号',
|
||||
related='bar_code_id.product_id.cutting_tool_model_id')
|
||||
bar_name = fields.Char('刀杆名称', related='bar_code_id.product_id.name')
|
||||
related='bar_product_id.cutting_tool_model_id')
|
||||
bar_specification_id = fields.Many2one('sf.tool.materials.basic.parameters', string='刀杆规格',
|
||||
related='bar_code_id.product_id.specification_id')
|
||||
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', related='bar_code_id.product_id.brand_id')
|
||||
related='bar_product_id.specification_id')
|
||||
sf_tool_brand_id_3 = fields.Many2one('sf.machine.brand', '刀杆品牌', related='bar_product_id.brand_id')
|
||||
|
||||
# 刀盘型号
|
||||
@api.depends('bar_freight_barcode')
|
||||
def _compute_bar_product_id(self):
|
||||
pass
|
||||
|
||||
# ===============刀盘型号===================
|
||||
pad_freight_barcode = fields.Char('刀盘货位')
|
||||
pad_code_id = fields.Many2one('stock.lot', '刀盘序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀盘'),
|
||||
('tool_material_status', '=', '可用')])
|
||||
pad_product_id = fields.Many2one('product.product', string='刀盘名称', compute='_compute_pad_product_id',
|
||||
store=True)
|
||||
cutting_tool_cutterpad_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀盘型号',
|
||||
related='pad_code_id.product_id.cutting_tool_model_id')
|
||||
pad_name = fields.Char('刀盘名称', related='pad_code_id.product_id.name')
|
||||
related='pad_product_id.cutting_tool_model_id')
|
||||
pad_specification_id = fields.Many2one('sf.tool.materials.basic.parameters', string='刀盘规格',
|
||||
related='pad_code_id.product_id.specification_id')
|
||||
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', related='pad_code_id.product_id.brand_id')
|
||||
related='pad_product_id.specification_id')
|
||||
sf_tool_brand_id_4 = fields.Many2one('sf.machine.brand', '刀盘品牌', related='pad_product_id.brand_id')
|
||||
|
||||
# 刀柄型号
|
||||
@api.depends('pad_freight_barcode')
|
||||
def _compute_pad_product_id(self):
|
||||
pass
|
||||
|
||||
# ================刀柄型号===============
|
||||
handle_code_id = fields.Many2one('stock.lot', '刀柄序列号', required=True,
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '刀柄'),
|
||||
('tool_material_status', '=', '可用')])
|
||||
handle_product_id = fields.Many2one('product.product', string='刀柄名称', related='handle_code_id.product_id')
|
||||
cutting_tool_cutterhandle_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='刀柄型号',
|
||||
related='handle_code_id.product_id.cutting_tool_model_id')
|
||||
handle_name = fields.Char('刀柄名称', related='handle_code_id.product_id.name')
|
||||
handle_specification_id = fields.Many2one('sf.tool.materials.basic.parameters', string='刀柄规格',
|
||||
related='handle_code_id.product_id.specification_id')
|
||||
sf_tool_brand_id_5 = fields.Many2one('sf.machine.brand', '刀柄品牌', related='handle_code_id.product_id.brand_id')
|
||||
|
||||
# 夹头型号
|
||||
chuck_code_id = fields.Many2one('stock.lot', '夹头序列号', required=True,
|
||||
# =================夹头型号==============
|
||||
chuck_freight_barcode = fields.Char('夹头货位', required=True)
|
||||
chuck_code_id = fields.Many2one('stock.lot', '夹头序列号',
|
||||
domain=[('product_id.cutting_tool_material_id.name', '=', '夹头'),
|
||||
('tool_material_status', '=', '可用')])
|
||||
chuck_product_id = fields.Many2one('product.product', string='夹头名称', compute='_compute_chuck_product_id',
|
||||
store=True)
|
||||
cutting_tool_cutterhead_model_id = fields.Many2one('sf.cutting_tool.standard.library', string='夹头型号',
|
||||
related='chuck_code_id.product_id.cutting_tool_model_id')
|
||||
chuck_name = fields.Char('夹头名称', related='chuck_code_id.product_id.name')
|
||||
related='chuck_product_id.cutting_tool_model_id')
|
||||
chuck_specification_id = fields.Many2one('sf.tool.materials.basic.parameters', string='夹头规格',
|
||||
related='chuck_code_id.product_id.specification_id')
|
||||
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', related='chuck_code_id.product_id.brand_id')
|
||||
related='chuck_product_id.specification_id')
|
||||
sf_tool_brand_id_6 = fields.Many2one('sf.machine.brand', '夹头品牌', related='chuck_product_id.brand_id')
|
||||
|
||||
@api.depends('chuck_freight_barcode')
|
||||
def _compute_chuck_product_id(self):
|
||||
pass
|
||||
|
||||
# ========================================
|
||||
|
||||
def on_barcode_scanned(self, barcode):
|
||||
"""
|
||||
@@ -437,7 +469,7 @@ class FunctionalToolAssemblyOrder(models.TransientModel):
|
||||
else:
|
||||
obj.after_assembly_functional_tool_name = ''
|
||||
|
||||
@api.onchange('integral_code_id')
|
||||
@api.onchange('integral_freight_barcode')
|
||||
def _onchange_after_assembly_functional_tool_diameter(self):
|
||||
for obj in self:
|
||||
if obj.integral_code_id:
|
||||
|
||||
@@ -201,20 +201,18 @@
|
||||
<group string="组装物料信息" col="1">
|
||||
<field name="_barcode_scanned" widget="barcode_handler"/>
|
||||
<group col="1"
|
||||
attrs="{'invisible': ['|','|',('blade_code_id', '!=', False),('bar_code_id', '!=', False),('pad_code_id', '!=', False)]}">
|
||||
attrs="{'invisible': ['|','|',('blade_freight_barcode', '!=', False),('bar_freight_barcode', '!=', False),('pad_freight_barcode', '!=', False)]}">
|
||||
<div>
|
||||
<separator string="整体式刀具:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="integral_code_id" placeholder="请选择" string="序列号"
|
||||
class="custom_required"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="integral_freight_barcode" string="货位"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="integral_name" string="名称"/>
|
||||
<field name="integral_product_id" string="名称"/>
|
||||
<field name="integral_specification_id" string="规格"/>
|
||||
</group>
|
||||
<group>
|
||||
@@ -223,20 +221,18 @@
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group col="1" attrs="{'invisible': [('integral_code_id', '!=', False)]}">
|
||||
<group col="1" attrs="{'invisible': [('integral_freight_barcode', '!=', False)]}">
|
||||
<div>
|
||||
<separator string="刀片:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="blade_code_id" placeholder="请选择" string="序列号"
|
||||
class="custom_required"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="blade_freight_barcode" string="货位"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="blade_name" string="名称"/>
|
||||
<field name="blade_product_id" string="名称"/>
|
||||
<field name="blade_specification_id" string="规格"/>
|
||||
</group>
|
||||
<group>
|
||||
@@ -246,20 +242,18 @@
|
||||
</group>
|
||||
</group>
|
||||
<group col="1"
|
||||
attrs="{'invisible': ['|',('integral_code_id', '!=', False),('pad_code_id', '!=', False)]}">
|
||||
attrs="{'invisible': ['|',('integral_freight_barcode', '!=', False),('pad_freight_barcode', '!=', False)]}">
|
||||
<div>
|
||||
<separator string="刀杆:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="bar_code_id" placeholder="请选择" string="序列号"
|
||||
class="custom_required"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="bar_freight_barcode" string="货位"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="bar_name" string="名称"/>
|
||||
<field name="bar_product_id" string="名称"/>
|
||||
<field name="bar_specification_id" string="规格"/>
|
||||
</group>
|
||||
<group>
|
||||
@@ -269,20 +263,18 @@
|
||||
</group>
|
||||
</group>
|
||||
<group col="1"
|
||||
attrs="{'invisible': ['|',('integral_code_id', '!=', False),('bar_code_id', '!=', False)]}">
|
||||
attrs="{'invisible': ['|',('bar_freight_barcode', '!=', False),('bar_freight_barcode', '!=', False)]}">
|
||||
<div>
|
||||
<separator string="刀盘:" style="font-size: 13px;"/>
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="pad_code_id" placeholder="请选择" string="序列号"
|
||||
class="custom_required"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="pad_freight_barcode" string="货位"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="pad_name" string="名称"/>
|
||||
<field name="pad_product_id" string="名称"/>
|
||||
<field name="pad_specification_id" string="规格"/>
|
||||
</group>
|
||||
<group>
|
||||
@@ -304,7 +296,7 @@
|
||||
</group>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="handle_name" string="名称"/>
|
||||
<field name="handle_product_id" string="名称"/>
|
||||
<field name="handle_specification_id" string="规格"/>
|
||||
</group>
|
||||
<group>
|
||||
@@ -319,14 +311,12 @@
|
||||
</div>
|
||||
<group>
|
||||
<group>
|
||||
<field name="chuck_code_id" string="序列号" placeholder="请选择"
|
||||
class="custom_required"
|
||||
options="{'no_create': True, 'no_quick_create': True}"/>
|
||||
<field name="chuck_freight_barcode" string="货位"/>
|
||||
</group>
|
||||
</group>
|
||||
<group col="2">
|
||||
<group>
|
||||
<field name="chuck_name" string="名称"/>
|
||||
<field name="chuck_product_id" string="名称"/>
|
||||
<field name="chuck_specification_id" string="规格"/>
|
||||
</group>
|
||||
<group>
|
||||
|
||||
Reference in New Issue
Block a user