field_names should not be modified
This commit is contained in:
parent
0fb9847a29
commit
4a433ef5d6
|
@ -20,10 +20,17 @@ index a21e9e63e8..bd22d3b073 100644
|
||||||
|
|
||||||
def add(self, cls, type='model'):
|
def add(self, cls, type='model'):
|
||||||
diff --git a/tryton/trytond/trytond/model/modelsql.py b/tryton/trytond/trytond/model/modelsql.py
|
diff --git a/tryton/trytond/trytond/model/modelsql.py b/tryton/trytond/trytond/model/modelsql.py
|
||||||
index a21e9e63e8..a204c6df01 100644
|
index a21e9e63e8..e767d2e9ae 100644
|
||||||
--- a/tryton/trytond/trytond/model/modelsql.py
|
--- a/tryton/trytond/trytond/model/modelsql.py
|
||||||
+++ b/tryton/trytond/trytond/model/modelsql.py
|
+++ b/tryton/trytond/trytond/model/modelsql.py
|
||||||
@@ -753,7 +753,14 @@ class ModelSQL(ModelStorage):
|
@@ -747,13 +747,21 @@ class ModelSQL(ModelStorage):
|
||||||
|
extra_fields = set()
|
||||||
|
if 'write_date' not in fields_names:
|
||||||
|
extra_fields.add('write_date')
|
||||||
|
+ fields_names = fields_names[:]
|
||||||
|
for field_name in fields_names:
|
||||||
|
if field_name in {'_timestamp', '_write', '_delete'}:
|
||||||
|
continue
|
||||||
if '.' in field_name:
|
if '.' in field_name:
|
||||||
field_name, field_related = field_name.split('.', 1)
|
field_name, field_related = field_name.split('.', 1)
|
||||||
fields_related[field_name].add(field_related)
|
fields_related[field_name].add(field_related)
|
||||||
|
@ -39,7 +46,7 @@ index a21e9e63e8..a204c6df01 100644
|
||||||
if hasattr(field, 'datetime_field') and field.datetime_field:
|
if hasattr(field, 'datetime_field') and field.datetime_field:
|
||||||
extra_fields.add(field.datetime_field)
|
extra_fields.add(field.datetime_field)
|
||||||
if field.context:
|
if field.context:
|
||||||
@@ -1209,8 +1216,14 @@ class ModelSQL(ModelStorage):
|
@@ -1209,8 +1217,14 @@ class ModelSQL(ModelStorage):
|
||||||
foreign_table = Model.__table__()
|
foreign_table = Model.__table__()
|
||||||
foreign_red_sql = reduce_ids(
|
foreign_red_sql = reduce_ids(
|
||||||
Column(foreign_table, field_name), sub_ids)
|
Column(foreign_table, field_name), sub_ids)
|
||||||
|
|
Loading…
Reference in New Issue