'when a route is deactivated, deactivate also its pull and push rules'

@api.multi
def write(self, values):

    res = super(Route, self).write(values)
    if ('active' in values):
        self.mapped('push_ids').filtered((lambda path: (path.active != values['active']))).write({'active': values['active']})
        self.mapped('pull_ids').filtered((lambda rule: (rule.active != values['active']))).write({'active': values['active']})
    return res
