Openbravo Issue Tracking System - Openbravo ERP | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0058217 | Openbravo ERP | 07. Sales management | public | 2025-03-12 15:10 | 2025-03-27 11:55 |
Reporter | sofidossant | ||||
Assigned To | Triage Omni WMS | ||||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | duplicate | ||
Platform | OS | 5 | OS Version | ||
Product Version | pi | ||||
Target Version | Fixed in Version | ||||
Merge Request Status | |||||
Review Assigned To | |||||
OBNetwork customer | OBPS | ||||
Web browser | |||||
Modules | Core | ||||
Support ticket | 123870 | ||||
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 | ||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
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 | OBNetwork customer | => OBPS | ||
2025-03-12 15:10 | sofidossant | Modules | => Core | ||
2025-03-12 15:10 | sofidossant | Support ticket | => 123870 | ||
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 | ||
2025-03-27 11:55 | hgbot | Note Added: 0177330 | |||
2025-03-27 11:55 | hgbot | Status | new => closed | ||
2025-03-27 11:55 | hgbot | Resolution | open => duplicate |
Notes | |||||
|
|||||
|
|