I want a new many2many field on my project tasks where all contacts when assigned on this field will receive an email.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- 회계
- 재고 관리
- PoS
- Project
- MRP
신고된 질문입니다
- Create a New Many2Many field on the Task that references the contacts (res.partner) model. Let's call this field Contractors
2. Create a new email template for the Contractors that will be used to send out the email. Set the body of the email as you require and then go to the "Email Configuration" tab. Here you would have to reference the new many2many contractor field under the To(Emails) field.
Since its a many2many field, this is how you would reference it:
{{ ','.join(object.x_studio_contractors.mapped('email'))}}
Explanation: Let's say you have three contractors that were added to the task, the above code would look for the email field in each of the contacts assigned in the many2many contractors field and separate them by commas. So Odoo would fetch the emails and post them in the following way: email1,email2,email3
3) Once the email template has been configured, you would have to create an Automation Rule to send out the emails on a trigger.
4) After setting the automation rule, we can test this. I added three contacts to the contractor's field and hit save. Upon hitting save an email was sent out to those contacts that were set:
Note: There is a drawback of this however, let's say we set two contacts first and hit save. This sends the email to those two contacts that were set. Next, we edit it and add another contact on the field. This time Odoo will send an email to three contacts including the first two that were already added so essentially, the first two contacts will receive the email twice.
관련 게시물 | 답글 | 화면 | 활동 | |
---|---|---|---|---|
|
0
10월 24
|
1263 | ||
|
1
9월 24
|
1692 | ||
|
1
9월 25
|
1258 | ||
|
1
9월 25
|
1583 | ||
|
0
8월 23
|
2635 |