修改胚料部分
This commit is contained in:
@@ -196,8 +196,7 @@ class MachineTool(models.Model):
|
||||
kw = json.dumps(machine_tool_list, ensure_ascii=False)
|
||||
r = requests.post(strurl, json={}, data={'kw': kw, 'token': token}, headers=headers)
|
||||
ret = r.json()
|
||||
self.code = ret['code']
|
||||
print(r)
|
||||
self.code = ret['message']
|
||||
if r == 200:
|
||||
return "机床注册成功"
|
||||
else:
|
||||
|
||||
@@ -31,6 +31,10 @@ class MrsMaterialModel(models.Model):
|
||||
density = fields.Float("密度(kg/m³)")
|
||||
materials_id = fields.Many2one('sf.production.materials', "材料名")
|
||||
remark = fields.Text("备注")
|
||||
gain_way = fields.Selection(
|
||||
[("自加工", "自加工"), ("外协", "外协"), ("采购", "采购")],
|
||||
default="", string="获取方式")
|
||||
supplier_ids = fields.One2many('sf.supplier.sort', 'materials_model_id', string='供应商')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
@@ -63,7 +67,6 @@ class MrsProcessingOrder(models.Model):
|
||||
_name = 'sf.processing.order'
|
||||
_description = '工序'
|
||||
sequence = fields.Integer('Sequence')
|
||||
|
||||
processing_technology_ids = fields.Many2many('sf.processing.technology', 'sf_associated_processes',
|
||||
index=True, string='加工工艺')
|
||||
production_process_id = fields.Many2one('sf.production.process', string="表面工艺")
|
||||
@@ -79,3 +82,17 @@ class Tray(models.Model):
|
||||
[("空闲", "空闲"), ("占用", "占用"), ("报损", "报损")],
|
||||
default="空闲", string="状态")
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
|
||||
class SupplierSort(models.Model):
|
||||
_name = 'sf.supplier.sort'
|
||||
_description = '供应商排序'
|
||||
|
||||
sequence = fields.Integer('Sequence')
|
||||
partner_id = fields.Many2one('res.partner', domain="[('is_company', '=', True),('supplier_rank', '!=', 0)]")
|
||||
materials_model_id = fields.Many2one('sf.materials.model')
|
||||
|
||||
_sql_constraints = [
|
||||
('supplier_sort_uniq', 'unique (partner_id,materials_model_id)', '排序不能重复!')
|
||||
]
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ access_sf_production_materials,sf_production_materials,model_sf_production_mater
|
||||
access_sf_materials_model,sf_materials_model,model_sf_materials_model,base.group_user,1,1,1,1
|
||||
access_sf_processing_technology,sf_processing_technology,model_sf_processing_technology,base.group_user,1,1,1,1
|
||||
access_sf_tray,sf_tray,model_sf_tray,base.group_user,1,1,1,1
|
||||
access_sf_supplier_sort,sf_supplier_sort,model_sf_supplier_sort,base.group_user,1,1,1,1
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -6,23 +6,17 @@
|
||||
<field name="model">sf.processing.technology</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="加工工艺">
|
||||
|
||||
<group>
|
||||
<group>
|
||||
<field name="process_encode" readonly="1"/>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" required="1"/>
|
||||
</group>
|
||||
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -30,10 +24,8 @@
|
||||
<field name="model">sf.processing.technology</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="加工工艺">
|
||||
|
||||
<field name="process_encode"/>
|
||||
<field name="name"/>
|
||||
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -52,13 +44,13 @@
|
||||
<field name="model">sf.production.process</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="表面工艺">
|
||||
|
||||
<field name="process_encode" readonly="1"/>
|
||||
<field name="name" readonly="1"/>
|
||||
<field name="remark"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="sf_production_process_form">
|
||||
<field name="model">sf.production.process</field>
|
||||
<field name="arch" type="xml">
|
||||
@@ -77,9 +69,7 @@
|
||||
</field>
|
||||
</tree>
|
||||
<form>
|
||||
|
||||
<field name="processing_technology_ids" widget="many2many">
|
||||
|
||||
</field>
|
||||
</form>
|
||||
</field>
|
||||
@@ -110,24 +100,28 @@
|
||||
<group>
|
||||
<field name="materials_no" readonly="1"/>
|
||||
<field name="name" required="1"/>
|
||||
<field name="gain_way" required="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="density" required="1"/>
|
||||
<field name="need_h" default="false"/>
|
||||
<field name="mf_materia_post" attrs="{'invisible':[('need_h','=',False)]} "/>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<field name='materials_id' default="default" invisible="1"/>
|
||||
<field name="density" required="1"/>
|
||||
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group>
|
||||
<field name='supplier_ids'>
|
||||
<tree editable='bottom'>
|
||||
<field name="sequence" widget="handle" string="序号"/>
|
||||
<field name="partner_id" string="名称"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<group>
|
||||
<field name="remark"/>
|
||||
</group>
|
||||
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user