1、功能刀具清单模型添加功能刀具类型、加工材料、寿命字段;2、删除供应商的地址和email必填;3、优化功能刀具组装单模型,新增五种物料的货位字段,修改继承关系,添加根据货位获取刀具物料信息功能;
This commit is contained in:
@@ -316,6 +316,7 @@ class ToolInventory(models.Model):
|
||||
|
||||
name = fields.Char('功能刀具名称', required=True)
|
||||
type = fields.Char('类型')
|
||||
functional_cutting_tool_model_id = fields.Many2one('sf.functional.cutting.tool.model', string='功能刀具类型')
|
||||
prefix = fields.Char('前缀')
|
||||
postfix = fields.Char('后缀')
|
||||
diameter = fields.Float('直径(mm)')
|
||||
@@ -326,6 +327,8 @@ class ToolInventory(models.Model):
|
||||
cutter_number = fields.Char('刀号')
|
||||
blade_number = fields.Integer('刃数(个)')
|
||||
extension = fields.Float('伸出长度(mm)')
|
||||
work_material = fields.Selection([('钢', '钢'), ('铝', '铝')], string='加工材料')
|
||||
life_span = fields.Float('寿命(h)')
|
||||
|
||||
tool_groups_id = fields.Many2one('sf.tool.groups', string='刀具组')
|
||||
|
||||
|
||||
@@ -556,20 +556,23 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="功能刀具清单" create="1" edit="1" delete="0" editable="bottom">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="functional_cutting_tool_model_id"/>
|
||||
<field name="tool_groups_id"/>
|
||||
<field name="prefix"/>
|
||||
<field name="postfix"/>
|
||||
<field name="work_material"/>
|
||||
<field name="life_span"/>
|
||||
<field name="prefix" optional="hide"/>
|
||||
<field name="postfix" optional="hide"/>
|
||||
<field name="diameter"/>
|
||||
<field name="angle"/>
|
||||
<field name="tool_length"/>
|
||||
<field name="blade_length"/>
|
||||
<field name="knife_head_name"/>
|
||||
<field name="knife_head_name" optional="hide"/>
|
||||
<field name="cutter_number"/>
|
||||
<field name="blade_number"/>
|
||||
<field name="extension"/>
|
||||
<field name="create_uid" string="创建人" optional="hide"/>
|
||||
<field name="create_date" string="创建时间" optional="hide"/>
|
||||
<field name="type" invisible="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -580,8 +583,10 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="功能刀具清单">
|
||||
<field name="name" string="名称搜索" filter_domain="[('name','ilike',self)]"/>
|
||||
<field name="type"/>
|
||||
<field name="functional_cutting_tool_model_id"/>
|
||||
<field name="tool_groups_id"/>
|
||||
<field name="work_material"/>
|
||||
<field name="life_span"/>
|
||||
<field name="prefix"/>
|
||||
<field name="postfix"/>
|
||||
<field name="diameter"/>
|
||||
|
||||
@@ -52,8 +52,6 @@ class MrStaticResourceDataSync(models.Model):
|
||||
logging.info("夹具型号已每日同步成功")
|
||||
self.env['sf.fixture.materials.basic.parameters'].sync_fixture_materials_basic_parameters_yesterday()
|
||||
logging.info("夹具型号基本参数已每日同步成功")
|
||||
self.env['sf.functional.fixture.type'].sync_fixture_materials_basic_parameters_yesterday()
|
||||
logging.info("夹具型号基本参数已每日同步成功")
|
||||
self.env['sf.functional.fixture.type'].sync_functional_fixture_type_yesterday()
|
||||
logging.info("功能夹具类型已每日同步成功")
|
||||
self.env['sf.cutting.tool.material'].sync_cutting_tool_material_yesterday()
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</field>
|
||||
<field name="email" position="replace">
|
||||
<field name="email"
|
||||
attrs="{'required' : [('customer_rank','>', 0)],'readonly': [('id','!=', False)]}"/>
|
||||
attrs="{'readonly': [('id','!=', False)]}"/>
|
||||
</field>
|
||||
<field name="mobile" position="attributes">
|
||||
<attribute name="attrs">{'required': [('phone', '=', False)],'readonly': [('id','!=', False)]}
|
||||
@@ -37,19 +37,19 @@
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="street" position="attributes">
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)],'readonly': [('id','!=', False)]}
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="street2" position="attributes">
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)],'readonly': [('id','!=', False)]}
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="city" position="attributes">
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)],'readonly': [('id','!=', False)]}
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<field name="country_id" position="attributes">
|
||||
<attribute name="attrs">{'required': [('supplier_rank','>', 0)],'readonly': [('id','!=', False)]}
|
||||
<attribute name="attrs">{'readonly': [('id','!=', False)]}
|
||||
</attribute>
|
||||
</field>
|
||||
<xpath expr="//group[@name='sale']/field[@name='user_id']" position="replace">
|
||||
|
||||
@@ -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