diff --git a/html/admin/sql/patch/upgrade78.sql b/html/admin/sql/patch/upgrade78.sql
new file mode 100644
index 000000000..c7ebbb989
--- /dev/null
+++ b/html/admin/sql/patch/upgrade78.sql
@@ -0,0 +1,31 @@
+begin;
+
+DROP FUNCTION if exists comptaproc.action_get_tree(bigint);
+
+CREATE OR REPLACE FUNCTION comptaproc.action_get_tree(p_id bigint)
+ RETURNS setof bigint AS
+$BODY$
+
+declare
+ e bigint;
+ i bigint;
+begin
+ for e in select ag_id from action_gestion where ag_ref_ag_id=p_id
+ loop
+ for i in select action_get_tree from comptaproc.action_get_tree(e)
+ loop
+ raise notice ' == i %', i;
+ return next i;
+ end loop;
+ raise notice ' = e %', e;
+ return next e;
+ end loop;
+ return;
+
+end;
+$BODY$
+ LANGUAGE 'plpgsql' VOLATILE;
+
+update version set val=79;
+
+commit;
diff --git a/include/constant.php b/include/constant.php
index 1315f4606..580d7b5dd 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -26,7 +26,7 @@
require_once ('config.inc.php');
require_once('constant.security.php');
-define ("DBVERSION",78);
+define ("DBVERSION",79);
define ("MAX_COMPTE",4);
define ('MAX_ARTICLE',9);