Skip to content

BT : Fix template_keep_path_list for CatalogMethodTemplateItem

For years, erp5_calendar was keeping a duplicated copy of z_catalog_stock_list. In a79ca4c1, the functionality was merged in erp5_mysql_innodb and the duplicated copy was removed from erp5_calendar.

Problem is that when we update erp5_calendar, z_catalog_stock_list is removed.

We discussed in https://lab.nexedi.com/nexedi/erp5/commit/a79ca4c17c644018956a34d4a7bdd3caf2a6c9a5#note_15577 and suggested to use Path of objects that should be kept like we already did in some other business templates.

I tried, but it did not work, because CatalogMethod.preinstall overwrites the returned value of ObjectTemplateItem.preinstall (which supports template_keep_path_list) with the returned value of BaseTemplateItem.preinstall which does not support it.

My understanding is that the former is necessary to install the z sql methods and later to install the configuration on the catalog ( see efe5294e ), but the order does not really mater, so it's safe to give priority to ObjectTemplateItem.preinstall.

I also add some tests for template_keep_path_list, I think it was not tested, and modified erp5_calendar as suggested.

/cc @seb @kazuhiko @aurel @tiwariayush @gabriel

Merge request reports