{"action":"opened","issue":{"url":"https://api.github.com/repos/adempiere/adempiere/issues/426","repository_url":"https://api.github.com/repos/adempiere/adempiere","labels_url":"https://api.github.com/repos/adempiere/adempiere/issues/426/labels{/name}","comments_url":"https://api.github.com/repos/adempiere/adempiere/issues/426/comments","events_url":"https://api.github.com/repos/adempiere/adempiere/issues/426/events","html_url":"https://github.com/adempiere/adempiere/issues/426","id":159913959,"number":426,"title":"MPPOrderBOMLine release stock reservation BUG","user":{"login":"bpali","id":1118313,"avatar_url":"https://avatars.githubusercontent.com/u/1118313?v=3","gravatar_id":"","url":"https://api.github.com/users/bpali","html_url":"https://github.com/bpali","followers_url":"https://api.github.com/users/bpali/followers","following_url":"https://api.github.com/users/bpali/following{/other_user}","gists_url":"https://api.github.com/users/bpali/gists{/gist_id}","starred_url":"https://api.github.com/users/bpali/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bpali/subscriptions","organizations_url":"https://api.github.com/users/bpali/orgs","repos_url":"https://api.github.com/users/bpali/repos","events_url":"https://api.github.com/users/bpali/events{/privacy}","received_events_url":"https://api.github.com/users/bpali/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-13T10:00:39Z","updated_at":"2016-06-13T10:00:39Z","closed_at":null,"body":"Say you have a draft Manufacturing Order document.\r\n\r\nIf you decrease the quantity on it, the components stock reservation should decrease also, but instead of decreasing proportionally with the order, they increase by the new amount required.\r\n\r\nThis bug is created by the condition imposed to the release of stock reservation (see below code)\r\n\r\n_org.eevolution.model.MPPOrderBOMLine.beforeDelete()_\r\n```java\r\nprotected boolean beforeDelete()\r\n{\r\n\t// Release Reservation\r\n\tif(MPPOrder.DOCSTATUS_InProgress.equals(getParent().getDocStatus()) || \r\n\t   MPPOrder.DOCSTATUS_Completed.equals(getParent().getDocStatus()))\r\n\t{\t\r\n\t\tsetQtyRequired(Env.ZERO);\r\n\t\treserveStock();\r\n\t}\t\t\t\r\n\treturn true;\r\n}\r\n```\r\n\r\n which should simply be\r\n\r\n```java\r\nprotected boolean beforeDelete()\r\n{\r\n\t// Release Reservation\r\n\tsetQtyRequired(Env.ZERO);\r\n\treserveStock();\r\n\treturn true;\r\n}\r\n```\r\n\r\nbecause Manufacturing Order documents do stock reservation even when they are \"Draft\" status"}}
{"actor":{"display_login":"bpali"}}