Announcement

Collapse
No announcement yet.

Address Format

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?
    ------------------
    Robert Laussegger
    iscon group
    http://www.iscongroup.net
    mailto://info@iscongroup.net

  • #2
    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.

    Comment


    • #3
      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?

      Comment


      • #4
        You can make shipping address to look to custom.

        Comment


        • #5
          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) {
          ...
          Changed:
          Code:
          ...
          Espo.define('Crm:Views.Account.Fields.ShippingAddress', '[B]Custom:[/B]Views.Fields.Address', function (Dep) {
          ...
          This works but I guess that with one of the next patches this change might be overwritten, right?

          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.

          Comment


          • #6
            You can specify custom view name in entityDefs and then create view class in custom directory that will inherit existing view class.

            Comment


            • #7
              Thanks for your support - now it's working as expected!

              Comment

              Working...
              X