Odoo Help

Welcome!

This community 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.

0

When readonly=True :======= the data doesn't appear in the screen after save

By
Karan Gupta
on 10/26/16, 3:52 AM 176 views

Why I cant able to store the particular value in the grid table after making that field as readonly

Since I gave that field as store=True

Thanks,,, ayman mohammed adam

Karan Gupta
on 10/26/16, 6:56 AM
1

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 10/27/16, 2:05 AM

You want the field to be Readonly, but trying to add value through Onchange or so, then you need to under-go hassle of updating for the same again in the Create/Write ORM methods.

Instead the feasible alternate solution would be you to use Compute/functional fields.

Api decorator lets you add depends(dependency) field, which acts as both onchange and computational method, that way you don't have to worry about manually re-updating the same in ORM methods.


Note:

If a field is marked as Readonly, odoo will explicitly omit retrieving data for the same from UI, hence in such case its best to use computational/related fields.


0
Karan Gupta
On 10/26/16, 6:55 AM

 

0
ayman mohammed adam
On 10/26/16, 6:37 AM

dear Karan Gupta

you need to override create and write method and assign the value again by calling your onchange function and then update the vals.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 10/26/16, 3:52 AM
Seen: 176 times
Last updated: 10/27/16, 2:05 AM