Odoo Help

0

Two readonly instance of one field in the a form view

By
Sandor Dobi
on 8/12/15, 5:58 AM 820 views

Hi,

I would like to display the same field two times (both times in a readonly way, so it is only for display purposes) in one formview but on different pages in a notebook.


I noticed a strange error/bug/feature: the first instance is displaying the field label but with empty data, the second instance displaying the field without issues. 

In the debug mode I cannot get mouse over tooltip for the first field instance only for the second.

It is a limitation of the view engine or some bug? How can I circumvent this if it is a limitaion?

Regards


1

It's not possible to show "same" field twice in a single form view. Possible ways can be,

1. Don't show that field in notebook pages. Just show it to top of Form view. Just like in Sale order form, Quotation No. field.

2. Make an another field ( kind of field.function ) which will have value of that X.  After that you can use that field Y to another page of notebook. ( Here I would like to mention that this way is not good )

Field "Y" definition in py file can be,

 @api.one
@api.depends( 'X' )
def get_X_name( self ):
if self.X:   
self.Y = self.X
Y = fields.Char( 'AB', compute=get_X_name , store=True )

Hope this helps,

1

Try to create a function field and store to it the value of the original field and then put the original field in the first page and the function field in the other page

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 8/12/15, 5:58 AM
Seen: 820 times
Last updated: 8/12/15, 6:20 AM