Merge branch 'develop' of https://e.coding.net/jikimo-hn/jikimo_sfs/jikimo_sf into feature/制造功能优化
# Conflicts: # quality_control/security/ir.model.access.csv # quality_control/wizard/quality_check_wizard.py # sf_quality/__manifest__.py # sf_quality/models/__init__.py # sf_quality/models/stock.py
This commit is contained in:
@@ -81,18 +81,38 @@ class StockPicking(models.Model):
|
||||
return quality_pickings
|
||||
|
||||
def action_cancel(self):
|
||||
"""
|
||||
调拨单取消后,关联取消质量检查单
|
||||
"""
|
||||
context = self.env.context
|
||||
if not context.get('cancel_check_picking') and self.sudo().mapped('check_ids').filtered(
|
||||
lambda x: x.quality_state in ['pass', 'fail']):
|
||||
self.env.cr.rollback()
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'picking.check.cancel.wizard',
|
||||
'name': '取消质检单',
|
||||
'view_mode': 'form',
|
||||
'target': 'new',
|
||||
'context': {
|
||||
'default_picking_id': self.id,
|
||||
'cancel_check_picking': True}
|
||||
}
|
||||
elif self.check_ids.filtered(lambda x: x.quality_state != 'cancel'):
|
||||
self.sudo().mapped('check_ids').filtered(lambda x: x.quality_state != 'cancel').write({
|
||||
'quality_state': 'cancel'
|
||||
})
|
||||
res = super(StockPicking, self).action_cancel()
|
||||
self.sudo().mapped('check_ids').filtered(lambda x: x.quality_state == 'none').unlink()
|
||||
# self.sudo().mapped('check_ids').filtered(lambda x: x.quality_state == 'none').unlink()
|
||||
return res
|
||||
|
||||
def action_open_quality_check_picking(self):
|
||||
action = self.env["ir.actions.actions"]._for_xml_id("quality_control.quality_check_action_picking")
|
||||
action['context'] = self.env.context.copy()
|
||||
action['context'].update({
|
||||
action['context'] = {
|
||||
'search_default_picking_id': [self.id],
|
||||
'default_picking_id': self.id,
|
||||
'show_lots_text': self.show_lots_text,
|
||||
})
|
||||
}
|
||||
return action
|
||||
|
||||
def button_quality_alert(self):
|
||||
|
||||
Reference in New Issue
Block a user