Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
3653 Переглядів

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?

Аватар
Відмінити
Найкраща відповідь

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}}

Аватар
Відмінити
Найкраща відповідь

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

Аватар
Відмінити
Автор

From where can i know the details?