diff --git a/openerp/addons/base/ir/ir_model.py b/openerp/addons/base/ir/ir_model.py index fcf1ee92ebd..7cb0e387710 100644 --- a/openerp/addons/base/ir/ir_model.py +++ b/openerp/addons/base/ir/ir_model.py @@ -514,7 +514,7 @@ class ir_model_constraint(Model): # double-check we are really going to delete all the owners of this schema element cr.execute("""SELECT id from ir_model_constraint where name=%s""", (data.name,)) external_ids = [x[0] for x in cr.fetchall()] - if (set(external_ids)-ids_set): + if set(external_ids)-ids_set: # as installed modules have defined this element we must not delete it! continue @@ -573,7 +573,7 @@ class ir_model_relation(Model): # double-check we are really going to delete all the owners of this schema element cr.execute("""SELECT id from ir_model_relation where name = %s""", (data.name,)) external_ids = [x[0] for x in cr.fetchall()] - if (set(external_ids)-ids_set): + if set(external_ids)-ids_set: # as installed modules have defined this element we must not delete it! continue @@ -585,7 +585,7 @@ class ir_model_relation(Model): # drop m2m relation tables for table in to_drop_table: - cr.execute('DROP TABLE %s CASCADE'% (table),) + cr.execute('DROP TABLE %s CASCADE'% table,) _logger.info('Dropped table %s', table) cr.commit() @@ -862,7 +862,7 @@ class ir_model_data(osv.osv): res = self.read(cr, uid, data_id, ['model', 'res_id']) if not res['res_id']: raise ValueError('No such external ID currently defined in the system: %s.%s' % (module, xml_id)) - return (res['model'], res['res_id']) + return res['model'], res['res_id'] def get_object(self, cr, uid, module, xml_id, context=None): """Returns a browsable record for the given module name and xml_id or raise ValueError if not found""" @@ -903,7 +903,7 @@ class ir_model_data(osv.osv): # records created during module install should not display the messages of OpenChatter context = dict(context, install_mode=True) if xml_id and ('.' in xml_id): - assert len(xml_id.split('.'))==2, _("'%s' contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id") % (xml_id) + assert len(xml_id.split('.'))==2, _("'%s' contains too many dots. XML ids should not contain dots ! These are used to refer to other modules data, as in module.reference_id") % xml_id module, xml_id = xml_id.split('.') if (not xml_id) and (not self.doinit): return False diff --git a/openerp/addons/base/ir/ir_translation.py b/openerp/addons/base/ir/ir_translation.py index f3985045fb2..f9983b5878b 100644 --- a/openerp/addons/base/ir/ir_translation.py +++ b/openerp/addons/base/ir/ir_translation.py @@ -134,7 +134,7 @@ class ir_translation_import_cursor(object): """ % (self._parent_table, self._table_name, self._parent_table, find_expr)) if self._debug: - cr.execute('SELECT COUNT(*) FROM ONLY %s' % (self._parent_table)) + cr.execute('SELECT COUNT(*) FROM ONLY %s' % self._parent_table) c1 = cr.fetchone()[0] cr.execute('SELECT COUNT(*) FROM ONLY %s AS irt, %s AS ti WHERE %s' % \ (self._parent_table, self._table_name, find_expr)) diff --git a/openerp/addons/base/ir/workflow/print_instance.py b/openerp/addons/base/ir/workflow/print_instance.py index c9f1dc1c97e..2ac677b194e 100644 --- a/openerp/addons/base/ir/workflow/print_instance.py +++ b/openerp/addons/base/ir/workflow/print_instance.py @@ -101,11 +101,11 @@ def graph_get(cr, graph, wkf_ids, nested, workitem, processed_subflows): start = cr.fetchone()[0] cr.execute("select 'subflow.'||name,id from wkf_activity where flow_stop=True and wkf_id in ("+','.join(['%s']*len(wkf_ids))+')', wkf_ids) stop = cr.fetchall() - if (stop): + if stop: stop = (stop[0][1], dict(stop)) else: stop = ("stop",{}) - return ((start,{}),stop) + return (start, {}), stop def graph_instance_get(cr, graph, inst_id, nested=False): @@ -208,13 +208,13 @@ class report_graph(report.interface.report_int): def result(self): if self.obj.is_done(): - return (True, self.obj.get(), 'pdf') + return True, self.obj.get(), 'pdf' else: - return (False, False, False) + return False, False, False def create(self, cr, uid, ids, data, context=None): self.obj = report_graph_instance(cr, uid, ids, data) - return (self.obj.get(), 'pdf') + return self.obj.get(), 'pdf' report_graph('report.workflow.instance.graph', 'ir.workflow') diff --git a/openerp/addons/base/res/res_config.py b/openerp/addons/base/res/res_config.py index 1aa108c14d2..98c5ca7e6af 100644 --- a/openerp/addons/base/res/res_config.py +++ b/openerp/addons/base/res/res_config.py @@ -309,7 +309,7 @@ class res_config_installer(osv.osv_memory): hooks_results = set() for module in base: - hook = getattr(self, '_if_%s'%(module), None) + hook = getattr(self, '_if_%s'% module, None) if hook: hooks_results.update(hook(cr, uid, ids, context=None) or set()) diff --git a/openerp/addons/base/res/res_currency.py b/openerp/addons/base/res/res_currency.py index c1f4bd0b5c3..a95ac454057 100644 --- a/openerp/addons/base/res/res_currency.py +++ b/openerp/addons/base/res/res_currency.py @@ -99,7 +99,7 @@ class res_currency(osv.osv): res = super(res_currency, self).read(cr, user, ids, fields, context, load) currency_rate_obj = self.pool.get('res.currency.rate') values = res - if not isinstance(values, (list)): + if not isinstance(values, list): values = [values] for r in values: if r.__contains__('rate_ids'): @@ -217,7 +217,7 @@ class res_currency(osv.osv): if round: return self.round(cr, uid, to_currency, from_amount * rate) else: - return (from_amount * rate) + return from_amount * rate res_currency() diff --git a/openerp/addons/base/res/res_lang.py b/openerp/addons/base/res/res_lang.py index 6c62877a89a..5f39a7cb703 100644 --- a/openerp/addons/base/res/res_lang.py +++ b/openerp/addons/base/res/res_lang.py @@ -168,7 +168,7 @@ class lang(osv.osv): thousands_sep = lang_obj.thousands_sep or conv[monetary and 'mon_thousands_sep' or 'thousands_sep'] decimal_point = lang_obj.decimal_point grouping = lang_obj.grouping - return (grouping, thousands_sep, decimal_point) + return grouping, thousands_sep, decimal_point def write(self, cr, uid, ids, vals, context=None): for lang_id in ids : @@ -231,7 +231,7 @@ lang() def original_group(s, grouping, thousands_sep=''): if not grouping: - return (s, 0) + return s, 0 result = "" seps = 0 diff --git a/openerp/addons/base/res/res_partner.py b/openerp/addons/base/res/res_partner.py index 07dba6b0d32..e44f6340fc8 100644 --- a/openerp/addons/base/res/res_partner.py +++ b/openerp/addons/base/res/res_partner.py @@ -309,7 +309,7 @@ class res_partner(osv.osv, format_address): if default is None: default = {} name = self.read(cr, uid, [id], ['name'], context)[0]['name'] - default.update({'name': _('%s (copy)') % (name)}) + default.update({'name': _('%s (copy)') % name}) return super(res_partner, self).copy(cr, uid, id, default, context) def onchange_type(self, cr, uid, ids, is_company, context=None): @@ -519,7 +519,7 @@ class res_partner(osv.osv, format_address): def view_header_get(self, cr, uid, view_id, view_type, context): res = super(res_partner, self).view_header_get(cr, uid, view_id, view_type, context) if res: return res - if (not context.get('category_id', False)): + if not context.get('category_id', False): return False return _('Partners: ')+self.pool.get('res.partner.category').browse(cr, uid, context['category_id'], context).name diff --git a/openerp/addons/base/res/res_request.py b/openerp/addons/base/res/res_request.py index b1e3bf88505..25db0e43b2e 100644 --- a/openerp/addons/base/res/res_request.py +++ b/openerp/addons/base/res/res_request.py @@ -58,7 +58,7 @@ class res_request(osv.osv): ids = map(lambda x:x[0], cr.fetchall()) cr.execute('select id from res_request where act_from=%s and (act_to<>%s) and (trigger_date<=%s or trigger_date is null) and active=True and state != %s', (uid,uid,time.strftime('%Y-%m-%d'), 'closed')) ids2 = map(lambda x:x[0], cr.fetchall()) - return (ids, ids2) + return ids, ids2 _columns = { 'create_date': fields.datetime('Created Date', readonly=True), diff --git a/openerp/addons/base_quality_interrogation.py b/openerp/addons/base_quality_interrogation.py index a1b03b894e6..e89d2206e1f 100755 --- a/openerp/addons/base_quality_interrogation.py +++ b/openerp/addons/base_quality_interrogation.py @@ -68,10 +68,10 @@ def execute(connector, method, *args): except socket.error,e: if e.args[0] == 111: if wait_count > wait_limit: - print "Server is taking too long to start, it has exceeded the maximum limit of %d seconds."%(wait_limit) + print "Server is taking too long to start, it has exceeded the maximum limit of %d seconds." % wait_limit clean() sys.exit(1) - print 'Please wait %d sec to start server....'%(waittime) + print 'Please wait %d sec to start server....' % waittime wait_count += 1 time.sleep(waittime) res = execute(connector, method, *args) @@ -137,7 +137,7 @@ def check_quality(uri, user, pwd, dbname, modules, quality_logs): detail_html +='''