修复多条采购申请跳转报错

This commit is contained in:
guanhuan
2025-06-11 11:41:03 +08:00
parent 37c5c9d498
commit b8043b3ad2

View File

@@ -39,7 +39,6 @@ class MrpProduction(models.Model):
mrp_names = self.env['mrp.production'].search([('origin', '=', self.origin)]).mapped('name') mrp_names = self.env['mrp.production'].search([('origin', '=', self.origin)]).mapped('name')
pr_ids = self.env['purchase.request'].sudo().search([('origin', 'in', mrp_names)]) pr_ids = self.env['purchase.request'].sudo().search([('origin', 'in', mrp_names)])
action = { action = {
'res_model': 'purchase.request', 'res_model': 'purchase.request',
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
@@ -52,7 +51,7 @@ class MrpProduction(models.Model):
else: else:
action.update({ action.update({
'name': _("%s生成采购请求单", self.name), 'name': _("%s生成采购请求单", self.name),
'domain': [('id', 'in', pr_ids)], 'domain': [('id', 'in', pr_ids.ids)],
'view_mode': 'tree,form', 'view_mode': 'tree,form',
}) })
return action return action