Skip to Content
Menu
This question has been flagged
3 Replies
3274 Views

I am trying to add a reference field to a form view in Odoo 10 (enterprise version). This always results in the error "The requested change caused an error in the view. It could be because a field was deleted, but still used somewhere else." disregards of the models that are referenced, and the field is not created. Adding the same field type to the list view does not give any error. Any ideas?

Avatar
Discard

Please add your code to the question - otherwise we can only guess.

Author

I am currently entering the data through Odoo's web interface. So what I am doing is to create a new field in my model and choose its type, which is "reference" in this case. Then I need to enter the Python expression for the list in the form of (key,Label) pairs. So to give an example lets reference to the already existing models res.partner and product.product. So my expression would be [('res.partner','Partner'),('res.product','Product')]. The field has indeed been created when entering it though the list view, as can be seen from looking up this field in the database, but adding this field to the form view gives above error. Is above expression correct? I did not find any code examples.

Author Best Answer

I am currently entering the data through Odoo's web interface. So what I am doing is to create a new field in my model and choose its type, which is "reference" in this case. Then I need to enter the Python expression for the list in the form of (key,Label) pairs. So to give an example lets reference to the already existing models res.partner and product.product. So my expression would be [('res.partner','Partner'),('res.product','Product')]. The field has indeed been created when entering it though the list view, as can be seen from looking up this field in the database, but adding this field to the form view gives above error. Is above expression correct? I did not find any code examples.

Avatar
Discard
Best Answer

Can you provide us with the code?

Avatar
Discard