Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027452Openbravo ERP07. Sales managementpublic2014-08-24 13:592014-08-26 05:18
shuehner 
AtulOpenbravo 
immediatemajorhave not tried
closedfixed 
5
 
 
rafaroda
Core
Production - QA Approved
2014-06-07
3.0PR14Q3
https://code.openbravo.com/erp/devel/pi/rev/5596aec8b534a9690f16dea0323ff48567daf178 [^]
No
0027452: Regression in 0026054: c_orderline_trg has invalid sql
The c_orderline_trg now has the following sql:

    1.24 + SELECT max(m_reservation_id) INTO v_reservation_id
    1.25 + FROM m_reservation
    1.26 + WHERE c_orderline_id = :OLD.c_orderline_id
    1.27 + AND res_status = 'DR'
    1.28 + ORDER BY CREATED DESC;

Running this with some dummy value for line_id shows it not working by producing following error:
ERROR: column "m_reservation.created" must appear in the GROUP BY clause or be used in an aggregate function
LINE 5: ORDER BY CREATED DESC;

Also the sql does not make much sense functionally as the max will return some reservation id from the lines in the filter at random.
If that is fine the order by is not useful. If it is not than the logic is flawed.
Review that change or run it manually i.e. like this:
obpi93=# SELECT max(m_reservation_id) INTO v_reservation_id
FROM m_reservation
WHERE c_orderline_id = 'OLD.c_orderline_id'
AND res_status = 'DR'
ORDER BY CREATED DESC;
ERROR: column "m_reservation.created" must appear in the GROUP BY clause or be used in an aggregate function
LINE 5: ORDER BY CREATED DESC;

No tags attached.
caused by defect 0026054 closed rafaroda Modules Reservations are not deleted 
Issue History
2014-08-24 13:59shuehnerNew Issue
2014-08-24 13:59shuehnerAssigned To => dmiguelez
2014-08-24 13:59shuehnerModules => Core
2014-08-24 13:59shuehnerRegression level => Production - QA Approved
2014-08-24 13:59shuehnerRegression introduced in release => 3.0PR14Q3
2014-08-24 13:59shuehnerTriggers an Emergency Pack => No
2014-08-24 14:00shuehnerAssigned Todmiguelez => AtulOpenbravo
2014-08-24 14:03shuehnerRelationship addedcaused by 0026054
2014-08-24 14:03shuehnerNote Added: 0069666
2014-08-25 11:15AtulOpenbravoStatusnew => scheduled
2014-08-25 11:15AtulOpenbravofix_in_branch => pi
2014-08-25 11:28AtulOpenbravoRegression date => 2014-06-07
2014-08-25 11:28AtulOpenbravoRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/5596aec8b534a9690f16dea0323ff48567daf178 [^]
2014-08-25 11:28AtulOpenbravofix_in_branchpi =>
2014-08-25 13:15AtulOpenbravoReview Assigned To => rafaroda
2014-08-25 18:25hgbotCheckin
2014-08-25 18:25hgbotNote Added: 0069721
2014-08-25 18:25hgbotStatusscheduled => resolved
2014-08-25 18:25hgbotResolutionopen => fixed
2014-08-25 18:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c020b50ce0fe7115042027947fff24d9fb4165b8 [^]
2014-08-25 18:42rafarodaNote Added: 0069723
2014-08-25 18:42rafarodaStatusresolved => closed
2014-08-26 05:18hudsonbotCheckin
2014-08-26 05:18hudsonbotNote Added: 0069737

Notes
(0069666)
shuehner   
2014-08-24 14:03   
Found using plpgsql_check
(0069721)
hgbot   
2014-08-25 18:25   
Repository: erp/devel/pi
Changeset: c020b50ce0fe7115042027947fff24d9fb4165b8
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Aug 25 16:24:51 2014 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/c020b50ce0fe7115042027947fff24d9fb4165b8 [^]

Fixes Issue 27452:Regression in 0026054: c_orderline_trg has invalid sql

---
M src-db/database/model/triggers/C_ORDERLINE_TRG.xml
---
(0069723)
rafaroda   
2014-08-25 18:42   
Verified that Picking List is not created for products without stock but you are able to reactivate the order and change the product to generate full Picking List and Stock Reservations: see screenshots at https://drive.google.com/folderview?id=0B649lz4ZYJcHNWtVaU9jSjdNVWM&usp=sharing [^]

Also verified that fix for related issue 0026054 is now working properly on PostgreSQL.
(0069737)
hudsonbot   
2014-08-26 05:18   
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/de09123fc129 [^]
Maturity status: Test