I have a custom addon which gives a separate quotation number, however, when I click to send by email, it shows the sale order number, not the quotation number. I need to change the "Sales: Send Quotation" email template, but not sure how to extend the code to the reference number, and also to save the pdf document with the quotation number if it is a quote.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Księgowość
- Zapasy
- PoS
- Project
- MRP
To pytanie dostało ostrzeżenie
Hi,
Here you have to inherit the related email template to make necessary changes to use your new number. Either you can manually edit the email template from the user interface or from your custom module(recommended).
If you activate the developer mode and navigate to Settings -> Technical -> Email -> Email Templates, you can find a template with name Sales Order: Confirmation Email, this is the one you need to modify.
You can click the view meta data and get the external id of the record and inherit it in your custom module, if there is no update set for the record, make sure to bypass it with necessary codes.
You can copy the original email template record as it is in your module and change the id to original_module.id and modify the necessary values in it.
Suppose if the id of original record is mail_template_sale_confirmation and it is added in module sale, you can change the id of record to sale.mail_template_sale_confirmation , on doing this, it will update the existing template values in the db.
Regarding the report name, you have to inherit the report record and change the printed report name to reflect the new value. Follow same approach done for the email template, here also.
Thanks
Thank you for your reply, however, there is no email template in the module (it is Separate Sale Quotation Numberby Sanesquare Technologies)
I can see where I need to edit, there are 3 parts of code I need to update:
In subject line:
{{ object.company_id.name }} {{ object.state in ('draft', 'sent') and (ctx.get('proforma') and 'Proforma' or 'Quotation') or 'Order' }} (Ref {{ object.name or n/a}})
I'm not sure of the syntax after Ref - instead of object name, I need that to be quotation_number or object name depending on state -draft, sent.
and in the report name, code is {{ (object.name or '').replace('/','_') }}, this is where I think it needs to change to quotation_number, instead of object.name?
may be it is using the default email template from sale module, so you have to change in it
Thanks for the information. I fixed it by copying the default template then saving that as the original (so that I have a backup of it), then changing the field in the default template.
Podoba Ci się ta dyskusja? Dołącz do niej!
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
2
kwi 24
|
41 | ||
|
0
gru 23
|
129 | ||
|
0
sie 23
|
1971 | ||
|
2
cze 23
|
3038 | ||
|
3
sie 25
|
2453 |