Commit 948c64ff authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

erp5_catalog: Compile PythonScript methods after migrating them

parent 31f9f787
......@@ -3018,6 +3018,7 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
method = changeObjectClass(catalog, method_id, sql_class)
if method.meta_type == 'Script (Python)':
method = changeObjectClass(catalog, method_id, script_class)
method._compile()
new_obj = method.aq_base
self._objects[path] = new_obj
......
  • I'm surprised explicit compilation makes a difference. If it does, then I believe this can be pushed to master without waiting for the merge request.

  • Yes, it does make a difference in this case, as when we use changeObjectClass it creates a new object with different class(which is not what it implies with its name) and thus we need to compile the new python script. Better would be to add this point in commit. Also, as this concerns only after the migration, I don't think its good to push it before merge request.

  • Ah, I just noticed this whole if catalog.meta_type == 'ERP5 Catalog': is added in 1bcc6825. Then it's better to squash this commit in that one: less questions about why this new statement is needed :) .

    Edited by Vincent Pelletier
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment