-
Jérome Perrin authored
For years, erp5_calendar was keeping a duplicated copy of [`z_catalog_stock_list`](https://lab.nexedi.com/nexedi/erp5/blob/985bbc0f716397c899e6af69ef431db86923ab34/product/ERP5/bootstrap/erp5_mysql_innodb_catalog/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_catalog_stock_list.sql). 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 a79ca4c1 (comment 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`](https://lab.nexedi.com/nexedi/erp5/blob/985bbc0f716397c899e6af69ef431db86923ab34/product/ERP5/Document/BusinessTemplate.py#L2995) overwrites the returned value of [`ObjectTemplateItem.preinstall`](https://lab.nexedi.com/nexedi/erp5/blob/985bbc0f716397c899e6af69ef431db86923ab34/product/ERP5/Document/BusinessTemplate.py#L1117) (which supports template_keep_path_list) with the returned value of [`BaseTemplateItem.preinstall`](https://lab.nexedi.com/nexedi/erp5/blob/985bbc0f716397c899e6af69ef431db86923ab34/product/ERP5/Document/BusinessTemplate.py#L485) 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 /reviewed-on !260
a4cc0f30