出库单写入报告到bfm
This commit is contained in:
@@ -5,5 +5,5 @@ from . import custom_quality
|
||||
from . import quality
|
||||
from . import quality_cnc_test
|
||||
from . import mrp_workorder
|
||||
# from . import stock
|
||||
from . import stock
|
||||
from . import quality_company
|
||||
|
||||
@@ -5,17 +5,22 @@ 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}
|
||||
}
|
||||
# """
|
||||
# 调拨单若关联了质量检查单,验证调拨单时,应校验是否有不合格品,若存在,应弹窗提示:
|
||||
# “警告:存在不合格产品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}
|
||||
# }
|
||||
|
||||
out_quality_check = self.env['quality.check'].search([('picking_id', '=', self.id), ('test_type_id.name', '=', '出厂检验报告')])
|
||||
|
||||
out_quality_check.upload_factory_report()
|
||||
|
||||
return super(StockPicking, self).button_validate()
|
||||
|
||||
Reference in New Issue
Block a user