Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031835Openbravo ERP02. Master data managementpublic2016-01-08 08:552016-03-17 10:54
VictorVillar 
aferraz 
immediatemajoralways
closedfixed 
5
pi 
3.0PR16Q2 
vmromanos
Core
No
0031835: Not possible to change the product definition to Stocked under some circumstancies
Not possible to change the product definition to Stocked under some circumstancies
As group admin role,
 Go to Product window:
   Create a new one. Item and stocked = Y
   Org: *
  Price list: Bebidas alegres

Go to physical inventory:
 add 1 unit of this product
Process it.

Go to Goods Shipment window and add 1 unit of this product.
Process it.

Change the definition of the product as Service.

Try to change the definition to Item and Stocked again. You can not do that.

Error: You cannot change the product to stocked because it has completed documents which would generate inventory transactions
If there is a warehouse/sales order document related with a product it should not be possible to change the stocked flag.
No tags attached.
depends on backport 00318483.0PR16Q1 closed aferraz Not possible to change the product definition to Stocked under some circumstancies 
depends on backport 00318493.0PR15Q4.2 closed aferraz Not possible to change the product definition to Stocked under some circumstancies 
caused by defect 0025930 closed aferraz It should not be possible to change the product definition 
related to defect 0031833 closed aferraz Inconsistent data in M_STORAGE_PENDING table if the product is changed from Not Stocked to Stocked having pending orders 
related to defect 0032364 closed AtulOpenbravo NullPointerException when posting a Physical Inventory with a line without an associated transaction (not stocked product) 
Issue History
2016-01-08 08:55VictorVillarNew Issue
2016-01-08 08:55VictorVillarAssigned To => Triage Finance
2016-01-08 08:55VictorVillarModules => Core
2016-01-08 08:55VictorVillarTriggers an Emergency Pack => No
2016-01-08 08:56VictorVillarRelationship addedcaused by 0025930
2016-01-08 08:56VictorVillarIssue Monitored: networkb
2016-01-08 09:05aferrazAssigned ToTriage Finance => aferraz
2016-01-08 15:03aferrazStatusnew => scheduled
2016-01-11 13:39aferrazRelationship addedrelated to 0031833
2016-01-12 18:22gorka_gilTarget Version3.0PR15Q4.2 => 3.0PR16Q2
2016-01-13 10:19ngarciaIssue Monitored: ngarcia
2016-01-13 11:16aferrazNote Added: 0083225
2016-01-13 16:22hgbotCheckin
2016-01-13 16:22hgbotNote Added: 0083249
2016-01-13 16:22hgbotStatusscheduled => resolved
2016-01-13 16:22hgbotResolutionopen => fixed
2016-01-13 16:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e3220d26e44f380077a80496a883e07c7f4a1b9e [^]
2016-01-13 16:22hgbotCheckin
2016-01-13 16:22hgbotNote Added: 0083250
2016-01-13 16:32vmromanosReview Assigned To => vmromanos
2016-01-13 16:32vmromanosNote Added: 0083254
2016-01-13 16:32vmromanosStatusresolved => closed
2016-02-26 14:00ngarciaRelationship addedrelated to 0032364
2016-03-17 10:54hudsonbotCheckin
2016-03-17 10:54hudsonbotNote Added: 0085037
2016-03-17 10:54hudsonbotCheckin
2016-03-17 10:54hudsonbotNote Added: 0085038

Notes
(0083225)
aferraz   
2016-01-13 11:16   
Test plan I:

- Create a stocked product.
- Create a purchase order for that product but do not book it.
- Try to change the product to no stocked.
  An error is shown: "You cannot change the product stocked flag because it has related documents"
- Book the purchase order.
- Try to change the product to no stocked.
  An error is shown: "You cannot change the product stocked flag because it has related documents"

Test plan II:

- Create a no stocked product.
- Create a purchase order for that product but do not book it.
- Try to change the product to stocked.
  An error is shown: "You cannot change the product stocked flag because it has related documents"
- Book the purchase order.
- Try to change the product to stocked.
  An error is shown: "You cannot change the product stocked flag because it has related documents"

Repeat test I and II using sales order, purchase invoice, sales invoice, goods receipt, goods shipment, goods movement, internal consumption, physical inventory and bill of materials production instead of purchase order.
(0083249)
hgbot   
2016-01-13 16:22   
Repository: erp/devel/pi
Changeset: e3220d26e44f380077a80496a883e07c7f4a1b9e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Jan 11 17:23:56 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e3220d26e44f380077a80496a883e07c7f4a1b9e [^]

Fixes issue 31835: Not possible to change product to stocked

Stocked flag in Product window will not be updatable in case product is present in any order, invoice or warehouse document.

---
M src-db/database/model/triggers/M_PRODUCT_TRG.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0083250)
hgbot   
2016-01-13 16:22   
Repository: erp/devel/pi
Changeset: 8d9510cd867e959b53fec9be671e3370bc33050f
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Wed Jan 13 15:31:26 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8d9510cd867e959b53fec9be671e3370bc33050f [^]

Related to issue 31835: code review improvements

The old messages have been reverted because it could be used by external modules, so it could be considered as a functional API Change.
Create a new message instead and improve it to be more descriptive.

Modified pl/sql comment to reflect the new behavior and to avoid confusions in the future

---
M src-db/database/model/triggers/M_PRODUCT_TRG.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0083254)
vmromanos   
2016-01-13 16:32   
Code review + testing OK
(0085037)
hudsonbot   
2016-03-17 10:54   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b22fb0500156 [^]
Maturity status: Test
(0085038)
hudsonbot   
2016-03-17 10:54   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b22fb0500156 [^]
Maturity status: Test