Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0043215Openbravo ERP02. Master data managementpublic2020-02-13 11:052020-03-03 11:24
salvador_campanella 
AtulOpenbravo 
normalminoralways
closedfixed 
5
 
3.0PR20Q2 
dmiguelez
Core
No
0043215: IIt is impossible to delete products because of dependency with m_store_pending table
It is impossible to delete products because of dependency with m_store_pending table
Tested on Livebuilds
- Go to the product window and create a new product
- Assign a new price for the price list "Tarifa Bebidas Alegres"
- Assing a new price for the price list "Tarifa de ventas"
- Go to the Sales Order Window
- Create a new order
- On the lines tab add the product created before
- Book the order clicking the book button
- Click on the close button and reactivate the order
- Edit the line created before changing the product for another one
- Book the order clicking the book button
- Go to the product window and select the product created before
- Delete the lines from the prince and accounting tabs
- Try to delete the product

Result: it's not possible

- try to delete the product directly from the database and the following message appears

------------------------------------------
'''ERROR: update or delete on table "m_product" violates foreign key constraint "m_storage_pending_m_product" on table "m_storage_pending"
DETAIL: Key (m_product_id)=(44C8B4AFBB764515994726F4E3EC66DF) is still referenced from table "m_storage_pending".
********* Error *********

ERROR: update or delete on table "m_product" violates foreign key constraint "m_storage_pending_m_product" on table "m_storage_pending"
SQL state: 23503
Detail: Key (m_product_id)=(44C8B4AFBB764515994726F4E3EC66DF) is still referenced from table "m_storage_pending".
------------------------------------------

- If you check this line in m_storage_pending the qtyreserved column value is 0 and should be possible delete the product
No tags attached.
depends on defect 0043368 closed AtulOpenbravo API Change: Foreign Key Definition for M_Product_ID in M_Storage_Pending changed 
Issue History
2020-02-13 11:05salvador_campanellaNew Issue
2020-02-13 11:05salvador_campanellaAssigned To => Triage Finance
2020-02-13 11:05salvador_campanellaModules => Core
2020-02-13 11:05salvador_campanellaTriggers an Emergency Pack => No
2020-02-18 15:48PracticsIssue Monitored: Practics
2020-02-25 07:58AtulOpenbravoStatusnew => scheduled
2020-02-25 07:58AtulOpenbravoNote Added: 0118066
2020-02-28 11:17AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2020-02-28 11:29AtulOpenbravoRelationship addeddepends on 0043368
2020-03-02 10:16hgbotCheckin
2020-03-02 10:16hgbotNote Added: 0118226
2020-03-02 10:16hgbotStatusscheduled => resolved
2020-03-02 10:16hgbotResolutionopen => fixed
2020-03-02 10:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/595393125a8968a8b8025b82244b2209a325649f [^]
2020-03-02 10:16hgbotCheckin
2020-03-02 10:16hgbotNote Added: 0118227
2020-03-02 10:16hgbotCheckin
2020-03-02 10:16hgbotNote Added: 0118228
2020-03-03 11:24dmiguelezReview Assigned To => dmiguelez
2020-03-03 11:24dmiguelezNote Added: 0118289
2020-03-03 11:24dmiguelezStatusresolved => closed
2020-03-03 11:24dmiguelezFixed in Version => 3.0PR20Q2

Notes
(0118066)
AtulOpenbravo   
2020-02-25 07:58   
Test Plan

- Go to the product window and create a new product:-
  Search key: 43215
  Name: Test Product 43215
- Assign a new price for the price list "Tarifa Bebidas Alegres".
- Assign a new price for the price list "Tarifa de ventas".
- Go to the Sales Order Window.
- Create a new order.
- On the lines tab add the product "Test Product 43215"
- Book the order.
- Click on the close button and reactivate the order
- Edit the line created before c
- Book the order.
- Go to the product window and select the product "Test Product 43215"
- Try to delete the product
- Realize that product is deleted successfully.

Same plan could be successfully executed for Purchase flow.
(0118226)
hgbot   
2020-03-02 10:16   
Repository: erp/devel/pi
Changeset: 595393125a8968a8b8025b82244b2209a325649f
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Feb 26 11:23:39 2020 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/595393125a8968a8b8025b82244b2209a325649f [^]

Fixes BUG-0043215: It is impossible to delete products
because of dependency with m_store_pending table

**Foreign Key for M_PRODUCT_ID in M_STORAGE_PENDING is
set as ON DELETE CASCADE so that when product is being
deleted and is not associated with any transaction,
then record associated with M_Storage_Pending gets
deleted.

---
M src-db/database/model/tables/M_STORAGE_PENDING.xml
---
(0118227)
hgbot   
2020-03-02 10:16   
Repository: erp/devel/pi
Changeset: 595393125a8968a8b8025b82244b2209a325649f
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Feb 26 11:23:39 2020 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/595393125a8968a8b8025b82244b2209a325649f [^]

Fixes BUG-0043215: It is impossible to delete products
because of dependency with m_store_pending table

**Foreign Key for M_PRODUCT_ID in M_STORAGE_PENDING is
set as ON DELETE CASCADE so that when product is being
deleted and is not associated with any transaction,
then record associated with M_Storage_Pending gets
deleted.

---
M src-db/database/model/tables/M_STORAGE_PENDING.xml
---
(0118228)
hgbot   
2020-03-02 10:16   
Repository: erp/devel/pi
Changeset: 595393125a8968a8b8025b82244b2209a325649f
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Feb 26 11:23:39 2020 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/595393125a8968a8b8025b82244b2209a325649f [^]

Fixes BUG-0043215: It is impossible to delete products
because of dependency with m_store_pending table

**Foreign Key for M_PRODUCT_ID in M_STORAGE_PENDING is
set as ON DELETE CASCADE so that when product is being
deleted and is not associated with any transaction,
then record associated with M_Storage_Pending gets
deleted.

---
M src-db/database/model/tables/M_STORAGE_PENDING.xml
---
(0118289)
dmiguelez   
2020-03-03 11:24   
Code Review + Testing Ok