コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
3367 ビュー

As of now we can automatically create project from sales order, if sales order lines consist at least one service product.


Is there any way to create automatic project from sales orders. But the sales order line will only have storable product.

アバター
破棄
最善の回答

Hi,

By default, Odoo allows for the automatic creation of a project from a sales order if the sales order lines contain at least one service product.

if you want to create a project automatically from a sales order with only storable products, you would need to customize the system.

Suppose you want to create project on sale order confirmation you can do as this

Inherit sale.order model and in action_confirm function :

def action_confirm(self):
res = super(SaleOrder, self).action_confirm()
for order in self:
if all(line.product_id.type == 'product' for line in order.order_line):
# Create a project for the sales order
project = self.env['project.project'].create({
'name': order.name,
'sale_order_id': order.id,
# Add any other project field values as needed
})
# Link the project to the sales order
order.project_id = project.id
return res


Hope this will help you
Thanks

アバター
破棄

Thanks Mehjabin. Any possibility of getting this done through Studio app ?

最善の回答

in Version 16.3 Odoo has given option of creating Project with Storable product SO as well. Check that out

アバター
破棄

I can't do the same on 16.3. Can you share how to do that? Thx