Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039109Openbravo ERP06. Material requirement planning (MRP)public2018-08-09 10:292018-08-30 18:48
gorkaion 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q4 
Sandrahuguet
Core
No
0039109: Create Reservations fails on MRP Purchase Plan without attributes
On Purchase Plan once the purchase orders are generated if the product does not use attributes the Create Reservations fails while generating the pre-reservations.

Error shown:
org.openbravo.base.exception.OBException: ERROR: null value in column "m_attributesetinstance_id" violates not-null constraint Detail: Failing row contains (50BF46FB533A401195AB6AF2102DFA30, 23C59575B9CF467C9620760EB255B389, 2E60544D37534C0B89E765FE29BC0B43, Y, 2018-08-09 10:16:30, 100, 2018-08-09 10:16:30, 100, D49EAB61E6A84BD2B2E9BCA68872281E, F58F03F406FD4705B59E90D70715281C, 6, N, null, null, 0, N). Where: SQL statement "INSERT INTO m_reservation_stock( m_reservation_stock_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, m_reservation_id, m_attributesetinstance_id, m_locator_id, c_orderline_id, quantity, releasedqty, isallocated ) VALUES ( v_reservation_stock_id, v_client_id, v_org_id, 'Y', TO_DATE(NOW()), p_user_id, TO_DATE(NOW()), p_user_id, p_reservation_id, v_asi_id, v_locator_id, v_poline_id, p_qty, 0, p_allocated )" PL/pgSQL function m_reserve_stock_manual(character varying,character varying,character varying,numeric,character varying,character varying) line 110 at SQL statement
On an instance proffesional with the MRP module available.
1. Create a new item product and add it to a purchase and a sales pricelist.
2. Create a purchase order of the product of 10 units.
3. Create a sales order of the product of 6 units.
4. Create a Purchase Plan header.
5. Add a purchase plan line with:
- Type Pending Sales Order.
- Dates current
- Quantities -6
- Select the sales order line previously created.
6. Add a purchase plan line with:
- Type Suggested Purchase Order.
- Dates current
- Quantities 10
- Select the purchase order line previously created.
7. Click on Create Reservations button.
The m_reserve_stock_manual procedure does not properly initialize the v_asi_id variable cuasing the insert into error trying to set a null value.
No tags attached.
Issue History
2018-08-09 10:29gorkaionNew Issue
2018-08-09 10:29gorkaionAssigned To => Triage Finance
2018-08-09 10:29gorkaionModules => Core
2018-08-09 10:29gorkaionResolution time => 1535580000
2018-08-09 10:29gorkaionTriggers an Emergency Pack => No
2018-08-09 10:46SandrahuguetAssigned ToTriage Finance => AtulOpenbravo
2018-08-10 09:23PracticsIssue Monitored: Practics
2018-08-20 06:50AtulOpenbravoStatusnew => scheduled
2018-08-20 07:02AtulOpenbravoNote Added: 0106395
2018-08-30 14:38hgbotCheckin
2018-08-30 14:38hgbotNote Added: 0106536
2018-08-30 14:38hgbotStatusscheduled => resolved
2018-08-30 14:38hgbotResolutionopen => fixed
2018-08-30 14:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c516c88b947d0c9eed0902fa779ea5558070948d [^]
2018-08-30 14:39SandrahuguetReview Assigned To => Sandrahuguet
2018-08-30 14:39SandrahuguetNote Added: 0106537
2018-08-30 14:39SandrahuguetStatusresolved => closed
2018-08-30 14:39SandrahuguetFixed in Version => 3.0PR18Q4
2018-08-30 18:48hudsonbotCheckin
2018-08-30 18:48hudsonbotNote Added: 0106549

Notes
(0106395)
AtulOpenbravo   
2018-08-20 07:02   
Test Plan

In an instance proffesional with the MRP module available.

- Create a new item product and add it to a purchase and a sales pricelist.
- Create a purchase order of the product of 10 units.
- Create a sales order of the product of 6 units.
- Create a Purchase Plan header.
- Add a purchase plan line with:
  - Type Pending Sales Order.
  - Date: Current Date
  - Quantities -6
  - Select the sales order line previously created.
- Add a purchase plan line with:
  - Type Suggested Purchase Order.
  - Date: Current Date
  - Quantities 10
  - Select the purchase order line previously created.
- Click on Create Reservations button, realize that stock reservation for purchase order line is created successfully.
(0106536)
hgbot   
2018-08-30 14:38   
Repository: erp/devel/pi
Changeset: c516c88b947d0c9eed0902fa779ea5558070948d
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Aug 20 10:48:39 2018 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/c516c88b947d0c9eed0902fa779ea5558070948d [^]

Fixes Issue 39109: Create Reservations fails on MRP Purchase Plan
 without attributes

Initialize v_asi_id in m_reserve_stock_manual with default value
of attributesetinstance as 0

---
M src-db/database/model/functions/M_RESERVE_STOCK_MANUAL.xml
---
(0106537)
Sandrahuguet   
2018-08-30 14:39   
code review + testing OK
(0106549)
hudsonbot   
2018-08-30 18:48   
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/f018f6d60a65 [^]
Maturity status: Test