working for Approvals, i have created an Automation Rule which works fine to generate Internal Transfer records, please refer to my previous topic below:
now i want to add a link in Chatter to open Internal Transfer form view for newly created record, like odoo system does this for Inventory, for example.
how i can do this? please help.
regards
The easiest way is to let odoo create the message on the desired record. You need both the origin record and the destination record. Models are irrelevant in this case, except for one condition: the model which will get the message needs the chatter (
mail.thread
mixin).An example can be found in Odoo's invoice creation from sales order here
move
is the created invoice. In this caseorigin
will be retrieved by the line ids order line relation.Odoo uses a default QWeb template to fill the body of the message. You can also define you're own and use it in
message_post_with_source()
.To conclude this answer in regards of your other linked question (with your own answer) it should look like this:
Because you're linking on the creating record (approval) to the created record (picking/transfer), the used QWeb template
mail.message_origin_link
probably is not the best fit.