1.材料型号新增获取方式和供应商的输入验证2.每齿走刀量去掉切削速度字段
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import logging
|
||||
from urllib.parse import urlencode
|
||||
from odoo import fields, models
|
||||
from odoo import fields, models, api
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -59,6 +61,14 @@ class MrsMaterialModel(models.Model):
|
||||
supplier_ids = fields.One2many('sf.supplier.sort', 'materials_model_id', string='供应商')
|
||||
active = fields.Boolean('有效', default=True)
|
||||
|
||||
@api.constrains('gain_way', 'supplier_ids')
|
||||
def _check_gain_way(self):
|
||||
if not self.gain_way:
|
||||
raise UserError("请输入获取方式")
|
||||
if self.gain_way in ['外协', '采购']:
|
||||
if not self.supplier_ids:
|
||||
raise UserError("请添加供应商")
|
||||
|
||||
|
||||
class MrsProductionProcessCategory(models.Model):
|
||||
_name = 'sf.production.process.category'
|
||||
|
||||
Reference in New Issue
Block a user