تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
4650 أدوات العرض

I understand how a button calls a method defined on a model


But what should I write in the method to open a specific view ?

Could I see any example ?

Thanks

الصورة الرمزية
إهمال
أفضل إجابة

Hi ,

Refer this to open form view on a button click

def action_view_invoice(self):
return {
'name': _('Customer Invoice'),
'view_mode': 'form',
'view_id': self.env.ref('account.view_move_form').id,
'res_model': 'account.move',
'context': "{'move_type':'out_invoice'}",
'type': 'ir.actions.act_window',
'res_id': self.account_move.id,
}


الصورة الرمزية
إهمال
الكاتب أفضل إجابة

Thank you, Kiran and Niyas


Appreciated


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أكتوبر 19
3129
2
يوليو 15
6623
2
يناير 20
5759
3
مارس 15
10432
1
نوفمبر 18
19300