Odoo Help

0

Is it possible to change a field with readonly, after pressing a button?

By
Vikram
on 8/27/13, 5:35 AM 1,071 views

i need a option once i click a button, particular field option should be change to readonly in form. Is it possible to change a field with readonly, after pressing a button? Explain me in detail with example.

0

Prakash

--Prakash--
3218
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 8/27/13, 5:50 AM

After Clicking the button Can Update the record State

And set field readonly based on Updated record state

For example,

'name': fields.char('Date', size=64, states={'new': [('readonly', True)]}),

def button_click(self, cr, uid, ids, context=None):
    self.write(cr, uid, ids, {'state': 'new'}, context=context)
    return True

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

0 follower(s)

Stats

Asked: 8/27/13, 5:35 AM
Seen: 1071 times
Last updated: 3/16/15, 8:10 AM