OFBiz
  1. OFBiz
  2. OFBIZ-2813

ProductStore did not allow the default timezone to be set

    Details

    • Type: Improvement Improvement
    • Status: Patch Available
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: Trunk
    • Fix Version/s: None
    • Component/s: product
    • Labels:
      None

      Description

      The ProductStore has the defaultLocaleString and the defaultCurrencyUomId but does not have a defaultTimeZoneString. What happens when a store is selected (from e-commerce or the pos) is that it will look to the user for a lastTimeZone and if that is not set, it would simply revert to the TimeZone.getDefault() (so the timezone based on the server).

      The trouble we had was that you may have an application server that is running in a completely different timezone than what is desired for the store.

      I will be attaching a patch to this ticket with changes related to this improvement.

      1. OFBIZ-2813.patch
        12 kB
        Bob Morley
      2. OFBIZ-2813.patch
        12 kB
        Jacques Le Roux

        Activity

        Hide
        Bob Morley added a comment -

        OFBIZ-2813 contains the improvements. In brief, the entity has the new attribute, the form was updated to put it in the proper group (add/edit), various utility methods that get timezone were enhanced to try to get it from the product store (instead of going right to the system default)

        Show
        Bob Morley added a comment - OFBIZ-2813 contains the improvements. In brief, the entity has the new attribute, the form was updated to put it in the proper group (add/edit), various utility methods that get timezone were enhanced to try to get it from the product store (instead of going right to the system default)
        Hide
        Adrian Crum added a comment -

        Bob,

        There is a setting available to set the default time zone - look for start.properties. If you need a single OFBiz instance to pretend to be in different time zones based on the product store, then your proposal might be worth looking into.

        Show
        Adrian Crum added a comment - Bob, There is a setting available to set the default time zone - look for start.properties. If you need a single OFBiz instance to pretend to be in different time zones based on the product store, then your proposal might be worth looking into.
        Hide
        Bob Morley added a comment -

        Adrian,

        Thank you very much for your quick comment – I appreciate it! In this JIRA I am trying to expand the functionality in Ofbiz which is driven from our system requirements – specifically, we have implemented multi-tenancy so we absolutely have multiple customers using the same application server (and definition in different timezones). Now interestingly enough, our requirement would actually be more at the "Company" level – but in doing some research I noticed what I thought was a shortcoming in the ProductStore setup. To be honest I did not know about this setting, but did know it was installation based.

        So, I think in a multi-tenant situation you would definitely want to expose this value somewhere on an entity that was not the userLogin. But even before that, I think it is reasonable to suggest that you may have a Company that has multiple stores and spans more than one timezone where you would want this type of configuration. Would you buy that? In this fix I have tried to follow the #1 premise (do no harm) so I have elected not to seed this attribute and allow it to pass through as it does now (userLogin -> productStore -> System Default).

        Thoughts?

        Show
        Bob Morley added a comment - Adrian, Thank you very much for your quick comment – I appreciate it! In this JIRA I am trying to expand the functionality in Ofbiz which is driven from our system requirements – specifically, we have implemented multi-tenancy so we absolutely have multiple customers using the same application server (and definition in different timezones). Now interestingly enough, our requirement would actually be more at the "Company" level – but in doing some research I noticed what I thought was a shortcoming in the ProductStore setup. To be honest I did not know about this setting, but did know it was installation based. So, I think in a multi-tenant situation you would definitely want to expose this value somewhere on an entity that was not the userLogin. But even before that, I think it is reasonable to suggest that you may have a Company that has multiple stores and spans more than one timezone where you would want this type of configuration. Would you buy that? In this fix I have tried to follow the #1 premise (do no harm) so I have elected not to seed this attribute and allow it to pass through as it does now (userLogin -> productStore -> System Default). Thoughts?
        Hide
        David E. Jones added a comment -

        As a side bonus, it is also much more consistent with the other settings...

        Show
        David E. Jones added a comment - As a side bonus, it is also much more consistent with the other settings...
        Hide
        Jacques Le Roux added a comment -

        Is this issue still relevant with the OOTB multi-tenancy?

        Show
        Jacques Le Roux added a comment - Is this issue still relevant with the OOTB multi-tenancy?
        Hide
        Bob Morley added a comment -

        Yes, I believe it is more relevant because in a multi-tenant deployment you are more likely to have product stores (across your tenants) that have different time zones.

        Show
        Bob Morley added a comment - Yes, I believe it is more relevant because in a multi-tenant deployment you are more likely to have product stores (across your tenants) that have different time zones.
        Hide
        Jacques Le Roux added a comment -

        Here is attachec an updated and amended version of the patch.

        I have removed the
        <sort-field name="X"/>
        line in applications/product/webapp/catalog/store/ProductStoreForms.xml which I have renamed applications/product/widget/catalog/ProductStoreForms.xml (it has certainly moved did not check anyway it works then)

        I think we should take into account Adrian's remark in getTimeZone (at the end use ofbiz.timeZone.default if it exist)

        Show
        Jacques Le Roux added a comment - Here is attachec an updated and amended version of the patch. I have removed the <sort-field name="X"/> line in applications/product/webapp/catalog/store/ProductStoreForms.xml which I have renamed applications/product/widget/catalog/ProductStoreForms.xml (it has certainly moved did not check anyway it works then) I think we should take into account Adrian's remark in getTimeZone (at the end use ofbiz.timeZone.default if it exist)

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Bob Morley
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development