Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
5349 Zobrazení

Can I  make only one column of a tree view editable, and when I click on other columns, open the form view?

I  can make only  one  column editable in a tree view, like :

    

    
    


But then I can't open the form view. How can I open the form view when click on readonly field?
Avatar
Zrušit
Nejlepší odpověď

Hello Lai Yiqiang,

Hope you are doing well.

To make only one column of a tree view editable and open the form view while clicking other columns, in base odoo we cannot open form view for readonly fields so the another option that we have to add one button in tree view like below:

in your model:

def open_record(self):
# first you need to get the id of your record
rec_id = self.id
# then you need to get the form id
form_id = self.env.ref('module_name.form_xml_id')

# then open the form
return {
'type': 'ir.actions.act_window',
'name': 'title',
'res_model': 'your.model',
'res_id': rec_id.id,
'view_type': 'form',
'view_mode': 'form',
'view_id': form_id.id,
'context': {},
}

Thanks & Regards,

Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
4
pro 23
20647
2
dub 20
12930
0
dub 17
3317
1
zář 15
3734
3
dub 25
4638