修改胚料部分
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)', '排序不能重复!')
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user