Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3966 Ansichten

Hi guys,

suppose i have two objects ( b.Load & b.Purchase ) and each one has its chatter.

when i select an attachment, it is displayed in the chatter of the object b.load.
Then i click on "Validate" and the record is created in b.purchase via self.env['b.purchase'].create(..).

What i need is when i click on this record, the attachment must have already been displayed in its chatter ( the chatter of this record in the second object.

in b.load, i have this :

self.env['bi.charges'].browse(self.env.context.get('active_id')).\
message_post(body,
subject=subject.encode('utf-8'),
attachment_ids=[x.id for x in self.piece_justif],)

in b.purchase, i tried this but nothing happens : 

subject = ".."       

body = ".."

self.message_post(subject=subject.encode('utf-8'),
body=body.encode('utf-8'),
type="notification",
attachment_ids=[x.id for x in self.env['b.load'].browse(self.env.context.get('attachment_ids'))],)
Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
3
Juli 21
10722
1
Mai 16
6527
1
Dez. 23
4902
0
März 22
1537
1
Feb. 25
1537