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.

23 lines
927 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 openerp 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)):
  13. model_domain += [('model_id', 'in',
  14. map(int, domain[2][1:-1].split(',')))]
  15. else:
  16. model_domain.append(domain)
  17. return super(IrModelFields, self).search(model_domain, offset=offset,
  18. limit=limit, order=order,
  19. count=count)