Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0058217 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
defect | [Openbravo ERP] 07. Sales management | minor | always | 2025-03-12 15:10 | 2025-03-12 18:42 | |||||||
Reporter | sofidossant | View Status | public | |||||||||
Assigned To | Triage Omni WMS | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | Fix in branch | Fixed in SCM revision | |||||||||
Projection | none | ETA | none | Target Version | ||||||||
OS | Any | Database | Any | Java version | ||||||||
OS Version | Database version | Ant version | ||||||||||
Product Version | pi | SCM revision | ||||||||||
Review Assigned To | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0058217: Error with selector warehouse in Sales Quotation | |||||||||||
Description | When I create a sales quotation and add a bp, I get the warehouse incorrectly (not for order by priority). | |||||||||||
Steps To Reproduce | If I have two warehouses defined as follows in an organization X, for example in ID m_warehouse_id | priority ----------------------------------+---------- 8522B31040604AB98F2B44D1E00CB10E | 1 E5A38EC28320451DA813D1A7AF2A54C2 | 0 When I created a sales quotation with a org X and one bp, the SE_Order_BPartner callout is triggered, which uses: String strMwarehouse = strIsSOTrx.equals("N") ? SEOrderBPartnerData.mWarehouse(this, strBPartner) : SEOrderBPartnerData.mWarehouseOnhand(this, strOrgId); This in Sales Quotation use: select m_warehouse_id, priority from ad_org_warehouse where ad_org_id = 'X' and (select isactive from m_warehouse where m_warehouse_id=ad_org_warehouse.m_warehouse_id)='Y' group by m_warehouse_id, priority having min(priority) = priority For my org X should bring me first the 0 warehouse and then the priority 1 warehouse. But the result is: m_warehouse_id | priority ----------------------------------+---------- 8522B31040604AB98F2B44D1E00CB10E | 1 E5A38EC28320451DA813D1A7AF2A54C2 | 0 if I change the having to select m_warehouse_id, priority from ad_org_warehouse where ad_org_id = 'X' and (select isactive from m_warehouse where m_warehouse_id=ad_org_warehouse.m_warehouse_id)='Y' group by priority, m_warehouse_id having min(priority) = priority m_warehouse_id | priority ----------------------------------+---------- E5A38EC28320451DA813D1A7AF2A54C2 | 0 8522B31040604AB98F2B44D1E00CB10E | 1 | |||||||||||
Proposed Solution | This error is PostgreSQL does not guarantee a specific order in the results unless ORDER BY is used. Changing the order of the fields in GROUP BY should not affect the content of the results, but it may change the order in which they are processed and returned. We need to add the order by priority, to help to the query | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
![]() |
|
![]() |
|||
Date Modified | Username | Field | Change |
2025-03-12 15:10 | sofidossant | New Issue | |
2025-03-12 15:10 | sofidossant | Assigned To | => Triage Omni OMS |
2025-03-12 15:10 | sofidossant | Modules | => Core |
2025-03-12 15:10 | sofidossant | Triggers an Emergency Pack | => No |
2025-03-12 18:42 | aferraz | Assigned To | Triage Omni OMS => Triage Omni WMS |
Copyright © 2000 - 2009 MantisBT Group |