Order Entry unclear error when no ProductStore set
-------------------------------------------------- Key: OFBIZ-1172 URL: https://issues.apache.org/jira/browse/OFBIZ-1172 Project: OFBiz Issue Type: Improvement Components: order Affects Versions: SVN trunk, Release Branch 4.0 Reporter: Wickersheimer Jeremy Priority: Minor I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Wickersheimer Jeremy updated OFBIZ-1172: ---------------------------------------- Attachment: ofbiz-1172.patch This patch tries to fetch the ProductStore entity that would be used in a purchase order in the BSH file. Then I display some useful details in the FTL: the ProducteStore name and id, and the default currency. (this is useful for us but you can change that if you want when comitting the patch). Obviously, if no ProductStore is found then an error message is displayed in the Purchase Order section with a link to the OrderEntry Website. This patch may not be perfect: i think the links in the ftl should use some special ofbiz tags, and the info displayed can be changed. But the basic idea is good as it can save some headaches. This is also a bit related to https://issues.apache.org/jira/browse/OFBIZ-1141 > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515486 ] David E. Jones commented on OFBIZ-1172: --------------------------------------- What was the actual error that you saw, preferably with snippets from the log? Unless something major has changed no ProductStore should be required for Purchase Orders, just for Sales Orders. > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515491 ] Wickersheimer Jeremy commented on OFBIZ-1172: --------------------------------------------- I give you the step to reproduce on a base ofbiz install with demo data: - into Content / websites, edit OrderEntry website ( https://localhost:8443/content/control/EditWebSite?webSiteId=OrderEntry ) - Set Product Store Id to "empty", then update - go to orderentry, and try to make a purchase order You get : The Following Errors Occurred: Error calling event: org.ofbiz.webapp.event.EventHandlerException: Problems processing event: java.lang.NullPointerException (null) The Code expects to have a ProductStore entity, and it is taken from the request either the WebSite or the Cart entities. The WebSite is set to OrderEntry website, and since we set the Product Store Id to null, it chokes. The ProductStore entity is required to get the defaultCurrency, the Locale, ... The code to get the store locale handles null ProductStore (there is a test and logError if not ProductStore), the currency doesn't have such there is a NPE when it calls the method getCurrency (or such). I first patched this to add a check but then it would NPE a somewhere else so a ProductStore IS required to make a PO. I did not get the exact business logic of why is a ProductStore needed ... maybe it makes sense. But that is not the point, the error message was just very unhelpful. > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515842 ] Adrian Crum commented on OFBIZ-1172: ------------------------------------ Jeremy, Your patches would have a better chance of being committed if you would put a little more effort into them. You are right, your links are missing Freemarker transforms. Take a few minutes and put them in. The HTML you copied does not follow the HTML/CSS Best Practices - see http://docs.ofbiz.org/display/OFBADMIN/Best+Practices+Guide There is no need to put <div> elements inside <td> elements. I understand that's how it was done in the code you copied from, but still, we need to stop copying bad code. > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: SVN trunk, Release Branch 4.0 > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721322#action_12721322 ] Joe Eckard commented on OFBIZ-1172: ----------------------------------- Back to the original issue... why is a ProductStore required when creating a PO? This bug is still present, and on the init screen there is no way to specify a productStoreId when creating a PO, the only way to set one is to set the productStoreId field on the "OrderEntry" WebSite entity. > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: Release Branch 4.0, SVN trunk > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721382#action_12721382 ] BJ Freeman commented on OFBIZ-1172: ----------------------------------- The product store is currently fthe focus for products, like pricing, where the product is located. So you have a way to recieve the items when they arrive. I think a better question is can the same type of focus be Setup for Each company and Subdivisions. Maybe it is the fact it says Product store instead of ProductCenter or ProductFocus. I don't see a reason that a productStore Functionality is required based on the model so maybe just add a ProductStoreID Association to the PartyID that as a Role of company. > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: Release Branch 4.0, SVN trunk > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721395#action_12721395 ] David E. Jones commented on OFBIZ-1172: --------------------------------------- Yes, this does sound like a bug. I remember that at one point things had to be changed to get information from other places for a purchase order, and it may be that something else is creeped and that will have to be changed. Has anyone looked into this yet, i.e. where the code is that it is depending on a product store for a purchase order? > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: Release Branch 4.0, SVN trunk > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721405#action_12721405 ] Joe Eckard commented on OFBIZ-1172: ----------------------------------- Right now you will get a null pointer exception from ProductStoreWorker.getStoreCurrencyUomId, which is called during cart creation. However, if that is fixed it looks like the constructor for ShoppingCart explicitly checks for a null productStoreId and throws an IllegalArgumentException, so it won't make it much farther. > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: Release Branch 4.0, SVN trunk > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12721405#action_12721405 ] Joe Eckard edited comment on OFBIZ-1172 at 6/18/09 11:42 AM: ------------------------------------------------------------- Right now you will get a null pointer exception from ProductStoreWorker.getStoreCurrencyUomId, which is called during cart creation. However, if that is fixed it looks like the constructor for ShoppingCart explicitly checks for a null productStoreId and throws an IllegalArgumentException, so it won't make it much farther. {code} ---- runtime exception report -------------------------------------------------- Problems Processing Event Exception: java.lang.NullPointerException Message: null ---- stack trace --------------------------------------------------------------- java.lang.NullPointerException org.ofbiz.product.store.ProductStoreWorker.getStoreCurrencyUomId(ProductStoreWorker.java:95) org.ofbiz.order.shoppingcart.WebShoppingCart.<init>(WebShoppingCart.java:44) org.ofbiz.order.shoppingcart.ShoppingCartEvents.getCartObject(ShoppingCartEvents.java:821) org.ofbiz.order.shoppingcart.ShoppingCartEvents.getCartObject(ShoppingCartEvents.java:840) org.ofbiz.order.shoppingcart.ShoppingCartEvents.initializeOrderEntry(ShoppingCartEvents.java:1386) {code} was (Author: eckardjf): Right now you will get a null pointer exception from ProductStoreWorker.getStoreCurrencyUomId, which is called during cart creation. However, if that is fixed it looks like the constructor for ShoppingCart explicitly checks for a null productStoreId and throws an IllegalArgumentException, so it won't make it much farther. > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: Release Branch 4.0, SVN trunk > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12728324#action_12728324 ] Joe Eckard commented on OFBIZ-1172: ----------------------------------- It looks like removing the dependency on a ProductStore for purchase order creation will be non-trivial effort, requiring changes to the shopping cart and order entry (which will also affect sales orders). Before I go any further, does anyone know why this may have been introduced? Was there a specific reason, or was this possibly just the result of assumptions made based on sales order entry? Since our requirements are very basic, I may be overlooking something important and would hate to spend time unnecessarily. > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: Release Branch 4.0, SVN trunk > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joe Eckard updated OFBIZ-1172: ------------------------------ Attachment: po-no-product-store.patch Patch to allow PO order entry without requiring a ProductStore > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: Release Branch 4.0, SVN trunk > Reporter: Wickersheimer Jeremy > Priority: Minor > Attachments: ofbiz-1172.patch, po-no-product-store.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joe Eckard resolved OFBIZ-1172. ------------------------------- Resolution: Fixed Fix Version/s: SVN trunk Assignee: Joe Eckard ProductStore no longer required for PO entry as of rev. 795883 > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: Release Branch 4.0, SVN trunk > Reporter: Wickersheimer Jeremy > Assignee: Joe Eckard > Priority: Minor > Fix For: SVN trunk > > Attachments: ofbiz-1172.patch, po-no-product-store.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-1172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-1172. ---------------------------------- > Order Entry unclear error when no ProductStore set > -------------------------------------------------- > > Key: OFBIZ-1172 > URL: https://issues.apache.org/jira/browse/OFBIZ-1172 > Project: OFBiz > Issue Type: Improvement > Components: order > Affects Versions: Release Branch 4.0, SVN trunk > Reporter: Wickersheimer Jeremy > Assignee: Joe Eckard > Priority: Minor > Fix For: SVN trunk > > Attachments: ofbiz-1172.patch, po-no-product-store.patch > > > I ran into this issue because our staff accidentally removed the ProductStore from the OrderEntry Website. The symptom was an java NPE display when trying to create a Purchase Order. > Because it took me some time to debug it i wrote a patch to make this behavior more obvious. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. |
Free forum by Nabble | Edit this page |