跳至内容
菜单
此问题已终结
2 回复
3640 查看

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?