[RELEASE] CustomFields module

A full documentation of the latest version of the module (branch v3 final) is available online:

User documentation:
http://wiki.dolibarr.org/index.php/Module_CustomFields

Developper documentation:
http://wiki.dolibarr.org/index.php/Module_CustomFields_Dev

Example cases:
http://wiki.dolibarr.org/index.php/Module_CustomFields_Cases

The software should be released soon.

New release in V2 branch: CustomFields v2.9, downloadable in the first post of this thread.

It includes a few backports from the V3 branch: bugfixes, ODT/PDF substitution restored, and multi-DBMS compatibility.

This release should at last be useable with Dolibarr >= 3.2.0 final, helping you to wait for the V3 release.

Hi,

I am a new dolibarr user and I like to work with this software.

But, I need the possibility add more taxes in products and services.

Eg:
Services have 2 or 3 taxes (ISS, IR, etc.)
Products can have until 6 taxes (ICMS, IR, PIS, COFINS, IPI, etc.).

The ā€œCustom Fieldsā€ module, works for me?

Regards,
Marcelo

Hello marceloeng,

You do not need CustomFields to add taxes in Dolibarr, there is another native interface for that (please read the wiki, you should find what you need there).

However, I am not quite sure that you can set different taxes for Products and Services (since they are both managed as the same kind of object inside the Dolibarrā€™s code), but you can add all the 9 taxes for both Products and Services, and then depending on the case you will just have to choose the right tax on your invoices.

Hello lrq3000,

Thanks for reply!

Your tip works fine, but I want choose more than one tax (PIS, CONFINS, IRPJ) for product/service.

And the all taxes, with respective percent, need show on invoice.

Regards,
Marcelo

Hi Marcelo, this is what I want to add with the module Brasil in Dolibarr.
See the project details in doliforge.org . It is in planning state but if you wish to help you are welcome.

BIG NEWS: The Pro version of CustomFields V3 is now available on the official website of CustomFields:

http://www.customfields.org

You will find on the website all the information you need.

And since a good news never comes alone, hereā€™s another one: the free version of CustomFields has been updated significantly:

* Unification of branches V1 and V2, which means that CustomFields Free also works for both Dolibarr 3.1 and for 3.2 (and higher).

* Standardization of class and functions with the Pro version, so that the source code between the Free and Pro version shares many similarities (of course many things are added to the Pro version, but if you are developing a module based on CustomFields Free it will also work with CustomFields Pro for the same functions with the same names also exist).

* JSON extension: this is the BIGGEST NEWS: Several people have made requests for features that were impossible to implement because it was impossible to store additional parameters for a field because of the inherent limitation of relational databases and because CustomFields was aimed to be standards compliant. Well, now it IS possible to add additional parameters and attach them to a custom field! You can attach an infinite number of parameters, and there is no need to predefine them beforehand in the database.
This means that it will be possible in the future to implement almost any feature since there are no more any limits (at least the main storage limit of additional parameters has been lifted).
In practice, this has already been applied to ensure compatibility with databases without Foreign Keys support (see below), and to allow rearranging fields.

* Compatibility with MyISAM databases and other databases without Foreign Keys support (InnoDB is not required anymore!). You can now use CustomFields on a database running MyISAM, the Foreign Keys are then managed through JSON extension.

* Rearrange fields: you can now rearrange the order in which your custom fields will appear without having to delete and recreate them.

* Confirmation is now required for the destruction of a custom field (since all datas associated with this field are lost forever).

* An help banner is now displayed in the admin panel just like the Pro version to introduce new users to the basic functionalities of CustomFields.

* Many bugfixes

* Support for the folder /custom/ (the module can be freely moved into a subfolder for third-party modules).

It is also strongly advised to update CustomFields as it requires creating a new table for the JSON extension (donā€™t worry, you do not risk anything, there is a total compatibility with older versions, CustomFields was always made on purpose of retrocompatibility from the beginning), so it is advisable to do so early so as to avoid future errors. Also, a lot of bugs have been fixed.

Also, the wiki was completed with a lot of data and example cases (eg: how to change the total price and products lines prices depending on a custom field), so be sure to check it out!

I hope that these two new versions will meet all your needs.

PS: I forgot to post a reference to the library SQL-Demo-Restore that I created and used in the Dolibarr online demo that is shown on the website. It is an opensource library under LGPLv3+.

