delcroip / dolibarr_project_timesheet

Timesheet view for project in Dolibarr
https://demo-timesheet.pmpd.eu
GNU Affero General Public License v3.0
33 stars 31 forks source link

Error on Dolibarr 18 beta #237

Closed funsurfer2008 closed 1 month ago

funsurfer2008 commented 1 year ago

Hy,

i have updated to dolibarr 18 beta yesterday and i become this error on Projectreportpage:

Datum: 20230627155546 Dolibarr: 18.0.0-beta - https://www.dolibarr.org Funktionslevel: 0 PHP: 8.0.28 Server: Apache/2.4.56 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1n OS: Linux srv04.ms-hosting.local 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.58

Angefragte URL: /custom/timesheet/TimesheetReportProject.php?projectSelected=18 Referer: https://XXXXXXXXXXXXXX/projet/tasks/time.php?withproject=1&projectid=18 Menüverwaltung: eldy_menu.php

Module/Anwendungen: user, knowledgemanagement, prelevement, projet, categorie, import, export, workflow, bookmark, propal, contrat, timesheet, taskgantt, product, accounting, agenda, banque, cron, commande, ecm, expensereport, facture, fournisseur, margin, opensurvey, resource, salaries, service, societe, ticket, supplier_proposal, reception, tax, paymentbybanktransfer Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced, ptt.rowid as id, ptt.note as note, tske.invoiceable as invoicable, DATE(ptt.task_datehour) AS task_date, ptt.task_duration as duration FROM llx_projet_task_time as ptt JOIN llx_projet_task as tsk ON tsk.rowid = fk_task LEFT JOIN llx_projet_task_extrafields as tske ON tske.fk_object = fk_task WHERE tsk.fk_projet IN ('18') AND DATE(task_datehour) >= '2023-06-27 15:55:46' AND DATE(task_datehour) <= '2023-06-27 15:55:46' AND (ptt.task_duration > 0 or LENGTH(ptt.note)>0) ORDER BY tsk.fk_projet,ptt.fk_user, tsk.rowid, DATE(ptt.task_datehour) ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_NOSUCHTABLE Information zum letzten fehlerhaften Datenbankzugriff: Table 'DATABASE.llx_projet_task_time' doesn't exist

could you please check?

brgds

tronx2100 commented 1 year ago

this errors means you have no llx_projet_task_time table in your dolibarr. add the table should fix the problem for you.

CREATE TABLE llx_projet_task_time (....

funsurfer2008 commented 1 year ago

Yes, but why do i Not have the table Since Update to v18?

tronx2100 commented 1 year ago

in dolibarr v17 you have the table inside the install directory https://github.com/Dolibarr/dolibarr/tree/17.0/htdocs/install/mysql

but you are right llx_projet_task_time is in v18 not in the install/mysql directory... maybe because v18 is beta or ask the dolibarr team whats happen with the table in v18 is a BUG report related to this https://github.com/Dolibarr/dolibarr/issues/24464

what i can say is in v18 the table name seems to be changed https://github.com/Dolibarr/dolibarr/commit/97344e38cbd0d7d47b5e9000d9534995a2c33f44

so we need to check this to make it working again on v18

tronx2100 commented 1 year ago

i have build a quick realease with renamed tables please download the attached file and rename to zip maybe it works.please send a feedback. it is pre alpha :)

module_timesheet-4.6.7.zip_v18.alpha.txt

funsurfer2008 commented 1 year ago

now i become:

Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced, ptt.rowid as id, ptt.note as note, tske.invoiceable as invoicable, DATE(ptt.task_datehour) AS task_date, ptt.task_duration as duration FROM llx_element_time as ptt JOIN llx_projet_task as tsk ON tsk.rowid = fk_task LEFT JOIN llx_projet_task_extrafields as tske ON tske.fk_object = fk_task WHERE tsk.fk_projet IN ('18') AND DATE(task_datehour) >= '2023-06-28 21:53:33' AND DATE(task_datehour) <= '2023-06-28 21:53:33' AND (ptt.task_duration > 0 or LENGTH(ptt.note)>0) ORDER BY tsk.fk_projet,ptt.fk_user, tsk.rowid, DATE(ptt.task_datehour) ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_NOSUCHFIELD Information zum letzten fehlerhaften Datenbankzugriff: Unknown column 'ptt.task_datehour' in 'field list'

