Odoo Help


Display value, but no need to store in database [Closed]

on 4/2/13, 8:20 AM 1,986 views

The Question has been closed

on 04/23/2013 12:50:57

In the process of modifying the interface of OE7, I run into the following issue:

I need to change sale.order.line, so that the price is readonly (and stored in the database afterwards).

When setting the option readonly=1 in the XML-file causes the field NOT to use the field when storing the entry (known feature/bug, see other questions on this forum). So I thought about creating a field on the screen, which is NOT in the database, and setting invisible=1 on the field from the screen. I also need to modify the related on_change method to fill the additional field.

My question is, how to I specify a field on a screen, when there is no corresponding database field? Or is this impossible?


Francesco OpenCode

--Francesco OpenCode--

| 6 8 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 4/2/13, 8:32 AM

In this case you must function field with parameter store = False. This mean that the field will be calculate on fly every time you see it but it has not relative field in database.

You mean defining a field in the .py file, and use this additional field to show something as readonly?

on 4/2/13, 8:46 AM

If you set a field as readonly, when you use the on_change to set its value, openerp doesn't save it. I think that if you need to show only a value, you can use a function field with store = False.

Francesco OpenCode
on 4/2/13, 8:54 AM

I managed to get it working. Thank you.

on 4/23/13, 12:50 PM

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.


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

0 follower(s)


Asked: 4/2/13, 8:20 AM
Seen: 1986 times
Last updated: 3/16/15, 8:10 AM