Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化
This commit is contained in:
@@ -5,3 +5,4 @@ from . import custom_quality
|
||||
from . import quality
|
||||
from . import quality_cnc_test
|
||||
from . import mrp_workorder
|
||||
# from . import stock
|
||||
|
||||
@@ -18,7 +18,7 @@ class QualityCheck(models.Model):
|
||||
('cancel', '已取消'), ], string='状态', tracking=True, store=True,
|
||||
default='none', copy=False, compute='_compute_quality_state')
|
||||
|
||||
individuation_page_PTD = fields.Boolean('个性化记录(是否显示后置三元检测[PTD]页签)', related='workorder_id.individuation_page_PTD')
|
||||
individuation_page_list = fields.Char('个性化记录', related='workorder_id.individuation_page_list')
|
||||
work_state = fields.Selection(related='workorder_id.state', string='工单状态')
|
||||
processing_panel = fields.Char(related='workorder_id.processing_panel', string='加工面')
|
||||
|
||||
@@ -93,7 +93,8 @@ class QualityCheck(models.Model):
|
||||
raise ValidationError('请填写【判定结果】里的信息')
|
||||
if self.test_results == '合格':
|
||||
raise ValidationError('请重新选择【判定结果】-【检测结果】')
|
||||
if self.workorder_id.routing_type != 'CNC加工' and self.workorder_id.individuation_page_PTD is False:
|
||||
if (self.workorder_id.routing_type != 'CNC加工' and self.workorder_id.individuation_page_list
|
||||
and 'PTD' not in self.workorder_id.individuation_page_list):
|
||||
self.workorder_id.production_id.write({'detection_result_ids': [(0, 0, {
|
||||
'rework_reason': self.reason,
|
||||
'detailed_reason': self.detailed_reason,
|
||||
|
||||
21
sf_quality/models/stock.py
Normal file
21
sf_quality/models/stock.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from odoo import api, models
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_inherit = 'stock.picking'
|
||||
|
||||
def button_validate(self):
|
||||
"""
|
||||
调拨单若关联了质量检查单,验证调拨单时,应校验是否有不合格品,若存在,应弹窗提示:
|
||||
“警告:存在不合格产品XXXX n 件、YYYYY m件,继续调拨请点“确认”,否则请取消?”
|
||||
"""
|
||||
if self.quality_check_ids.filtered(lambda qc: qc.quality_state == 'fail'):
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'sf.functional.tool.assembly.order',
|
||||
'name': ' ',
|
||||
'view_mode': 'form',
|
||||
'target': 'new',
|
||||
'context': {'': True}
|
||||
}
|
||||
return super(StockPicking, self).button_validate()
|
||||
Reference in New Issue
Block a user