From 9e24c6fc35b23ee5b9f791b5ea7b2450d346492e Mon Sep 17 00:00:00 2001 From: oihane Date: Mon, 4 Aug 2014 09:48:36 +0200 Subject: [PATCH] [MOD] Splitted mass_editing.py into two files --- mass_editing/models/__init__.py | 3 +- mass_editing/models/ir_model_fields.py | 42 +++++++++++++++++++ .../{mass_editing.py => mass_object.py} | 19 --------- 3 files changed, 44 insertions(+), 20 deletions(-) create mode 100644 mass_editing/models/ir_model_fields.py rename mass_editing/models/{mass_editing.py => mass_object.py} (88%) diff --git a/mass_editing/models/__init__.py b/mass_editing/models/__init__.py index c6f9baf33..64fd501ae 100644 --- a/mass_editing/models/__init__.py +++ b/mass_editing/models/__init__.py @@ -20,4 +20,5 @@ # ############################################################################## -from . import mass_editing +from . import ir_model_fields +from . import mass_object diff --git a/mass_editing/models/ir_model_fields.py b/mass_editing/models/ir_model_fields.py new file mode 100644 index 000000000..725791083 --- /dev/null +++ b/mass_editing/models/ir_model_fields.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# This module uses OpenERP, Open Source Management Solution Framework. +# Copyright (C): +# 2012-Today Serpent Consulting Services () +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# +############################################################################## + +from openerp.osv import orm + + +class IrModelFields(orm.Model): + _inherit = 'ir.model.fields' + + def search( + self, cr, uid, args, offset=0, limit=0, order=None, context=None, + count=False): + model_domain = [] + for domain in args: + if domain[0] == 'model_id' and domain[2]\ + and type(domain[2]) != list: + model_domain += [( + 'model_id', 'in', map(int, domain[2][1:-1].split(',')))] + else: + model_domain.append(domain) + return super(IrModelFields, self).search( + cr, uid, model_domain, offset=offset, limit=limit, order=order, + context=context, count=count) diff --git a/mass_editing/models/mass_editing.py b/mass_editing/models/mass_object.py similarity index 88% rename from mass_editing/models/mass_editing.py rename to mass_editing/models/mass_object.py index 053ddf77f..8e7737d25 100644 --- a/mass_editing/models/mass_editing.py +++ b/mass_editing/models/mass_object.py @@ -25,25 +25,6 @@ from openerp.osv import orm, fields from openerp.tools.translate import _ -class IrModelFields(orm.Model): - _inherit = 'ir.model.fields' - - def search( - self, cr, uid, args, offset=0, limit=0, order=None, context=None, - count=False): - model_domain = [] - for domain in args: - if domain[0] == 'model_id' and domain[2]\ - and type(domain[2]) != list: - model_domain += [( - 'model_id', 'in', map(int, domain[2][1:-1].split(',')))] - else: - model_domain.append(domain) - return super(IrModelFields, self).search( - cr, uid, model_domain, offset=offset, limit=limit, order=order, - context=context, count=count) - - class MassObject(orm.Model): _name = "mass.object"