コンテンツへスキップ
メニュー
この質問にフラグが付けられました

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.

アバター
破棄
関連投稿 返信 ビュー 活動
0
2月 25
897
1
3月 21
4738
2
5月 20
3347
3
3月 15
9866
0
3月 25
858