diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getGapId.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getGapId.xml
index ffa55a2f79b5150785bf8089e7035a2c6759ec4a..ef0b6b77e997eb389931c63e69e0629bade596a6 100644
--- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getGapId.xml
+++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Account_getGapId.xml
@@ -61,7 +61,7 @@ preference_tool = context.getPortalObject().portal_preferences\n
 \n
 number_method = preference_tool.getPreferredAccountNumberMethod()\n
 \n
-if number_method == \'account_reference\':\n
+if number_method == \'account_reference\' and not gap_root:\n
   reference = context.getReference()\n
   if reference:\n
     return reference\n
diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision
index c9d864be1c9987e610cbc64452f33483de2f03f3..1286216edf251bc695e3ee95f0ddd5f72d6c6e1a 100644
--- a/bt5/erp5_accounting/bt/revision
+++ b/bt5/erp5_accounting/bt/revision
@@ -1 +1 @@
-1066
\ No newline at end of file
+1067
\ No newline at end of file