tronx2100 commented 1 year ago

ok

now i become:

Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced, ptt.rowid as id, ptt.note as note, tske.invoiceable as invoicable, DATE(ptt.task_datehour) AS task_date, ptt.task_duration as duration FROM llx_element_time as ptt JOIN llx_projet_task as tsk ON tsk.rowid = fk_task LEFT JOIN llx_projet_task_extrafields as tske ON tske.fk_object = fk_task WHERE tsk.fk_projet IN ('18') AND DATE(task_datehour) >= '2023-06-28 21:53:33' AND DATE(task_datehour) <= '2023-06-28 21:53:33' AND (ptt.task_duration > 0 or LENGTH(ptt.note)>0) ORDER BY tsk.fk_projet,ptt.fk_user, tsk.rowid, DATE(ptt.task_datehour) ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_NOSUCHFIELD Information zum letzten fehlerhaften Datenbankzugriff: Unknown column 'ptt.task_datehour' in 'field list'

okay a lot of changes ... i have made a new build with renamed a lot more fieldnames

maybe it works now

try it

module_timesheet-4.6.7.zip_v18ALPHA2.txt

funsurfer2008 commented 1 year ago

^nope sorry: Module/Anwendungen: user, knowledgemanagement, prelevement, projet, categorie, import, export, workflow, bookmark, propal, contrat, timesheet, taskgantt, product, accounting, agenda, banque, cron, commande, ecm, expensereport, facture, fournisseur, margin, opensurvey, resource, salaries, service, societe, ticket, supplier_proposal, reception, tax, paymentbybanktransfer Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT tsk.fk_projet as projectid, ptt.fk_user as userid, tsk.rowid as taskid, (ptt.invoice_id > 0 or ptt.invoice_line_id>0) AS invoiced, ptt.rowid as id, ptt.note as note, tske.invoiceable as invoicable, DATE(ptt.element_datehour) AS element_date, ptt.element_duration as duration FROM llx_element_time as ptt JOIN llx_projet_task as tsk ON tsk.rowid = fk_task LEFT JOIN llx_projet_task_extrafields as tske ON tske.fk_object = fk_task WHERE tsk.fk_projet IN ('18') AND DATE(element_datehour) >= '2023-06-28 23:15:29' AND DATE(element_datehour) <= '2023-06-28 23:15:29' AND (ptt.element_duration > 0 or LENGTH(ptt.note)>0) ORDER BY tsk.fk_projet,ptt.fk_user, tsk.rowid, DATE(ptt.element_datehour) ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_NOSUCHFIELD Information zum letzten fehlerhaften Datenbankzugriff: Unknown column 'fk_task' in 'on clause'

tronx2100 commented 1 year ago

i have now replaced all fields from migration help https://github.com/Dolibarr/dolibarr/blob/develop/htdocs/install/mysql/migration/17.0.0-18.0.0.sql

please try this build module_timesheet-4.6.7.zip_v18_alpha3.txt

funsurfer2008 commented 1 year ago

hy. seems to work now. Thanks

funsurfer2008 commented 1 year ago

Hy. Sorry, but it seems that it have more broken tables:

PHP: 8.0.28 Server: Apache/2.4.56 (Debian) mod_fcgid/2.3.9 OpenSSL/1.1.1n OS: Linux srv04.ms-hosting.local 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.67

Angefragte URL: /custom/timesheet/TimesheetProjectInvoice.php?projectid=14 Referer: https://erp.a-square.at/projet/card.php?id=14&save_lastsearch_values=1 Menüverwaltung: eldy_menu.php

