1、优化工单子页签可全量配置处理方法;
This commit is contained in:
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