More informations:
www.dolibarr.org/t/sql-demo-restore-a-class-to-manage-online-demos/8799/1

CustomFields changed its domain!

The new website address is:
http://www.customfields.org

This one should be a lot more reliable than the old .co.cc

Is customfields free/pro compatible with the multicompany module. If I setup custom fields to modify a module and use multicompany for two companies will the custom field settings be retained for both companies?

toomanylogins wrote:

Sorry I donā€™t have any idea about it as I do not own the MultiCompany module and thus cannot test it.

You should just try CustomFields Free and see if it works. If it works, CustomFields Pro will also do, but if not then both wonā€™t work since Free and Pro have a similar codebase.

If you try it, feel free to feedback the result here!

/EDIT: thereā€™s not enough informations on the wiki to understand how the Multi Company module technically works, but from the description, it seems it uses only one install and one database, thus it probably reuses the same database tables and Dolibarr files as a standard install, but adds additionnal SQL tables to manage the multi company feature. Thatā€™s my guess, Iā€™m not sure, but if thatā€™s the case, CustomFields should work flawlessly.

Just tried install on 3.2.1 of free version with the multicompany module. I got this error after create table. Mysql version MySQL 5.1.63-0ubuntu0.10.04.1

Error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ā€˜) ON DELETE CASCADE ON UPDATE CASCADE ) AUTO_INCREMENT=1ā€™ at line 6

@toomanylogins: did you try to enable CustomFields without the multicompany module? Does it produce the same error?

Yes still get error with module disabled. Is this mysql version problem ? Might be related to this post

So this means that the error does not lie in the interaction with multicompany.

No itā€™s also not related to the post youā€™ve found, the syntax of the SQL queries issued by CustomFields are totally standard and correct (thereā€™s a lot of people using CustomFields on their production environment without any problem).

My guess is that your database runs an old version of MySQL that does not support ON DELETE ON CASCADE, or either you just donā€™t have INNODB enabled (but even if you only have MyISAM, these commands will just be ignored, and shouldnā€™t stop the process altogether as it is happening for you).

CustomFields has a workaround for foreign keys, so you can just crawl in the code of CustomFields and remove these SQL commands. Then it should work. You will just run under SQL compatibility mode:
http://wiki.dolibarr.org/index.php/Module_CustomFields_Dev#SQL_Compatibility_mode

Hello,

Iā€™m still getting this error tried as follows.

First installed on another server (live) and I get the same error. The server has phpmyadmin and confirm that innodb is running.

On my internal test server innodb it also enabled. Stopped mysql and deleted the log files. Also check permissions okay for custom fields folder

/etc/init.d/mysql stop
mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bak
mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bak
/etc/init.d/mysql start

Same result still get the error.

must be something Iā€™m doing wrong, any ideas?
Regards
Paul

I tried a clean install dolibarr 3.2.2 with custom fileds and it works ok. I am checking if multicompany module is the cause of the error.

Bit more information. On the clean install 3.2.2 which is working with multicompany enabled when I go to setup the custom fields module the setup page includes a tab panel with four tabs, invoice, commercial proposal, product services and customer orders. you create table for each of these.

On the existing test installation upgraded to 3.2.2 when you go to setup custom fields module the tab panel does not appear just a single create table button.

I am consistently getting this error whenever I try and install custom fields in an existing Dolibarr install. On the same server with a clean installation it works fine. The only unusual thing is that the Dolibarr tables are sharing a database with Joomla so there are Joomla tables prefix j25. Would this be the cause of the error?

Hello toomanylogins,

Thank you for the detailed report.

Unluckily, I have not the slightest idea of what is going on (and usually I always have at least one theory in my sleeve). This shouldnā€™t happen if your install is standard, so Iā€™m pretty sure thereā€™s a difference somewhere which makes this happen but I canā€™t pinpoint exactly from your report.

If you are willing to give me access to the FTP + a Dolibarr temporary account, I can take a look by myself and try a few stuff to better see what is going on.

You can contact me by mail here:
http://www.google.com/recaptcha/mailhide/d?k=01GZ465xAGD3iYJctswfJhqg==&c=Hbb30vgeDX9ABQVBv3x-Wa525q6OKq9AaBebFjdnXns=