Module/Anwendungen: user, knowledgemanagement, prelevement, accounting, agenda, banque, cron, commande, ecm, expensereport, facture, fournisseur, margin, opensurvey, resource, salaries, service, societe, ticket, projet, categorie, import, export, workflow, bookmark, propal, contrat, timesheet, taskgantt, product, supplier_proposal, reception, tax, paymentbybanktransfer Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM llx_societe as s WHERE s.entity IN (1) AND (Filter syntax error - Bad syntax of the search string) ORDER BY nom ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_SYNTAX Information zum letzten fehlerhaften Datenbankzugriff: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'syntax error - Bad syntax of the search string) ORDER BY nom ASC' at line 1

brgds

tronx2100 commented 1 year ago

i'm not sure about this, because s.tva_intra and s.code_client is not used in timesheet maybe this shows other problems with dolibarr

funsurfer2008 commented 1 year ago

ill think it looks for existing invoices from customers. maybe it is because v18 is in beta. there are other problems too.

lets look forward to release, and then fix it for good :)

funsurfer2008 commented 11 months ago

Hy! 18.0.1 is out but timesheet does not work. can you fix it please? brgds

funsurfer2008 commented 11 months ago

Hy. whats about an update for v18? brgds

tronx2100 commented 11 months ago

Hi , i was busy last weeks because a lot of problems was to fix wicth php8.2.7.

im not ne Developer from this module but i hope my latest changes will fix it module_timesheet-4.6.7.zip.txt

we have it in use and it works. try it out

funsurfer2008 commented 11 months ago

Hy. sorry, but i become this error:

Angefragte URL: /custom/timesheet/TimesheetProjectInvoice.php?projectid=14 Referer: https://erp.a-square.at/projet/card.php?id=14&save_lastsearch_values=1 Menüverwaltung: eldy_menu.php

Module/Anwendungen: user, knowledgemanagement, prelevement, projet, categorie, import, export, workflow, bookmark, propal, contrat, timesheet, taskgantt, product, accounting, agenda, banque, cron, commande, ecm, expensereport, facture, fournisseur, margin, opensurvey, resource, salaries, service, societe, ticket, supplier_proposal, reception, tax, paymentbybanktransfer Datenbank Type Manager: mysqli Letzter Fehlerhafter Datenbankzugriff: SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM llx_societe as s WHERE s.entity IN (1) AND (Filter syntax error - Bad syntax of the search string) ORDER BY nom ASC Rückgabewert des letzten fehlerhaften Datenbankzugriff: DB_ERROR_SYNTAX Information zum letzten fehlerhaften Datenbankzugriff: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'syntax error - Bad syntax of the search string) ORDER BY nom ASC' at line 1

tronx2100 commented 11 months ago

Should now work

module_timesheet-4.6.7.zip.txt

funsurfer2008 commented 11 months ago

Hy! perfect. seems to work! brgds

vidlb commented 10 months ago

Well I didn't wanted to downgrade my instance because of this module, so @tronx2100 I tried your patch but this is not working with a psql backend, there are syntax errors when adding times.

@delcroip do you plan official support for v18 ?

delcroip commented 10 months ago

Hello, there is a branch dolibarr 18, did you try it ?

vidlb commented 10 months ago

I remember you once told me we have to get zips from sourceforge else it won't work. Is there a build for v18 somewhere ? How can I use that branch to deploy ? Can I just zip the branch and upload as it is to dolibarr apps installer ?
Or is there a php build something ^^ ?

matll42 commented 10 months ago

Hi, after checking the development branch, do the queries migration to fix all queries, but still had few issues, and oh magic, I discover the dolibarr-18 branch 🙄...

for dolibarr 18 with postgresql, in order to be able to create a time spent, I had to run those three adjustments:

CREATE SEQUENCE llx_element_time_rowid_seq;
ALTER SEQUENCE llx_element_time_rowid_seq OWNER TO dolibarr; -- or any user you use
SELECT setval('llx_element_time_rowid_seq', (SELECT max(rowid) FROM llx_element_time));
ALTER TABLE llx_element_time ALTER COLUMN rowid SET DEFAULT nextval('llx_element_time_rowid_seq'::regclass);

