Accept Merge Request #1903: (feature/工单Rfid优化 -> develop)
Merge Request: 1、完成 制造订单内外协调拨单质量检查不通过,点击跳转质量检查页面报错 Created By: @禹翔辉 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @禹翔辉 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/1903
This commit is contained in:
@@ -190,7 +190,6 @@ class QualityCheck(models.Model):
|
|||||||
# doubly linked chain for tablet view navigation
|
# doubly linked chain for tablet view navigation
|
||||||
next_check_id = fields.Many2one('quality.check')
|
next_check_id = fields.Many2one('quality.check')
|
||||||
previous_check_id = fields.Many2one('quality.check')
|
previous_check_id = fields.Many2one('quality.check')
|
||||||
# is_produced = fields.Boolean(string="Has Been Produced")
|
|
||||||
|
|
||||||
# For components registration
|
# For components registration
|
||||||
move_id = fields.Many2one(
|
move_id = fields.Many2one(
|
||||||
|
|||||||
@@ -108,15 +108,11 @@ class StockPicking(models.Model):
|
|||||||
|
|
||||||
def action_open_quality_check_picking(self):
|
def action_open_quality_check_picking(self):
|
||||||
action = self.env["ir.actions.actions"]._for_xml_id("quality_control.quality_check_action_picking")
|
action = self.env["ir.actions.actions"]._for_xml_id("quality_control.quality_check_action_picking")
|
||||||
action['context'] = self.env.context.copy()
|
action['context'] = {
|
||||||
keys_to_remove = [key for key in action['context'] if key.startswith('default_')]
|
|
||||||
for key in keys_to_remove:
|
|
||||||
del action['context'][key]
|
|
||||||
action['context'].update({
|
|
||||||
'search_default_picking_id': [self.id],
|
'search_default_picking_id': [self.id],
|
||||||
'default_picking_id': self.id,
|
'default_picking_id': self.id,
|
||||||
'show_lots_text': self.show_lots_text,
|
'show_lots_text': self.show_lots_text,
|
||||||
})
|
}
|
||||||
return action
|
return action
|
||||||
|
|
||||||
def button_quality_alert(self):
|
def button_quality_alert(self):
|
||||||
|
|||||||
@@ -18,13 +18,13 @@ class StockPicking(models.Model):
|
|||||||
fail_check_text = ''
|
fail_check_text = ''
|
||||||
for product_id in product_list:
|
for product_id in product_list:
|
||||||
check_ids = quality_check_ids.filtered(lambda qc: qc.product_id == product_id)
|
check_ids = quality_check_ids.filtered(lambda qc: qc.product_id == product_id)
|
||||||
|
if all(check_id.measure_on == 'move_line' for check_id in check_ids):
|
||||||
number = sum(check_ids.mapped('qty_line'))
|
number = sum(check_ids.mapped('qty_line'))
|
||||||
if number != 0:
|
else:
|
||||||
|
number = sum(self.move_ids_without_package.filtered(
|
||||||
|
lambda ml: ml.product_id == product_id).mapped('quantity_done'))
|
||||||
fail_check_text = (f'{fail_check_text}、{product_id.name} {number}件'
|
fail_check_text = (f'{fail_check_text}、{product_id.name} {number}件'
|
||||||
if fail_check_text != '' else f'{product_id.name} {number}件')
|
if fail_check_text != '' else f'{product_id.name} {number}件')
|
||||||
else:
|
|
||||||
fail_check_text = (f'{fail_check_text}、{product_id.name}'
|
|
||||||
if fail_check_text != '' else f'{product_id.name}')
|
|
||||||
return {
|
return {
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'res_model': 'picking.validate.check.wizard',
|
'res_model': 'picking.validate.check.wizard',
|
||||||
|
|||||||
Reference in New Issue
Block a user