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
956 B

  1. # © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com)
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
  3. from odoo import api, models
  4. class IrModelFields(models.Model):
  5. _inherit = 'ir.model.fields'
  6. @api.model
  7. def search(self, args, offset=0, limit=0, order=None, count=False):
  8. model_domain = []
  9. for domain in args:
  10. if (len(domain) > 2 and domain[0] == 'mass_editing_domain' and
  11. isinstance(domain[2], str) and
  12. list(domain[2][1:-1])):
  13. model_domain += [('model_id', 'in',
  14. list(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)