| 1 | # Part of Odoo. See LICENSE file for full copyright and licensing details. |
| 2 | |
| 3 | from odoo import models |
| 4 | |
| 5 | |
| 6 | class StockRule(models.Model): |
| 7 | _inherit = 'stock.rule' |
| 8 | |
| 9 | def _prepare_mo_vals(self, product_id, product_qty, product_uom, location_id, name, origin, company_id, values, bom): |
| 10 | res = super()._prepare_mo_vals(product_id, product_qty, product_uom, location_id, name, origin, company_id, values, bom) |
| 11 | if values.get('project_id'): |
| 12 | res['project_id'] = values['project_id'] |
| 13 | return res |