Skip to content

Commit 80865ec

Browse files
committed
[IMP] convert_binary_field_to_attachment
Invalidate newly created attachment at each loop, avoiding potential memory errors. closes #42 Signed-off-by: Christophe Simonis (chs) <[email protected]>
1 parent 054fd0a commit 80865ec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/util/fields.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def make_index_name(table_name, column_name):
3333
from .helpers import _dashboard_actions, _validate_model, table_of_model
3434
from .inherit import for_each_inherit
3535
from .misc import SelfPrintEvalContext, log_progress, version_gte
36-
from .orm import env
36+
from .orm import env, invalidate
3737
from .pg import (
3838
alter_column_type,
3939
column_exists,
@@ -707,6 +707,7 @@ def convert_binary_field_to_attachment(cr, model, field, encoded=True, name_fiel
707707
""",
708708
[model, rid, field, att.id],
709709
)
710+
invalidate(att)
710711

711712
iter_cur.close()
712713
# free PG space

0 commit comments

Comments
 (0)