How do I attach a product overview (pdf) to the sales order template. I have added the attachment to the relevant product - how do I retrieve the ir.attachment for that product on the email template?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
1
Trả lời
5178
Lượt xem
Hi,
You can attach the pdf to the sale order template like this.
Override this function action_quotation_send()
attachment = self.env.ref(
'Your_module_name.action_name_report',
raise_if_not_found=False)
ctx = {
'default_model': 'sale.order',
'default_res_id': self.ids[0],
'default_use_template': bool(template_id),
'default_template_id': template_id,
'default_composition_mode': 'comment',
'mark_so_as_sent': True,
'default_attachment_ids': attachment.ids,
'custom_layout': "mail.mail_notification_paynow",
'proforma': self.env.context.get('proforma', False),
'force_email': True,
'model_description': self.with_context(lang=lang).type_name,
}
return {
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_model': 'mail.compose.message',
'views': [(False, 'form')],
'view_id': False,
'target': 'new',
'context': ctx,
}
Hope it helps
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
1
thg 9 25
|
1494 | ||
|
0
thg 1 24
|
1587 | ||
|
0
thg 8 23
|
2851 | ||
|
5
thg 5 23
|
15718 | ||
|
1
thg 12 22
|
2483 |
not really clear what you mean? Can it be you want to have the same attached file to show as attachment on a product as well as attachment on a quotation/SO ?
yes that is exactly it. The attachment that gets uploaded on the product, needs to be attached to the quotation/SO.