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

How to Invisible Field ?

By
heru
on 4/4/15, 5:53 AM 431 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, {

'name':seq_name,

'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 ...

heru
on 4/4/15, 10:21 PM
1

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


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

Hi,

in xml use:

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


Regards

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

heru
on 4/4/15, 9:39 AM

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: 4/4/15, 5:53 AM
Seen: 431 times
Last updated: 4/4/15, 10:21 PM