Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5890 มุมมอง

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



อวตาร
ละทิ้ง

better to make the default view as list,

คำตอบที่ดีที่สุด

Hi,

add 1 param in tree_view_action,

'view_id': self.env.ref('module_name.xml_view_id').id
อวตาร
ละทิ้ง
ผู้เขียน

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

could you find a solution?

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
พ.ค. 22
3512
1
ส.ค. 21
6617
1
ต.ค. 15
3429
0
ก.พ. 23
3736
1
ก.พ. 23
3139