Merge branch 'develop' into feature/必填字段label添加星号

This commit is contained in:
WEB许何哲\xuhez
2023-08-24 09:03:20 +08:00
20 changed files with 432 additions and 339 deletions

View File

@@ -256,7 +256,7 @@ class MachineToolType(models.Model):
name = fields.Char('名称')
brand_id = fields.Many2one('sf.machine.brand', string='品牌')
knife_type = fields.Selection(
[("BT40", "BT40"), ("BT30", "BT30")],
[("BT40", "BT40"), ("BT30", "BT30"), ("BT50", "BT50")],
default="", string="刀把类型")
number_of_knife_library = fields.Integer('刀库数量')
rotate_speed = fields.Integer('转速')
@@ -308,6 +308,13 @@ class MachineToolType(models.Model):
active = fields.Boolean('有效', default=True)
code = fields.Char('编码')
def _get_ids(self, machine_tool_type_code):
machine_tool_type_ids = []
for item in machine_tool_type_code:
machine_tool_type = self.search([('code', '=', item)])
machine_tool_type_ids.append(machine_tool_type.id)
return [(6, 0, machine_tool_type_ids)]
class MachineToolCategory(models.Model):
_name = 'sf.machine_tool.category'

View File

@@ -53,5 +53,10 @@ class FixtureModel(models.Model):
screw_size = fields.Integer(string="螺牙大小[mm]", size=6)
active = fields.Boolean('有效', default=True)
# @api.model
# def create(self, vals):
# obj = super(FixtureModel, self).create(vals)
# return obj

View File

@@ -30,6 +30,7 @@
<field name="name"/>
<field name="tag_ids" widget="many2many_tags" optional="hide"/>
<field name="remark"/>
<field name="image_brand" widget="image"/>
</tree>
</field>
</record>
@@ -41,16 +42,16 @@
<form string="品牌" create="0" edit="0" delete="1">
<sheet>
<!-- <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>-->
<field name="image_brand" widget='image' class="oe_avatar"
options="{'preview_image': 'image_128'}" string="log"/>
<div class="oe_title">
<h1>
<field name="code" readonly="1"/>
<field name="name" readonly="1"/>
</h1>
<field name="image_brand" widget='image' class="oe_avatar"
options="{'preview_image': 'image_128'}" string="log"/>
</div>
<group>
<group>
<field name="name" string="名称"/>
<field name="code"/>
<field name="tag_ids"
widget="many2many_tags"
options="{'color_field': 'color', 'no_create_edit': True}"
@@ -108,15 +109,15 @@
<sheet>
<div class="oe_title">
<h1>
<field name="code"/>
<field name="name" placeholder="e.g. LED Monitor"/>
</h1>
</div>
<group>
<group>
<label for="name"/>
<h1>
<field name="name" string="设备名称" placeholder="e.g. LED Monitor"/>
</h1>
<!-- <label for="name"/>-->
<!-- <h1>-->
<!-- <field name="name" string="设备名称" placeholder="e.g. LED Monitor"/>-->
<!-- </h1>-->
<field name="code" force_save="1" readonly="1"/>
<field name="brand_id" required="1"
domain="[('tag_ids', '=', '机床')]"
@@ -363,7 +364,7 @@
<sheet>
<div class="oe_title">
<h1>
<field name="MTcode"/>
<field name="name" placeholder="e.g. LED Monitor"/>
</h1>
</div>
<group string="基本信息">
@@ -374,7 +375,7 @@
<!-- options="{'no_create': True}"/>-->
<!-- </group>-->
<group>
<field name="name" required="1" string="设备名称" placeholder="e.g. LED Monitor"/>
<field name="MTcode" required="1"/>
<field name="type_id" required="1" options="{'no_create': True}"
domain="[('brand_id', '=', brand_id)]"
attrs="{'invisible': [('brand_id','=',False)]}"/>

View File

@@ -49,7 +49,7 @@
<sheet>
<div class="oe_title">
<h1>
<field name="code"/>
<field name="name" required="1"/>
</h1>
</div>
<group>
@@ -57,7 +57,7 @@
<field name="sequence"/>
</group>
<group>
<field name="name" required="1"/>
<field name="code" force_save="1" readonly="1"/>
</group>
</group>
<notebook>
@@ -119,12 +119,12 @@
<sheet>
<div class="oe_title">
<h1>
<field name="process_encode"/>
<field name="name" required="1"/>
</h1>
</div>
<group>
<group>
<field name="name" required="1" string="名称"/>
<field name="process_encode"/>
</group>
<notebook>
<page string="可选参数">
@@ -199,12 +199,12 @@
<sheet>
<div class="oe_title">
<h1>
<field name="materials_no" readonly="1" force_save="1"/>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="name" readonly="1"/>
<field name="materials_no" readonly="1" force_save="1"/>
<field name="gain_way" required="1"/>
<field name="tensile_strength" required="1"/>
<field name="hardness" required="1"/>
@@ -278,12 +278,12 @@
<sheet>
<div class="oe_title">
<h1>
<field name="materials_no"/>
<field name="name" required="1"/>
</h1>
</div>
<group>
<group>
<field name="name" required="1" string="名称"/>
<field name="materials_no"/>
</group>
<notebook>
<page string="型号">

View File

@@ -163,7 +163,7 @@
<field name="name">夹具型号</field>
<field name="model">sf.fixture.model</field>
<field name="arch" type="xml">
<tree string="夹具型号">
<tree string="夹具型号" create="0" edit="0" delete="1">
<field name="code"/>
<field name="name" string="名称"/>
<field name="brand_id"/>
@@ -177,16 +177,16 @@
<field name="name">夹具型号</field>
<field name="model">sf.fixture.model</field>
<field name="arch" type="xml">
<form string="夹具型号">
<form string="夹具型号" create="0" edit="0" delete="1" >
<sheet>
<div class="oe_title">
<h1>
<field name="code" force_save="1" readonly="1"/>
<field name="name" />
</h1>
</div>
<group>
<group>
<field name="name" string="名称"/>
<field name="code" force_save="1" readonly="1"/>
<field name="fixture_material_id" options="{'no_create': True}"/>
<field name="fixture_material_type" invisible="1"/>
<field name="multi_mounting_type_id" options="{'no_create': True}"/>

View File

@@ -103,12 +103,12 @@
<sheet>
<div class="oe_title">
<h1>
<field name="code"/>
<field name="name"/>
</h1>
</div>
<group string="基本信息">
<group>
<field name="name" string="名称"/>
<field name="code" />
<field name="type_id"/>
<field name="type" invisible="1"/>
<field name="zero_chuck_model_ids" widget="many2many_tags" options="{'no_create': True}"/>

View File

@@ -214,12 +214,12 @@
<sheet>
<div class="oe_title">
<h1>
<field name="code"/>
<field name="name" placeholder="e.g. LED Monitor"/>
</h1>
</div>
<group>
<group>
<field name="name" string="名称"/>
<field name="code" />
<field name="cutting_tool_material_id"
options="{'no_create': True, 'no_quick_create': True}"/>
<field name="cutting_tool_type" invisible="1"/>