# coding: utf-8 from odoo import api, models class IrRule(models.Model): _inherit = 'ir.rule' @api.model def _eval_context(self): res = super(IrRule, self)._eval_context() res['website_id'] = self.env['website'].get_current_website().id return res def _compute_domain_keys(self): """ Return the list of context keys to use for caching ``_compute_domain``. """ return super(IrRule, self)._compute_domain_keys() + ['website_id']