表面工艺类别拖动排序

This commit is contained in:
jinling.yang
2023-03-29 17:48:03 +08:00
parent 93c9287717
commit 20d9e469f5
7 changed files with 147 additions and 99 deletions

View File

@@ -45,6 +45,7 @@ class MrsProductionProcessCategory(models.Model):
name = fields.Char('名称')
code = fields.Char("编码")
sequence = fields.Integer('排序')
production_process_ids = fields.One2many('sf.production.process', 'category_id', string="表面工艺")
active = fields.Boolean('有效', default=True)
@@ -61,9 +62,8 @@ class MrsProductionProcess(models.Model):
partner_process_ids = fields.Many2many('res.partner', 'process_ids', '加工工厂')
active = fields.Boolean('有效', default=True)
parameter_ids = fields.One2many('sf.production.process.parameter', 'process_id', string='可选参数')
gain_way = fields.Selection([("自加工", "自加工"), ("外协", "外协")], default="", string="获取方式")
category_id = fields.Many2one('sf.production.process.category')
workcenter_ids = fields.Many2many('mrp.workcenter', 'rel_workcenter_process', required=True)
# workcenter_ids = fields.Many2many('mrp.workcenter', 'rel_workcenter_process', required=True)
@@ -112,12 +112,15 @@ class SupplierSort(models.Model):
('supplier_sort_uniq', 'unique (partner_id,materials_model_id)', '排序不能重复!')
]
class MrsProductionProcessParameter(models.Model):
_name = 'sf.production.process.parameter'
_description = '可选参数'
name = fields.Char('参数名')
active = fields.Boolean('有效', default=True)
price = fields.Float('单价')
code = fields.Char("编码")
name = fields.Char('名称')
gain_way = fields.Selection([("自加工", "自加工"), ("外协", "外协")], default="", string="获取方式")
# price = fields.Float('单价')
process_id = fields.Many2one('sf.production.process', string='表面工艺')
materials_model_ids = fields.Many2many('sf.materials.model', 'applicable_material', string='适用材料')
code = fields.Char("编码")
active = fields.Boolean('有效', default=True)

View File

@@ -49,6 +49,7 @@
<group>
<group>
<field name="code" readonly="1"/>
<field name="sequence"/>
</group>
<group>
<field name="name" required="1"/>
@@ -74,8 +75,9 @@
<record model="ir.ui.view" id="sf_production_process_category_tree">
<field name="model">sf.production.process.category</field>
<field name="arch" type="xml">
<tree string="表面工艺类别">
<field name="code"/>
<tree string="表面工艺类别" default_order="sequence, id" >
<field name="sequence" widget="handle" string="序号"/>
<field name="code" readonly="1"/>
<field name="name"/>
</tree>
</field>
@@ -112,22 +114,38 @@
<group>
<group>
<field name="process_encode" readonly="1"/>
<field name="gain_way" required="1"/>
</group>
<group>
<field name="name" required="1"/>
<field name="workcenter_ids" widget="many2many_tags" string="工作中心" required="0"/>
</group>
<notebook>
<page string="可选参数">
<field name="parameter_ids">
<tree force_save="1">
<field name="code" readonly="1" force_save="1"/>
<field name="name"/>
<field name="price"/>
<field name='process_id' default="default" invisible="1"/>
<field name="gain_way"/>
<field name='process_id' default="default"/>
</tree>
<form>
<sheet>
<group>
<group>
<field name="code" readonly="1"/>
<field name="name" string="参数名"/>
</group>
<group>
<field name='process_id'/>
<field name="gain_way"/>
</group>
</group>
<notebook>
<page string="适用材料">
<field name="materials_model_ids"/>
</page>
</notebook>
</sheet>
</form>
</field>
</page>
<page string="工序">