Odoo18-Base/addons/project_purchase_stock/models/purchase_order.py
2025-01-06 10:57:38 +07:00

17 lines
390 B
Python

# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class PurchaseOrder(models.Model):
_inherit = 'purchase.order'
def _prepare_picking(self):
res = super()._prepare_picking()
if not self.project_id:
return res
return {
**res,
'project_id': self.project_id.id,
}