Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
3710 Ansichten

I remove active field from hr.employee.

Then i added active & inactive fields in hr.employee. But when i click incative field the employee is not hiding from the employee list/kaban view.

How can i hide a employee from the main list, when i tick inactive checkbox?

Avatar
Verwerfen
Beste Antwort

With the help of onchange you can achieve this. (http://openerp-server.readthedocs.org/en/latest/06_misc_on_change_tips.html)

In XML,
                    <field name="inactive" on_change="on_change_inactive(inactive)" />

In PY file,

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

        return {'value': {'active' : not inactive}}

Avatar
Verwerfen
Beste Antwort

Hello,

the 'active' field is a multi usage field like "state" ,

I think you've to make on_change method that when the user tick the inactive one, set the 'active' field to False ...

Regards..

Avatar
Verwerfen
Autor

From where can i know the details?