You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
970 B

  1. # -*- coding: utf-8 -*-
  2. # © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  4. from odoo import api, models
  5. class IrModelFields(models.Model):
  6. _inherit = 'ir.model.fields'
  7. @api.model
  8. def search(self, args, offset=0, limit=0, order=None, count=False):
  9. model_domain = []
  10. for domain in args:
  11. if (len(domain) > 2 and domain[0] == 'model_id' and
  12. isinstance(domain[2], basestring) and
  13. list(domain[2][1:-1])):
  14. model_domain += [('model_id', 'in',
  15. map(int, domain[2][1:-1].split(',')))]
  16. else:
  17. model_domain.append(domain)
  18. return super(IrModelFields, self).search(model_domain, offset=offset,
  19. limit=limit, order=order,
  20. count=count)