- def match_rule(self, cr, uid, channel_id, word, context=None):
- """ determine if a rule of the given channel match with the given word """
- rule_ids = self.search(cr, uid, [('channel_id', '=', channel_id)], context=context)
+ _order = "sequence asc"
+
+ def match_rule(self, cr, uid, channel_id, url, country_id=False, context=None):
+ """ determine if a rule of the given channel match with the given url """
+ domain = [('channel_id', '=', channel_id)]
+ if country_id: # don't include the country in the research if geoIP is not installed
+ domain.append(('country_ids', 'in', country_id))
+ rule_ids = self.search(cr, uid, domain, context=context)