server-ux/mass_editing/models/ir_model_fields.py
2021-03-23 20:38:33 +01:00

24 lines
959 B
Python

# © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from flectra import api, models
class IrModelFields(models.Model):
_inherit = 'ir.model.fields'
@api.model
def search(self, args, offset=0, limit=0, order=None, count=False):
model_domain = []
for domain in args:
if (len(domain) > 2 and domain[0] == 'mass_editing_domain' and
isinstance(domain[2], str) and
list(domain[2][1:-1])):
model_domain += [('model_id', 'in',
list(map(int, domain[2][1:-1].split(','))))]
else:
model_domain.append(domain)
return super(IrModelFields, self).search(model_domain, offset=offset,
limit=limit, order=order,
count=count)