Address Format
Collapse
X
-
You can specify custom view name in entityDefs and then create view class in custom directory that will inherit existing view class.Leave a comment:
-
Do you suggest to change the file client/modules/crm/src/views/account/fields/shipping-address.js?
Originally:
Code:... Espo.define('Crm:Views.Account.Fields.ShippingAddress', 'Views.Fields.Address', function (Dep) { ...
Code:... Espo.define('Crm:Views.Account.Fields.ShippingAddress', '[B]Custom:[/B]Views.Fields.Address', function (Dep) { ...
Would be great if you can provide the information where to put this to be upgrade safe...Last edited by c.binder; 04-12-2016, 09:59 AM.Leave a comment:
-
I did all the changes mentioned above and detected that this affects the billing address but didn't change the shipping address.
There is a file (client/modules/crm/src/views/account/fields/shipping-address.js) that adds the button "Copy from Billing Address" to the view and it's based on Views.Fields.Address (but not on the custom view).
Therefore, how to change this (upgrade safe) so that the shipping address is based on the custom view?Leave a comment:
-
Create:
1. custom/Espo/Custom/Resources/metadata/fields/address.json
PHP Code:{
"view": "custom:views/fields/address"
}
2. client/custom/src/views/fields/address.js
PHP Code:Espo.define('custom:views/fields/address', 'views/fields/address', function (Dep) {
return Dep.extend({
editTemplate: 'custom:fields/address/edit'
});
});
3. Create client/custom/res/templates/fields/address/edit.tpl
I didn't test but I believe everything is correct.
BTW in 3.7.0 address string for detail view is generated in javascript function.Leave a comment:
-
Address Format
I changed
/client/src/views/fields/address.js and
/client/res/templates/fields/address/edit.tpl
in order to edit/show addresses in the correct format for Germany/Austria/Switzerland. How can this be made upgrade safe?Tags: None
Leave a comment: