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:
禹翔辉
2025-03-13 16:47:39 +08:00
committed by Coding
3 changed files with 8 additions and 13 deletions

View File

@@ -190,7 +190,6 @@ class QualityCheck(models.Model):
# doubly linked chain for tablet view navigation
next_check_id = fields.Many2one('quality.check')
previous_check_id = fields.Many2one('quality.check')
# is_produced = fields.Boolean(string="Has Been Produced")
# For components registration
move_id = fields.Many2one(

View File

@@ -108,15 +108,11 @@ class StockPicking(models.Model):
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()
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({
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):

View File

@@ -18,13 +18,13 @@ class StockPicking(models.Model):
fail_check_text = ''
for product_id in product_list:
check_ids = quality_check_ids.filtered(lambda qc: qc.product_id == product_id)
number = sum(check_ids.mapped('qty_line'))
if number != 0:
fail_check_text = (f'{fail_check_text}{product_id.name} {number}'
if fail_check_text != '' else f'{product_id.name} {number}')
if all(check_id.measure_on == 'move_line' for check_id in check_ids):
number = sum(check_ids.mapped('qty_line'))
else:
fail_check_text = (f'{fail_check_text}{product_id.name}'
if fail_check_text != '' else f'{product_id.name}')
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}'
if fail_check_text != '' else f'{product_id.name} {number}')
return {
'type': 'ir.actions.act_window',
'res_model': 'picking.validate.check.wizard',