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

  1. # Copyright 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. [int(x) for x in domain[2][1:-1].split(',')]
  15. )]
  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)