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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0041639
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 09. Financial managementmajorsometimes2019-08-13 10:232019-08-13 10:31
ReporterguillermogilView Statuspublic 
Assigned ToTriage Omni OMS 
PriorityhighResolutionduplicateFixed in Version
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesAdvanced Payables and Receivables Mngmt
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0041639: getDocumentType query is not taking into account docTypes set a isReturn

DescriptionQuery is ordering by id and not tenking into account the return.
This may have some problem while generating the shipment on the POS in the case the return one as an id higher than the not return one.

We've been able to reproduce with the functionality Issue Sales Order

  public static DocumentType getDocumentType(Organization org, String docCategory) {
    Client client = null;
    if ("0".equals(org.getId())) {
      client = OBContext.getOBContext().getCurrentClient();
      if ("0".equals(client.getId())) {
        return null;
      }
    } else {
      client = org.getClient();
    }

    OBContext.setAdminMode(false);
    try {
      StringBuilder where = new StringBuilder();
      where.append(" as dt");
      where.append(" where dt.organization.id in (:orgIdList)");
      where.append(" and dt.client.id = :clientId");
      where.append(" and dt.documentCategory = :docCategory");
      where.append(" order by ad_isorgincluded(:orgId, dt.organization.id, :clientId)");
      where.append(" , dt.default desc");
      where.append(" , dt.id desc");

      OBQuery<DocumentType> dt = OBDal.getInstance()
          .createQuery(DocumentType.class, where.toString());
      dt.setFilterOnReadableClients(false);
      dt.setFilterOnReadableOrganization(false);
      dt.setMaxResult(1);
      dt.setNamedParameter("orgIdList",
          new OrganizationStructureProvider().getParentTree(org.getId(), true));
      dt.setNamedParameter("clientId", client.getId());
      dt.setNamedParameter("docCategory", docCategory);
      dt.setNamedParameter("orgId", org.getId());

      return dt.uniqueResult();
    } finally {
      OBContext.restorePreviousMode();
    }
  }
Steps To ReproduceN/A
Proposed SolutionAdd the filter for isReturn on the query
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
has duplicate design defect 0041056 acknowledgedTriage Omni WMS Modules m_inout can have a return document type coming from a sales order 

-  Notes
(0113962)
Sandrahuguet (developer)
2019-08-13 10:31

duplicate of 41056

- Issue History
Date Modified Username Field Change
2019-08-13 10:23 guillermogil New Issue
2019-08-13 10:23 guillermogil Assigned To => Triage Finance
2019-08-13 10:23 guillermogil Modules => Advanced Payables and Receivables Mngmt
2019-08-13 10:23 guillermogil Triggers an Emergency Pack => No
2019-08-13 10:30 Sandrahuguet Relationship added has duplicate 0041056
2019-08-13 10:31 Sandrahuguet Note Added: 0113962
2019-08-13 10:31 Sandrahuguet Status new => closed
2019-08-13 10:31 Sandrahuguet Resolution open => duplicate


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker