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'
|
||||
|
||||
@@ -162,7 +162,6 @@ class FeedPerTooth(models.Model):
|
||||
_order = 'blade_diameter,cutting_width_depth_id,materials_type_id'
|
||||
|
||||
name = fields.Char('名称')
|
||||
cutting_speed = fields.Char('切削速度', required=True)
|
||||
product_template_id = fields.Many2one('product.template')
|
||||
standard_library_id = fields.Many2one('sf.cutting_tool.standard.library', string='标准库')
|
||||
blade_diameter = fields.Integer('刃部直径(mm)', readonly=True)
|
||||
|
||||
Reference in New Issue
Block a user