skilld-labs / go-odoo

Golang wrapper for Odoo API
Apache License 2.0
86 stars 62 forks source link

How I can use args with ExecuteKw #27

Closed m-abdalrahman closed 3 years ago

m-abdalrahman commented 3 years ago

I'm trying to attach a file with message_post using ExecuteKw, but I don't know how to add the id to attachment_ids

c.ExecuteKw("message_post", AccountInvoiceModle, []interface{}{inv.ID, ?}, nil)

ahuret commented 3 years ago

according to the doc you could try something like

c.ExecuteKw("method_post", AccountInvoiceModle, []interface{}{
    "here the body !",
    "here the message type",
    parent_id,
    [][]string{
        []string{"attachmentname1", "attachmentcontent1"}, 
        []string{"attachmentname2", "attachmentcontent2"},
    },
}, options)

Tell me if that help !

Btw you could contribute to go-odoo by adding high level method MessagePost, would be cool ! I can help you with that too ! Let me know :-)

ahuret commented 3 years ago

I'm closing this. Please reopen if you have issues related to this thread.