Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3436 Lượt xem

When creating quotations from Opportunities, the Opportunity link and and also name (in field source document) are available in the quotation.

How to create an automated action that when confirming a quote with a service that creates a project, this project gets the opportunity's name?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello,

1. Go to project app -> select one of the projects -> open project settings -> open studio -> add related field to project settings form (sales order=> opputunity => display name
Note : check the invisible checkbox to hide this field (make sure ou copy the technical name of this field before making it invisible


2. create automated action


the name of the newly created project will be updated based on opportunity name (added related field)

Hope this will help.



Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi @sana

I hope you are doing well,

For you to create the project with the same name as the opportunity when confirming the quotation you can do some coding like below to create the project with the same name as in source document.

Please find code in comment.

I hope this will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Ảnh đại diện
Huỷ bỏ

This below code would do it for you.
I hope this will be helpful.

class SaleOrderLine(models.Model):
_inherit = "sale.order.line"

def _timesheet_create_project(self):
"""Generate project values"""
values = super(SaleOrderLine, self)._timesheet_create_project()
if self.order_id.origin:
values["name"] = "%s" % (self.order_id.origin)
return values

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 2 23
2473
1
thg 3 23
9212
1
thg 7 22
97
1
thg 5 24
1237
0
thg 3 22
2593