Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0058217
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementminoralways2025-03-12 15:102025-03-12 18:42
ReportersofidossantView Statuspublic 
Assigned ToTriage Omni WMS 
PrioritynormalResolutionopenFixed in Version
StatusnewFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0058217: Error with selector warehouse in Sales Quotation

DescriptionWhen I create a sales quotation and add a bp, I get the warehouse incorrectly (not for order by priority).
Steps To ReproduceIf 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 SolutionThis 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
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
There are no notes attached to this issue.

- 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 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
Powered by Mantis Bugtracker