[Vtigercrm-developers] Add custom field to accountbillads table

Alan Lord alanslists at gmail.com
Mon Feb 20 08:35:36 GMT 2023


Addresses are really messed up in vtiger - a throwback to the original 
Sugar CRM.

Almost every module that contains addresses has a different naming 
structure for the address fields, uses different tablenames and is 
hardcoded all over the place, both in the client-side javascript and in 
some of the server-side class files.

Over the years I have requested that we create one single "address" 
module. This should then be relatable to whatever modules you need and 
would then allow you have none, one or as many addresses as you like per 
record. As well as simplifying the code considerably, it would also help 
to reduce data duplication (think Contacts with same address as parent 
Organisation, Quotes, Invoices etc... all could use the same address 
record) - i.e. 3NF[1].


Anyway - for the "copy address thing to work, you will need to modify 
client-side code such as this:

https://code.vtiger.com/vtiger/vtigercrm/blob/master/layouts/v7/modules/Accounts/resources/Edit.js

And on the server-side you will find stuff like this in a few places as 
I recall...

https://code.vtiger.com/vtiger/vtigercrm/blob/master/modules/Accounts/models/Record.php#L80

HTH

Al

[1] https://en.wikipedia.org/wiki/Third_normal_form

On 18/02/2023 19:15, Renan Paiva wrote:
> I’d like to have the functionality of copy address working on this new 
> field, because I need add for billing and shipping.
> 
> My intent was custom the minimum as possible.
> 




More information about the vtigercrm-developers mailing list