diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py index 2f39e314c1892132511807440c917d8ef64702d8..0987fd4deecf4a111bc3c4976fdf667bc1bd6845 100644 --- a/product/ERP5/Document/BusinessTemplate.py +++ b/product/ERP5/Document/BusinessTemplate.py @@ -5553,6 +5553,8 @@ Business Template is a set of definitions, such as skins, portal types and categ 'install_object_list_list', 'id_generator', 'bt_for_diff'): continue value = self.getProperty(id) + if value is None: + continue if prop_type in ('text', 'string', 'int', 'boolean'): bta.addObject(obj=value, name=id, path=path+os.sep+'bt', ext='') elif prop_type in ('lines', 'tokens'): diff --git a/product/ERP5/Tool/TemplateTool.py b/product/ERP5/Tool/TemplateTool.py index bc9b203a9e11b94384b7f02a9ce4b63eb5b66608..c8591b8fff42955bd341e17c8b040c5e90d09999 100644 --- a/product/ERP5/Tool/TemplateTool.py +++ b/product/ERP5/Tool/TemplateTool.py @@ -256,6 +256,11 @@ class TemplateTool (BaseTool): except KeyError: continue value = tar.extractfile(info).read() + if value is 'None': + # At export time, we used to export non-existent properties: + # str(obj.getProperty('non-existing')) == 'None' + # Discard them + continue if prop_type == 'text' or prop_type == 'string' \ or prop_type == 'int': prop_dict[pid] = value @@ -320,6 +325,11 @@ class TemplateTool (BaseTool): if not os.path.exists(prop_path): continue value = open(prop_path, 'rb').read() + if value is 'None': + # At export time, we used to export non-existent properties: + # str(obj.getProperty('non-existing')) == 'None' + # Discard them + continue if prop_type in ('text', 'string', 'int', 'boolean'): prop_dict[pid] = value elif prop_type in ('lines', 'tokens'):