处理质检单控制方式为非数量时,调拨单验证时存在不合格质检单的提示信息数量问题

This commit is contained in:
yuxianghui
2025-03-13 16:45:09 +08:00
parent 359eae14cc
commit cd114d183b

View File

@@ -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)
number = sum(check_ids.mapped('qty_line')) if all(check_id.measure_on == 'move_line' for check_id in check_ids):
if number != 0: number = sum(check_ids.mapped('qty_line'))
fail_check_text = (f'{fail_check_text}{product_id.name} {number}'
if fail_check_text != '' else f'{product_id.name} {number}')
else: else:
fail_check_text = (f'{fail_check_text}{product_id.name}' number = sum(self.move_ids_without_package.filtered(
if fail_check_text != '' else f'{product_id.name}') 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 { return {
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
'res_model': 'picking.validate.check.wizard', 'res_model': 'picking.validate.check.wizard',