Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd

Hello, 

I added a button to a form views dynamically and i'm trying to add a action function to that button dynamically.

This function need to be added to specific model.

this is an example of the function i want to run dynamically without writing this explicit code

def action_open_agreement(self):
self.ensure_one()
action = self.env.ref("agreement.agreement_action")
result = action.read()[0]
result["domain"] = [(self.res.field_name, "=", self.id)]
result["context"] = {
"default_" + self.res.field_name: self.id,
}
return result

  

if anyone already worked on this issue and can help, please leave a comment.

thank you.

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
feb. 25
906
1
mrt. 21
4751
2
mei 20
3350
3
mrt. 15
9876
0
mrt. 25
863