需求计划下达计划

This commit is contained in:
guanhuan
2025-07-03 17:32:11 +08:00
parent 3822d78f35
commit 6e877d0449
6 changed files with 48 additions and 23 deletions

View File

@@ -21,6 +21,6 @@ class MrpProduction(models.Model):
production.production_type = None
def _get_purchase_request(self):
"""获取跟制造订单相关的采购申请单"""
pr_ids = self.env['purchase.request'].sudo().search([('origin', '=', self.name)])
"""获取跟制造订单相关的采购申请单(根据采购申请单行项目的产品匹配)"""
pr_ids = self.env['purchase.request'].sudo().search([('line_ids.demand_plan_line_id', 'in', self.demand_plan_line_id.ids)])
return pr_ids