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

Hello,

I'm trying to display a form view of a model returned by an action in a menu and display another form view of the same model in a different context ( by clicking on a button) but I'm getting the two different views displayed side by side.

First, I have tried inheriting the first view and used different priorities in, but I was always getting the inherited view displayed even if it has the highest priority.

Second, I have defined different form views of the same model without any inheriting, but I was getting views displayed one over the other.

I need help to display one of the "form" views, each in its appropriate context

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

You can create two separate view and use 1 view for menu with highest priority and

In button return action with form view id as below :

{
'type'
: 'ir.actions.act_window',
'name'
: _('Action Name'),
'res_model'
: 'model name',
'view_mode'
: 'tree, form',
'res_id'
: id of record,     
    'context': context,        
    'views':[(self.env.ref('id of second view').id, 'form')],
}


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
أغسطس 22
5694
2
مارس 23
14723
2
فبراير 23
1876
2
سبتمبر 15
5513
1
مارس 15
3675