Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0044759
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 02. Master data managementmajoralways2020-08-05 22:302020-08-14 11:57
ReportersdossantosView Statuspublic 
Assigned Toinigo_lerga 
PriorityhighResolutionfixedFixed in VersionPR20Q4
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseOracleJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0044759: It is not possible to deactivate a product with zero stock

DescriptionA new product is created and stock is added to the new product with a physical inventory.
We execute a flow of sale and purchase with the new product, without leaving any pending documents associated with the product.
The stock of the new product is changed to zero with a physical inventory.
When the stock is zero, and we want to deactivate the new product, the following error appears: "Error saving. There are lines of pending documents associated with the product. Please reactivate them before updating the product."
The error comes of the M_PRODUCT_TRG, when the following query obtain a result different to zero:
SELECT COALESCE(SUM(QtyReserved),0) , COALESCE(SUM(QtyOrdered),0)
FROM (SELECT QtyOnHand, 0 AS QtyReserved, 0 AS QtyOrdered
FROM M_Storage_Detail s
WHERE s.M_Product_ID='idproduct'
UNION
SELECT 0 AS QtyOnHand, QtyReserved, QtyOrdered
FROM M_Storage_Pending s
WHERE s.M_Product_ID='idproduct')

For some reason, the m_storage_pending is not updated.
Steps To ReproduceSpecs:
1- Create a new product.
2- Configure the price list of the new product.
3- Create a physical inventory with the new product and add stock.
4- Create a sales order with the new product. Complete it.
5- Create a good shipment with the sales order of the point 4. Complete and Post it.
6- Create a purchase order with the new product. Complete it.
7- Create a good receipt with the purchase order of point 6.
8- Control the stock of the new product and create a physical inventory and leave the stock in zero.
9- Deactivate the product.
TagsNo tags attached.
Attached Files? file icon product.mp4 [^] (3,973,276 bytes) 2020-08-05 23:52

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0121982)
hgbot (developer)
2020-08-11 13:59

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/119 [^]
(0121987)
inigo_lerga (reporter)
2020-08-11 14:48

--Test Plan Mantis HQL--
#This Issue only occurs in an environment with Oracle Database#

As the F&B International Group Admin role in Backend:
- Go to Product window and create a new record with any Name and Test Plan desired.
  Go to Price Tab and create a new record with 'Tarifa de ventas' as Price List Version
  and set any desired Unit and List Price.
  Create a new record in the same Price Tab with 'Tarifa Bebidas Alegres' as Price List
  Version and set any desired Unit and List Price.
  Save the record.

- Go to Physical Inventory window and create a new record leaving the fields as default.
  Go to Lines Tab and create a new line with the previously created poduct and 100 as
  Quantity Count. Also set 'RN-2-0-0' as Storage Bin.
  Save and process the Physical Inventory.

- Go to Sales Order window and create a new record with 'Alimentos y Supermercado' as Business Partner.
  Go to Lines Tab and create a new line with the previously created product and 20 as Ordered
  QuantityCreate a sales order with the new product.
  Save the record and complete it.

- Go to Goods Shipment window and create a new record with 'Alimentos y Supermercado' as Business
  Partner.
  Go to Lines Tab and select lines from the previous Sales Order setting 'RN-2-0-0' as Storage Bin.
  Save the record, complete it and post it.

- Go to Purchase Order window and create a new record with 'Bebidas Alegres, S.L' as Business Partner.
  Go to Lines Tab and create a new line with the previously created product and 20 as Ordered Quantity.
  Save the record and complete it.

- Go to Goods Receipt window and create a new record with 'Bebidas Alegres, S.L.' as Business Partner.
  Go to Lines Tab and select lines from the previous Purchase Order setting 'RN-2-0-0' as Storage Bin.
  Save the record, complete it and post it.

- Go back to Physical Inventory window and create a new record leaving the fields as default.
  Go to Lines Tab and create a new line with the previously created poduct and 0 as
  Quantity Count. Also set 'RN-2-0-0' as Storage Bin.
  Save and process the Physical Inventory.

- Go back to Product window and disable the Active checkbox in the record of the previously created product.

#Now this workflow is successfully executed"
(0122064)
hgbot (developer)
2020-08-14 11:57

Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/119 [^]
(0122065)
hgbot (developer)
2020-08-14 11:57

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 60f9d67859046a105b4458386de33aeffeaeb013
Author: inigo_lerga <inigo.lerga@openbravo.com>
Date: 2020-08-14T09:57:06+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/60f9d67859046a105b4458386de33aeffeaeb013 [^]

fixes BUG-44759:Avoided comparation with null in Oracle

When doing a comparison like ''<>'OB', the '' part
is considered as NULL by Oracle, which causes an
error. This patch fixes that.

---
M src-db/database/model/functions/C_ORDER_POST1.xml
---

- Issue History
Date Modified Username Field Change
2020-08-05 22:30 sdossantos New Issue
2020-08-05 22:30 sdossantos Assigned To => Triage Finance
2020-08-05 22:30 sdossantos Modules => Core
2020-08-05 22:30 sdossantos Triggers an Emergency Pack => No
2020-08-05 23:52 sdossantos File Added: product.mp4
2020-08-07 09:10 ngarcia Resolution time => 1566943200
2020-08-07 09:28 ngarcia Resolution time 1566943200 => 1598565600
2020-08-10 14:47 dmiguelez Assigned To Triage Finance => inigo_lerga
2020-08-11 08:22 inigo_lerga Status new => scheduled
2020-08-11 13:59 hgbot Note Added: 0121982
2020-08-11 14:48 inigo_lerga Note Added: 0121987
2020-08-14 11:57 hgbot Note Added: 0122064
2020-08-14 11:57 hgbot Resolution open => fixed
2020-08-14 11:57 hgbot Status scheduled => closed
2020-08-14 11:57 hgbot Fixed in Version => PR20Q4
2020-08-14 11:57 hgbot Note Added: 0122065


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker