Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-9368

OEM Party Id field should have lookup on Edit Product page

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: Upcoming Release
    • Component/s: product
    • Labels:
      None

      Description

      Steps to reproduce:
      1. Go to Catalog component (https://demo-trunk.ofbiz.apache.org/catalog/control/main)
      2. Click on Products from submenu.(https://demo-trunk.ofbiz.apache.org/catalog/control/FindProduct)
      3. Provide search preference and click on Find button.
      4. Click on any Product Id link (https://demo-trunk.ofbiz.apache.org/catalog/control/EditProduct?productId=WG-9943).
      OEM Party Id is a text field with no look up. A user needs to know the correct partyId else it will give an error due to the violation of "Referential Integrity".

      1. OFBIZ-9368.patch
        1 kB
        Aditya Sharma
      2. OFBIZ-9368_plugins.patch
        2 kB
        Aditya Sharma
      3. OFBIZ-9368.patch
        5 kB
        Aditya Sharma

        Issue Links

          Activity

          Show
          aditya.sharma Aditya Sharma added a comment - Updated https://cwiki.apache.org/confluence/display/OFBIZ/Revisions+Requiring+Data+Migration+-+upgrade+ofbiz with the SQL query.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          BTW Aditya, when doing so a service is preferred over a simple SQL query. But sometimes we simply use a SQL query, like when deleting a non used field, which is the case here, so OK.

          Show
          jacques.le.roux Jacques Le Roux added a comment - BTW Aditya, when doing so a service is preferred over a simple SQL query. But sometimes we simply use a SQL query, like when deleting a non used field, which is the case here, so OK.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Aditya,

          OK then let's dot it.

          Show
          jacques.le.roux Jacques Le Roux added a comment - Aditya, OK then let's dot it.
          Hide
          aditya.sharma Aditya Sharma added a comment -

          Thanks, Jacques

          I noticed following logs:
          2017-08-06 19:21:47,966 |OFBiz-batch-2 |DatabaseUtil |W| Column [MANUFACTURER_PARTY_ID] of table [OFBIZ.PRODUCT] of entity [Product] exists in the database but has no corresponding field

          2017-08-06 19:21:47,966 |OFBiz-batch-2 |DatabaseUtil |W| Entity [Product] has 74 fields but table [OFBIZ.PRODUCT] has 75 columns.

          IMO there should be no unwanted logs thus we should have a SQL query to remove the field.

          Show
          aditya.sharma Aditya Sharma added a comment - Thanks, Jacques I noticed following logs: 2017-08-06 19:21:47,966 |OFBiz-batch-2 |DatabaseUtil |W| Column [MANUFACTURER_PARTY_ID] of table [OFBIZ.PRODUCT] of entity [Product] exists in the database but has no corresponding field 2017-08-06 19:21:47,966 |OFBiz-batch-2 |DatabaseUtil |W| Entity [Product] has 74 fields but table [OFBIZ.PRODUCT] has 75 columns. IMO there should be no unwanted logs thus we should have a SQL query to remove the field.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Hi Aditya,

          Your patches are in trunk
          framework r1804408
          plugins r1804409

          I believe we don't need a SQL query because looking in mail history I did not find any mentions of the manufacturerPartyId which were relevant.

          Anyway I let you decide and close when you want.

          Show
          jacques.le.roux Jacques Le Roux added a comment - Hi Aditya, Your patches are in trunk framework r1804408 plugins r1804409 I believe we don't need a SQL query because looking in mail history I did not find any mentions of the manufacturerPartyId which were relevant. Anyway I let you decide and close when you want.
          Hide
          aditya.sharma Aditya Sharma added a comment -

          As suggested by Jacques and Pierre, the patch includes removing all the traces of OEMPartyId (manufacturerPartyId) as it was some old approach.

          Changes in Patch:
          1. Removed manufacturerPartyId from Product entity
          2. Removed its relations from view entities namely GoodIdentificationAndProduct
          3. Removed it from forms EditProduct (Product), SearchInventoryItemsParams (EditFacilityInventoryItems screen in Facility) and SearchInventoryItemsDetailsParams (ViewFacilityInventoryItemsDetails screen in Facility)

          TODO:
          Add SQL query to alter table at https://cwiki.apache.org/confluence/display/OFBIZ/Revisions+Requiring+Data+Migration+-+upgrade+ofbiz after commit.

          Show
          aditya.sharma Aditya Sharma added a comment - As suggested by Jacques and Pierre, the patch includes removing all the traces of OEMPartyId (manufacturerPartyId) as it was some old approach. Changes in Patch: 1. Removed manufacturerPartyId from Product entity 2. Removed its relations from view entities namely GoodIdentificationAndProduct 3. Removed it from forms EditProduct (Product), SearchInventoryItemsParams (EditFacilityInventoryItems screen in Facility) and SearchInventoryItemsDetailsParams (ViewFacilityInventoryItemsDetails screen in Facility) TODO: Add SQL query to alter table at https://cwiki.apache.org/confluence/display/OFBIZ/Revisions+Requiring+Data+Migration+-+upgrade+ofbiz after commit.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          After a recent exchange in the user ML thread https://s.apache.org/BrVr I agree it's useless and can be removed. As Pierre mentionned the best way is to use EditProductParties. Then the related label should also be removed.

          Show
          jacques.le.roux Jacques Le Roux added a comment - After a recent exchange in the user ML thread https://s.apache.org/BrVr I agree it's useless and can be removed. As Pierre mentionned the best way is to use EditProductParties. Then the related label should also be removed.
          Hide
          aditya.sharma Aditya Sharma added a comment -

          +1
          Let me check the code for any dependencies and then will create a separate ticket to remove that.

          Show
          aditya.sharma Aditya Sharma added a comment - +1 Let me check the code for any dependencies and then will create a separate ticket to remove that.
          Hide
          pfm.smits Pierre Smits added a comment -

          Or remove it to keep in sync with patterns followed throughout.

          Show
          pfm.smits Pierre Smits added a comment - Or remove it to keep in sync with patterns followed throughout.
          Hide
          aditya.sharma Aditya Sharma added a comment -

          Hi Pierre,
          Agreed on that but if it exists it is better if it will be consistent with pattern followed throughout.

          Show
          aditya.sharma Aditya Sharma added a comment - Hi Pierre, Agreed on that but if it exists it is better if it will be consistent with pattern followed throughout.
          Hide
          pfm.smits Pierre Smits added a comment -

          Functionality regading setting parties in various roles is already available in the catalog component. See: https://demo-trunk.ofbiz.apache.org/catalog/control/EditProductParties?productId=WG-9943

          I believe the oemPartyId is a remnant of an old approach.

          Show
          pfm.smits Pierre Smits added a comment - Functionality regading setting parties in various roles is already available in the catalog component. See: https://demo-trunk.ofbiz.apache.org/catalog/control/EditProductParties?productId=WG-9943 I believe the oemPartyId is a remnant of an old approach.
          Hide
          aditya.sharma Aditya Sharma added a comment -

          Solution
          1. "EditProduct" renders "EditProduct" screen of "ProductScreens.xml"
          2. "EditProduct" screen includes "EditProduct" form of "ProductForms.xml"

          Updated "OEM Party Id" field with a lookup on "EditProduct" form.

          Show
          aditya.sharma Aditya Sharma added a comment - Solution 1. "EditProduct" renders "EditProduct" screen of "ProductScreens.xml" 2. "EditProduct" screen includes "EditProduct" form of "ProductForms.xml" Updated "OEM Party Id" field with a lookup on "EditProduct" form.

            People

            • Assignee:
              aditya.sharma Aditya Sharma
              Reporter:
              aditya.sharma Aditya Sharma
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development