From 9a1588df1385567b527c1f78d3ed32637c925ca6 Mon Sep 17 00:00:00 2001 From: Sean Wang Date: Wed, 14 Mar 2018 16:38:22 +0800 Subject: [PATCH] Add missing $mode in BookKeeping::createStd() In accountancy ledger, creating new transaction, there is 'ERROR: 55000: currval of sequence "llx_accounting_bookkeeping_rowid_seq" is not yet defined in this session' occurred. According to dolibarr.log, this error will show up after createStd() {...Insert request to llx_accounting_bookkeeping_tmp...}. It query the "llx_accounting_bookkeeping_rowid_seq" instead of "llx_accounting_bookkeeping_tmp_rowid_seq", due to missing $mode at bookkeeping.class.php line504:last_insert_id(). --- htdocs/accountancy/class/bookkeeping.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 16f40139a38..d027b7c425b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -501,7 +501,7 @@ class BookKeeping extends CommonObject } if (! $error) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode); if (! $notrigger) { // Uncomment this and change MYOBJECT to your own tag if you