新增坯料类型

This commit is contained in:
guanhuan
2025-06-27 17:44:32 +08:00
parent c03cda8250
commit 048f07aba4
7 changed files with 43 additions and 7 deletions

View File

@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
from odoo import api, fields, models
class StockRule(models.Model):
@@ -14,3 +13,10 @@ class StockRule(models.Model):
if self.env.context.get('demand_plan_line_id'):
res['demand_plan_line_id'] = self.env.context.get('demand_plan_line_id')
return res
@api.model
def _prepare_purchase_request_line(self, request_id, procurement):
res = super()._prepare_purchase_request_line(request_id, procurement)
if self.env.context.get('demand_plan_line_id'):
res['demand_plan_line_id'] = self.env.context.get('demand_plan_line_id')
return res