fix pep8 W503
parent
d0f1e0e067
commit
3f6bf8eaea
|
@ -34,8 +34,9 @@ class CompanyLDAPGroupMapping(orm.Model):
|
||||||
operators = []
|
operators = []
|
||||||
members = inspect.getmembers(
|
members = inspect.getmembers(
|
||||||
users_ldap_groups_operators,
|
users_ldap_groups_operators,
|
||||||
lambda cls: inspect.isclass(cls)
|
lambda cls:
|
||||||
and cls != users_ldap_groups_operators.LDAPOperator)
|
inspect.isclass(cls) and
|
||||||
|
cls != users_ldap_groups_operators.LDAPOperator)
|
||||||
for name, operator in members:
|
for name, operator in members:
|
||||||
operators.append((name, name))
|
operators.append((name, name))
|
||||||
return tuple(operators)
|
return tuple(operators)
|
||||||
|
|
|
@ -96,8 +96,9 @@ class CleanupPurgeWizardColumn(orm.TransientModel):
|
||||||
columns = list(set([
|
columns = list(set([
|
||||||
column for model_pool in model_pools
|
column for model_pool in model_pools
|
||||||
for column in model_pool._columns
|
for column in model_pool._columns
|
||||||
if not (isinstance(model_pool._columns[column], fields.function)
|
if not (isinstance(model_pool._columns[column],
|
||||||
and not model_pool._columns[column].store)
|
fields.function) and
|
||||||
|
not model_pool._columns[column].store)
|
||||||
]))
|
]))
|
||||||
columns += orm.MAGIC_COLUMNS
|
columns += orm.MAGIC_COLUMNS
|
||||||
columns += self.blacklist.get(model_pools[0]._table, [])
|
columns += self.blacklist.get(model_pools[0]._table, [])
|
||||||
|
|
|
@ -110,9 +110,9 @@ class CleanupPurgeWizardTable(orm.TransientModel):
|
||||||
known_tables += [
|
known_tables += [
|
||||||
column._sql_names(model_pool)[0]
|
column._sql_names(model_pool)[0]
|
||||||
for column in model_pool._columns.values()
|
for column in model_pool._columns.values()
|
||||||
if column._type == 'many2many'
|
if (column._type == 'many2many' and
|
||||||
# unstored function fields of type m2m don't have _rel
|
hasattr(column, '_rel')) # unstored function fields of
|
||||||
and hasattr(column, '_rel')
|
# type m2m don't have _rel
|
||||||
]
|
]
|
||||||
|
|
||||||
# Cannot pass table names as a psycopg argument
|
# Cannot pass table names as a psycopg argument
|
||||||
|
|
|
@ -31,8 +31,9 @@ class IrModelFields(orm.Model):
|
||||||
count=False):
|
count=False):
|
||||||
model_domain = []
|
model_domain = []
|
||||||
for domain in args:
|
for domain in args:
|
||||||
if (len(domain) > 2 and domain[0] == 'model_id'
|
if (len(domain) > 2 and
|
||||||
and isinstance(domain[2], basestring)):
|
domain[0] == 'model_id' and
|
||||||
|
isinstance(domain[2], basestring)):
|
||||||
model_domain += [
|
model_domain += [
|
||||||
('model_id', 'in', map(int, domain[2][1:-1].split(',')))
|
('model_id', 'in', map(int, domain[2][1:-1].split(',')))
|
||||||
]
|
]
|
||||||
|
|
|
@ -93,8 +93,8 @@ class MassObject(orm.Model):
|
||||||
'model': src_obj,
|
'model': src_obj,
|
||||||
'key2': 'client_action_multi',
|
'key2': 'client_action_multi',
|
||||||
'value': (
|
'value': (
|
||||||
"ir.actions.act_window,"
|
"ir.actions.act_window," +
|
||||||
+ str(vals['ref_ir_act_window'])),
|
str(vals['ref_ir_act_window'])),
|
||||||
'object': True,
|
'object': True,
|
||||||
},
|
},
|
||||||
context)
|
context)
|
||||||
|
|
|
@ -67,8 +67,8 @@ class MassEditingWizard(orm.TransientModel):
|
||||||
etree.SubElement(xml_group, 'field', {
|
etree.SubElement(xml_group, 'field', {
|
||||||
'name': field.name, 'colspan': '4', 'nolabel': '1',
|
'name': field.name, 'colspan': '4', 'nolabel': '1',
|
||||||
'attrs': (
|
'attrs': (
|
||||||
"{'invisible':[('selection__"
|
"{'invisible':[('selection__" +
|
||||||
+ field.name + "','=','remove_m2m')]}")})
|
field.name + "','=','remove_m2m')]}")})
|
||||||
elif field.ttype == "one2many":
|
elif field.ttype == "one2many":
|
||||||
all_fields["selection__" + field.name] = {
|
all_fields["selection__" + field.name] = {
|
||||||
'type': 'selection',
|
'type': 'selection',
|
||||||
|
@ -82,8 +82,8 @@ class MassEditingWizard(orm.TransientModel):
|
||||||
etree.SubElement(xml_group, 'field', {
|
etree.SubElement(xml_group, 'field', {
|
||||||
'name': field.name, 'colspan': '4', 'nolabel': '1',
|
'name': field.name, 'colspan': '4', 'nolabel': '1',
|
||||||
'attrs': (
|
'attrs': (
|
||||||
"{'invisible':[('selection__"
|
"{'invisible':[('selection__" +
|
||||||
+ field.name + "','=','remove_o2m')]}")})
|
field.name + "','=','remove_o2m')]}")})
|
||||||
elif field.ttype == "many2one":
|
elif field.ttype == "many2one":
|
||||||
all_fields["selection__" + field.name] = {
|
all_fields["selection__" + field.name] = {
|
||||||
'type': 'selection',
|
'type': 'selection',
|
||||||
|
@ -97,8 +97,8 @@ class MassEditingWizard(orm.TransientModel):
|
||||||
etree.SubElement(xml_group, 'field', {
|
etree.SubElement(xml_group, 'field', {
|
||||||
'name': field.name, 'nolabel': '1', 'colspan': '2',
|
'name': field.name, 'nolabel': '1', 'colspan': '2',
|
||||||
'attrs': (
|
'attrs': (
|
||||||
"{'invisible':[('selection__"
|
"{'invisible':[('selection__" +
|
||||||
+ field.name + "','=','remove')]}")})
|
field.name + "','=','remove')]}")})
|
||||||
elif field.ttype == "char":
|
elif field.ttype == "char":
|
||||||
all_fields["selection__" + field.name] = {
|
all_fields["selection__" + field.name] = {
|
||||||
'type': 'selection',
|
'type': 'selection',
|
||||||
|
@ -114,8 +114,8 @@ class MassEditingWizard(orm.TransientModel):
|
||||||
etree.SubElement(xml_group, 'field', {
|
etree.SubElement(xml_group, 'field', {
|
||||||
'name': field.name, 'nolabel': '1',
|
'name': field.name, 'nolabel': '1',
|
||||||
'attrs': (
|
'attrs': (
|
||||||
"{'invisible':[('selection__"
|
"{'invisible':[('selection__" +
|
||||||
+ field.name + "','=','remove')]}"),
|
field.name + "','=','remove')]}"),
|
||||||
'colspan': '2'})
|
'colspan': '2'})
|
||||||
elif field.ttype == 'selection':
|
elif field.ttype == 'selection':
|
||||||
all_fields["selection__" + field.name] = {
|
all_fields["selection__" + field.name] = {
|
||||||
|
@ -127,8 +127,8 @@ class MassEditingWizard(orm.TransientModel):
|
||||||
etree.SubElement(xml_group, 'field', {
|
etree.SubElement(xml_group, 'field', {
|
||||||
'name': field.name, 'nolabel': '1', 'colspan': '2',
|
'name': field.name, 'nolabel': '1', 'colspan': '2',
|
||||||
'attrs': (
|
'attrs': (
|
||||||
"{'invisible':[('selection__"
|
"{'invisible':[('selection__" +
|
||||||
+ field.name + "','=','remove')]}")})
|
field.name + "','=','remove')]}")})
|
||||||
all_fields[field.name] = {
|
all_fields[field.name] = {
|
||||||
'type': field.ttype,
|
'type': field.ttype,
|
||||||
'string': field.field_description,
|
'string': field.field_description,
|
||||||
|
@ -152,8 +152,8 @@ class MassEditingWizard(orm.TransientModel):
|
||||||
etree.SubElement(xml_group, 'field', {
|
etree.SubElement(xml_group, 'field', {
|
||||||
'name': field.name, 'colspan': '4', 'nolabel': '1',
|
'name': field.name, 'colspan': '4', 'nolabel': '1',
|
||||||
'attrs': (
|
'attrs': (
|
||||||
"{'invisible':[('selection__"
|
"{'invisible':[('selection__" +
|
||||||
+ field.name + "','=','remove')]}")})
|
field.name + "','=','remove')]}")})
|
||||||
else:
|
else:
|
||||||
all_fields["selection__" + field.name] = {
|
all_fields["selection__" + field.name] = {
|
||||||
'type': 'selection',
|
'type': 'selection',
|
||||||
|
@ -166,8 +166,8 @@ class MassEditingWizard(orm.TransientModel):
|
||||||
etree.SubElement(xml_group, 'field', {
|
etree.SubElement(xml_group, 'field', {
|
||||||
'name': field.name, 'nolabel': '1',
|
'name': field.name, 'nolabel': '1',
|
||||||
'attrs': (
|
'attrs': (
|
||||||
"{'invisible':[('selection__"
|
"{'invisible':[('selection__" +
|
||||||
+ field.name + "','=','remove')]}"),
|
field.name + "','=','remove')]}"),
|
||||||
'colspan': '2', })
|
'colspan': '2', })
|
||||||
etree.SubElement(
|
etree.SubElement(
|
||||||
xml_form, 'separator', {'string': '', 'colspan': '4'})
|
xml_form, 'separator', {'string': '', 'colspan': '4'})
|
||||||
|
|
|
@ -108,7 +108,8 @@ class _Defaults(dict):
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
def __setitem__(self, key, value):
|
def __setitem__(self, key, value):
|
||||||
func = lambda *a: str(value)
|
def func(*a):
|
||||||
|
return str(value)
|
||||||
return dict.__setitem__(self, key, func)
|
return dict.__setitem__(self, key, func)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue