diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index f552a24de64..3dcd5b550c9 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -53,8 +53,7 @@ class module_category(osv.osv): result = dict(cr.fetchall()) for id in ids: cr.execute('select id from ir_module_category where parent_id=%s', (id,)) - childs = [c for c, in cr.fetchall()] - result[id] = reduce(lambda x,y:x+y, [result.get(c, 0) for c in childs], result.get(id, 0)) + result[id] = reduce(lambda x,y:x+y, [result.get(c, 0) for (c,) in cr.fetchall()], result.get(id, 0)) return result _columns = { diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 2b7fe0ce989..bac069847bc 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1274,7 +1274,7 @@ class orm_template(object): context = {} result = False fields = {} - childs = True + children = True def encode(s): if isinstance(s, unicode): @@ -1328,7 +1328,7 @@ class orm_template(object): if column: relation = self.pool.get(column._obj) - childs = False + children = False views = {} for f in node: if f.tag in ('form', 'tree', 'graph'): @@ -1390,7 +1390,7 @@ class orm_template(object): node.set('sum', trans) for f in node: - if childs or (node.tag == 'field' and f.tag in ('filter','separator')): + if children or (node.tag == 'field' and f.tag in ('filter','separator')): fields.update(self.__view_look_dom(cr, user, f, view_id, context)) return fields @@ -1437,7 +1437,7 @@ class orm_template(object): fields = self.fields_get(cr, user, fields_def.keys(), context) for field in fields_def: if field == 'id': - # sometime, the view may containt the (invisible) field 'id' needed for a domain (when 2 objects have cross references) + # sometime, the view may contain the (invisible) field 'id' needed for a domain (when 2 objects have cross references) fields['id'] = {'readonly': True, 'type': 'integer', 'string': 'ID'} elif field in fields: fields[field].update(fields_def[field]) @@ -2355,8 +2355,7 @@ class orm(orm_template): where += ' order by '+self._parent_order cr.execute('SELECT id FROM '+self._table+' WHERE '+where) pos2 = pos + 1 - childs = cr.fetchall() - for id in childs: + for id in cr.fetchall(): pos2 = browse_rec(id[0], pos2) cr.execute('update '+self._table+' set parent_left=%s, parent_right=%s where id=%s', (pos, pos2, root)) return pos2 + 1 @@ -4154,9 +4153,9 @@ class orm(orm_template): old_record, new_record = self.read(cr, uid, [old_id, new_id], [field_name], context=context) # here we rely on the order of the ids to match the translations # as foreseen in copy_data() - old_childs = sorted(old_record[field_name]) - new_childs = sorted(new_record[field_name]) - for (old_child, new_child) in zip(old_childs, new_childs): + old_children = sorted(old_record[field_name]) + new_children = sorted(new_record[field_name]) + for (old_child, new_child) in zip(old_children, new_children): # recursive copy of translations here target_obj.copy_translations(cr, uid, old_child, new_child, context=context) # and for translatable fields we keep them for copy diff --git a/bin/report/print_xml.py b/bin/report/print_xml.py index f349e10b1ba..3319ee0b558 100644 --- a/bin/report/print_xml.py +++ b/bin/report/print_xml.py @@ -254,7 +254,7 @@ class document(object): for el_cld in node: self.parse_node(el_cld, el, v) else: - # if there is no "type" attribute in the node, copy it to the xml data and parse its childs + # if there is no "type" attribute in the node, copy it to the xml data and parse its children if not node.tag == etree.Comment: if node.tag == parent.tag: el = parent diff --git a/bin/report/render/rml2pdf/trml2pdf.py b/bin/report/render/rml2pdf/trml2pdf.py index 83f1ce498fa..e9969fa4e52 100644 --- a/bin/report/render/rml2pdf/trml2pdf.py +++ b/bin/report/render/rml2pdf/trml2pdf.py @@ -552,8 +552,8 @@ class _rml_flowable(object): return rc1 def _table(self, node): - childs = utils._child_get(node,self,'tr') - if not childs: + children = utils._child_get(node,self,'tr') + if not children: return None length = 0 colwidths = None @@ -561,7 +561,7 @@ class _rml_flowable(object): data = [] styles = [] posy = 0 - for tr in childs: + for tr in children: paraStyle = None if tr.get('style'): st = copy.deepcopy(self.styles.table_styles[tr.get('style')])