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

Hi everyone,


I would like to add a notification every time that someone use the "Print Quotation" button.

With the notification I would like to have a message like "Quotation Print" and the Quotation on attachment.

I was thinking that I can use something like this (in print_quotation in sale.py)

 body = "Print of a new quotation"
records = self._get_followers(cr, uid, ids, None, None, context=context)
followers = records[ids[0]]['message_follower_ids']
self.message_post(cr, uid, ids, body=body, subtype='mt_comment', partner_ids=followers, context=context)

However, is it possible to add the Quotation printed on attachment?


Thank a lot you for your help.


Selverine

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

You could pass the argument attachments=[('filename', 'file raw data not encoded with base64')] to message_post

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

Excellent! With this logic how can one attach, say, a report?

Hi, Send me the link of the forum post that you are referring to, because seems to be old and Odoo doesn't send me that

On Sat, May 14, 2016 at 11:15 AM, Niklaus Hartmann <n.hartmann-gmail.com@mail.odoo.com> wrote:

Excellent! With this logic how can one attach, say, a report?

--
Niklaus Hartmann

Sent by Odoo S.A. using Odoo

Yes you can do it

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 25
324
2
thg 7 23
6011
5
thg 5 23
15387
2
thg 12 23
5405
1
thg 5 22
2591