[
https://issues.apache.org/jira/browse/OFBIZ-12455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17519174#comment-17519174
]
ASF subversion and git services commented on OFBIZ-12455:
---------------------------------------------------------
Commit 08cd4d01be13217441b1d6df4b735808510c3a50 in ofbiz-framework's branch
refs/heads/trunk from Giulio Speri
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=08cd4d01be ]
Fixed: inv. reservation places order if not enough qty (OFBIZ-12455)
If quantity not reserved is not 0, requireInventory is set to Y, system
let an order to be placed anyway.
The usage of the service around the project let make an important
assertion: we can consider that also reserveInventory flag of the
ProductStore is Y, since right now is always the caller context that
checks for the reserveInventory flag.
This fix simply returns a specific error to the caller, avoiding the
system to place the order.
Thanks Nicola Mazzoni for helping in debug this issue and Jacopo
Cappellato for the patch review.
> Product inventory reservation places orders if quantityNotReserved !=0 and
> requireInventory=Y
> ---------------------------------------------------------------------------------------------
>
> Key: OFBIZ-12455
> URL: https://issues.apache.org/jira/browse/OFBIZ-12455
> Project: OFBiz
> Issue Type: Bug
> Components: ecommerce, order
> Affects Versions: Trunk, 17.12.08, 18.12.01, 18.12.02, 18.12.03, Upcoming
> Branch
> Environment: Linux/Ubuntu 20.04 LTS, Java 8
> Reporter: Giulio Speri
> Assignee: Giulio Speri
> Priority: Major
> Labels: backport-needed
> Attachments: OFBIZ-12455_14122021_trunk.patch
>
>
> The service *reserveProductInventoryByFacility* (file
> InventoryReserveServices.xml) simply do nothing in case quantityNotReserved
> value is not 0, but (ProductStore) requireInventory = Y.
> Now, no action is taken and quantityNotReserved is simply returned to the
> caller (ie: reserveStoreInventory).
> In this scenario an order can be placed despite there is no available
> inventory to fulfill an order item, causing backorder (that we wanted to
> avoid setting requireInventory flag on the ProductStore to Y ).
>
> {code:java}
> <if-compare field="parameters.quantityNotReserved" operator="not-equals"
> value="0" type="BigDecimal">
> <if-compare field="parameters.requireInventory" operator="equals" value="Y">
> <!-- use this else pattern to accomplish the anything but Y logic, ie if
> not specified default to inventory NOT required -->
> <else> {code}
> I checked the usage of the service around the project and it seems to me that
> we can make an important assertion: we can consider that also
> requireInventory flag of the ProductStore is Y.
>
> This issue is strictly related to OFBIZ-12264 issue.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)