Odoo Help


How to Invisible Field ?

on 4/4/15, 5:53 AM 811 views

Hi, i want to question.

I have problem, i will invisible field 'place' in form 'student' when the state become 'aplikan'.

this is code in form(object) :

class student(osv.osv):

_columns = {

'number_aplikan': fields.char('No Aplikan'),  

'full_name': fields.char('Full Name'), 

'place': fields.char('Tempat Lahir'),


def proses_aplikan(self, cr, uid, ids, context=None):

self.write(cr, uid, ids,{'state':'aplikan'})

a = self.browse(cr, uid, ids,{ 'state':'aplikan', })

if a:

'place' == False,

def create(self, cr, uid, vals, context=None):    

obj = self.pool.get('gelombang.pendaftaran').browse(cr, uid, vals['tahun_akademik_id']).name.name.tahun  

seq_name = 'A/{0}'.format(obj)

seq = self.pool.get('ir.sequence')

ids = seq.search(cr, uid, [('name','=',seq_name)])

if not ids:

prefix = seq_name

ids = seq.create(cr, uid, {


'prefix': prefix,

'padding': 4,

'implementation': 'no_gap',


vals['name'] = seq.get_id(cr,uid,ids)

res = super(student, self).create(cr, uid, vals, context=context)

self.proses_aplikan(cr, uid, [res])

return res

i hope you give me idea, for invisible field 'place' in form 'student' when state become 'aplikan' ...

thanks in advance.


where you define your 'state' field ?

Ajeng Shilvie
on 4/4/15, 6:02 AM

hmm, my problem it's work Jeng . with use code thanks with your respon ...

on 4/4/15, 10:21 PM
--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 4/4/15, 8:03 AM


in xml use:

<field name="place" attrs="{'invisible': [('state','=','aplikan')]}"/>


yes, it's work Ahmed . thank you very much Ahmed ...

on 4/4/15, 9:39 AM

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

1 follower(s)


Asked: 4/4/15, 5:53 AM
Seen: 811 times
Last updated: 4/4/15, 10:21 PM