diff --git a/__unported__/users_ldap_groups/users_ldap_groups.py b/__unported__/users_ldap_groups/users_ldap_groups.py index 9aaa1e71b..bca79a05a 100644 --- a/__unported__/users_ldap_groups/users_ldap_groups.py +++ b/__unported__/users_ldap_groups/users_ldap_groups.py @@ -34,8 +34,9 @@ class CompanyLDAPGroupMapping(orm.Model): operators = [] members = inspect.getmembers( users_ldap_groups_operators, - lambda cls: inspect.isclass(cls) - and cls != users_ldap_groups_operators.LDAPOperator) + lambda cls: + inspect.isclass(cls) and + cls != users_ldap_groups_operators.LDAPOperator) for name, operator in members: operators.append((name, name)) return tuple(operators) diff --git a/database_cleanup/model/purge_columns.py b/database_cleanup/model/purge_columns.py index 60b56ccc8..abcf1d2d4 100644 --- a/database_cleanup/model/purge_columns.py +++ b/database_cleanup/model/purge_columns.py @@ -96,8 +96,9 @@ class CleanupPurgeWizardColumn(orm.TransientModel): columns = list(set([ column for model_pool in model_pools for column in model_pool._columns - if not (isinstance(model_pool._columns[column], fields.function) - and not model_pool._columns[column].store) + if not (isinstance(model_pool._columns[column], + fields.function) and + not model_pool._columns[column].store) ])) columns += orm.MAGIC_COLUMNS columns += self.blacklist.get(model_pools[0]._table, []) diff --git a/database_cleanup/model/purge_tables.py b/database_cleanup/model/purge_tables.py index 8d9c86544..50bf3d8e6 100644 --- a/database_cleanup/model/purge_tables.py +++ b/database_cleanup/model/purge_tables.py @@ -110,9 +110,9 @@ class CleanupPurgeWizardTable(orm.TransientModel): known_tables += [ column._sql_names(model_pool)[0] for column in model_pool._columns.values() - if column._type == 'many2many' - # unstored function fields of type m2m don't have _rel - and hasattr(column, '_rel') + if (column._type == 'many2many' and + hasattr(column, '_rel')) # unstored function fields of + # type m2m don't have _rel ] # Cannot pass table names as a psycopg argument diff --git a/mass_editing/models/ir_model_fields.py b/mass_editing/models/ir_model_fields.py index d75e7f60d..b1413fe0d 100644 --- a/mass_editing/models/ir_model_fields.py +++ b/mass_editing/models/ir_model_fields.py @@ -31,8 +31,9 @@ class IrModelFields(orm.Model): count=False): model_domain = [] for domain in args: - if (len(domain) > 2 and domain[0] == 'model_id' - and isinstance(domain[2], basestring)): + if (len(domain) > 2 and + domain[0] == 'model_id' and + isinstance(domain[2], basestring)): model_domain += [ ('model_id', 'in', map(int, domain[2][1:-1].split(','))) ] diff --git a/mass_editing/models/mass_object.py b/mass_editing/models/mass_object.py index 0df2937c3..d859ea776 100644 --- a/mass_editing/models/mass_object.py +++ b/mass_editing/models/mass_object.py @@ -93,8 +93,8 @@ class MassObject(orm.Model): 'model': src_obj, 'key2': 'client_action_multi', 'value': ( - "ir.actions.act_window," - + str(vals['ref_ir_act_window'])), + "ir.actions.act_window," + + str(vals['ref_ir_act_window'])), 'object': True, }, context) diff --git a/mass_editing/wizard/mass_editing_wizard.py b/mass_editing/wizard/mass_editing_wizard.py index e593bf876..b266d3420 100644 --- a/mass_editing/wizard/mass_editing_wizard.py +++ b/mass_editing/wizard/mass_editing_wizard.py @@ -67,8 +67,8 @@ class MassEditingWizard(orm.TransientModel): etree.SubElement(xml_group, 'field', { 'name': field.name, 'colspan': '4', 'nolabel': '1', 'attrs': ( - "{'invisible':[('selection__" - + field.name + "','=','remove_m2m')]}")}) + "{'invisible':[('selection__" + + field.name + "','=','remove_m2m')]}")}) elif field.ttype == "one2many": all_fields["selection__" + field.name] = { 'type': 'selection', @@ -82,8 +82,8 @@ class MassEditingWizard(orm.TransientModel): etree.SubElement(xml_group, 'field', { 'name': field.name, 'colspan': '4', 'nolabel': '1', 'attrs': ( - "{'invisible':[('selection__" - + field.name + "','=','remove_o2m')]}")}) + "{'invisible':[('selection__" + + field.name + "','=','remove_o2m')]}")}) elif field.ttype == "many2one": all_fields["selection__" + field.name] = { 'type': 'selection', @@ -97,8 +97,8 @@ class MassEditingWizard(orm.TransientModel): etree.SubElement(xml_group, 'field', { 'name': field.name, 'nolabel': '1', 'colspan': '2', 'attrs': ( - "{'invisible':[('selection__" - + field.name + "','=','remove')]}")}) + "{'invisible':[('selection__" + + field.name + "','=','remove')]}")}) elif field.ttype == "char": all_fields["selection__" + field.name] = { 'type': 'selection', @@ -114,8 +114,8 @@ class MassEditingWizard(orm.TransientModel): etree.SubElement(xml_group, 'field', { 'name': field.name, 'nolabel': '1', 'attrs': ( - "{'invisible':[('selection__" - + field.name + "','=','remove')]}"), + "{'invisible':[('selection__" + + field.name + "','=','remove')]}"), 'colspan': '2'}) elif field.ttype == 'selection': all_fields["selection__" + field.name] = { @@ -127,8 +127,8 @@ class MassEditingWizard(orm.TransientModel): etree.SubElement(xml_group, 'field', { 'name': field.name, 'nolabel': '1', 'colspan': '2', 'attrs': ( - "{'invisible':[('selection__" - + field.name + "','=','remove')]}")}) + "{'invisible':[('selection__" + + field.name + "','=','remove')]}")}) all_fields[field.name] = { 'type': field.ttype, 'string': field.field_description, @@ -152,8 +152,8 @@ class MassEditingWizard(orm.TransientModel): etree.SubElement(xml_group, 'field', { 'name': field.name, 'colspan': '4', 'nolabel': '1', 'attrs': ( - "{'invisible':[('selection__" - + field.name + "','=','remove')]}")}) + "{'invisible':[('selection__" + + field.name + "','=','remove')]}")}) else: all_fields["selection__" + field.name] = { 'type': 'selection', @@ -166,8 +166,8 @@ class MassEditingWizard(orm.TransientModel): etree.SubElement(xml_group, 'field', { 'name': field.name, 'nolabel': '1', 'attrs': ( - "{'invisible':[('selection__" - + field.name + "','=','remove')]}"), + "{'invisible':[('selection__" + + field.name + "','=','remove')]}"), 'colspan': '2', }) etree.SubElement( xml_form, 'separator', {'string': '', 'colspan': '4'}) diff --git a/server_environment/serv_config.py b/server_environment/serv_config.py index 1645e700c..9ce642977 100644 --- a/server_environment/serv_config.py +++ b/server_environment/serv_config.py @@ -108,7 +108,8 @@ class _Defaults(dict): __slots__ = () def __setitem__(self, key, value): - func = lambda *a: str(value) + def func(*a): + return str(value) return dict.__setitem__(self, key, func)