This issue is more on the dolibarr core (as they miss this in the migration 17 to 18 script so I will open a ticket on their side. @delcroip Can you confirm that it's not on the module?

delcroip commented 10 months ago

You are right, those were not created by the module.

Br

vidlb commented 10 months ago

for dolibarr 18 with postgresql, in order to be able to create a time spent, I had to run those three adjustments:

Okay, what can I do now that I already applied migrations ? Can I just re-use the zip.txt @tronx2100 updated after running those sql commands ?

Also can someone explain how I can build the timesheet package using this v18 branch, or can I just upload the timesheet dir as it is in zip format ?

matll42 commented 10 months ago

@vidlb you can directly use the htdocs/timesheet folder inside of the module archive

This has been a long time since I created a module, but if you already apply the migrations, you can connect to pgsql to run the commands, and create a new time entry should work. I didn't use the zip, but directly the git branch.

tronx2100 commented 10 months ago

the .txt file must be renamed to zip. The latest one is in daily use in our company and not reported any bugs. It is also working without errors on php 8.2.9

vidlb commented 10 months ago

Using the branch dolibarr-18 and after I ran the missing index sql command, the app seems to work but failed to save new entries :

2023-10-19 08:09:19 ERR     193.48.189.250    DoliDBPgsql::query SQL Error query: INSERT INTO llx_element_time (import_key, fk_element, elementtype, element_date, element_datehour, element_date_withhour, element_duration, fk_product, fk_user, thm, invoice_id, invoice_line_id, intervention_id, intervention_line_id, datec, note) VALUES (NULL, 37, 'task', '2023-09-11 06:00:00', '2023-09-11 06:00:00', 1, 12600, NULL, 1, NULL, NULL, NULL, NULL, NULL, '2023-10-19 12:09:19', '')
2023-10-19 08:09:19 ERR     193.48.189.250    DoliDBPgsql::query SQL Error message: ERROR:  42501: permission denied for sequence llx_element_time_rowid_seq
LOCATION:  nextval_internal, sequence.c:616 (DB_ERROR_42501)
2023-10-19 08:09:19 ERR     193.48.189.250    DoliDBPgsql::query SQL Error usesavepoint = 0

Is it because I used the postgres user ? Do I need to grant privileges ?

vidlb commented 10 months ago

My bad, this is working after I used GRANT ALL ON llx_element_time_rowid_seq TO dolibarr ; Thank you guys

matll42 commented 10 months ago

yes if you use another user than the user from dolibarr, alternative is change the owner that is more apropriate to avoid multiple users defined on your db:

ALTER SEQUENCE llx_element_time_rowid_seq OWNER TO dolibarr; -- or any user you use
whp-jeffm commented 8 months ago

What is the final result here? I have version 4.6.7 installed on my Dolibarr server running 18.3. It is still throwing the error that projet_task_time is not found because according to the change log for v. 18.

NEW: element time integration code + SQL NEW: tables: llx_element_time to store time spent on several elements (mo, ticket...)

I am not adept enough at coding Dolibarr yet to make the required change. But after following this thread it looks like maybe the changes were made? Any help? Thanks!

whp-jeffm commented 8 months ago

What is the final result here? I have version 4.6.7 installed on my Dolibarr server running 18.3. It is still throwing the error that projet_task_time is not found because according to the change log for v. 18.

NEW: element time integration code + SQL NEW: tables: llx_element_time to store time spent on several elements (mo, ticket...)

I am not adept enough at coding Dolibarr yet to make the required change. But after following this thread it looks like maybe the changes were made? Any help? Thanks!

Never mind, I saw that the Github version is set to 5.0.0 and that the files from the Dolibarr repo are not to be used. Leaving this here in case anyone else is as poor a reader as I am. Thanks!

funsurfer2008 commented 6 months ago

Hy. il tested the v19 with the 5.0.0 and it give the same issue. with your version here it work fine.

brgds

tronx2100 commented 6 months ago

Hy. il tested the v19 with the 5.0.0 and it give the same issue. with your version here it work fine.

brgds

nice, and i have see this , in our daily use we have no problems since switching to v18 anymore. it works almost stable

tronx2100 commented 6 months ago

This is my Current v19 release module_timesheet-4.9.1.zip.txt

delcroip commented 1 month ago

Normaly all changes were integrated, I am closing this onem please open another one if needed