Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5871 Lượt xem

i filled everything in form view after that i am clicking on save button to save the record ,after saving the record view mode should be list view or tree view not form view how to do it?

i tried like this-

 

@api.multi

def tree_view_action(self):

return {

"name": _("Dummy Name"),

'view_mode': 'tree,form',

'view_type': 'form',

"res_model": 'assets.creation',

"type": 'ir.actions.act_window',

"target": "current",

}

----------and this method i called in create method

@api.model

def create(self,vals):

res = super(Equipment,self).create(vals)

res.tree_view_action()

return res



Ảnh đại diện
Huỷ bỏ

better to make the default view as list,

Câu trả lời hay nhất

Hi,

add 1 param in tree_view_action,

'view_id': self.env.ref('module_name.xml_view_id').id
Ảnh đại diện
Huỷ bỏ
Tác giả

Thanku @Sunny ....I tried this but still same problem is there...

could you find a solution?

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 5 22
3493
1
thg 8 21
6588
1
thg 10 15
3422
0
thg 2 23
3722
1
thg 2 23
3124