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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0015834
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2011-02-01 16:382011-02-15 00:00
ReportermiruritaView Statuspublic 
Assigned Tomirurita 
PriorityhighResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionfc82f636ea78
ProjectionnoneETAnoneTarget Version3.0RC4
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

0015834: @AD_Org_Id@ not working properly in a default value for a column

DescriptionThe FIN_Payment_Priority_ID column of C_Invoice and C_Order tables has the following default value:

@SQL=SELECT FIN_Payment_Priority_ID FROM FIN_Payment_Priority WHERE AD_ISORGINCLUDED(@AD_Org_ID@, AD_Org_ID, @#AD_Client_ID@) <> -1 AND Isdefault = 'Y' ORDER BY Priority

For example in SalesInvoice, looking at the WAD generated code in
org.openbravo.erpWindows.SalesInvoice.Header.java

it gets the default value for payment priority using this sql
SELECT FIN_Payment_Priority_ID FROM FIN_Payment_Priority WHERE AD_ISORGINCLUDED(?, AD_Org_ID, ?) <> -1 AND Isdefault = 'Y' ORDER BY Priority

and the first parameter is passes through

Line 864
data = HeaderData.set(HeaderData.selectDef0445FEDA79A747C48A7B3EF852D176DC(this, Utility.getContext(this, vars, "AD_Org_ID", "167"), ...)

When creating a new Sales Invoice the Utility.getContext(this, vars, "AD_Org_ID", "167") stores the organization id of the last visited (opened in edit view) sales invoice.

You will realize that if you first open in edit view a sales invoice of organization Main and then you create a new sales invoice the
Utility.getContext(this, vars, "AD_Org_ID", "167")
will return '1000000', which is the Main id. But the combo box of organization is selecting organization A.

If you open in edit view a sales invoice of organization A and then you create a new sales invoice the
Utility.getContext(this, vars, "AD_Org_ID", "167")
will return '1000002', which is the A id.
On this case the payment priority default value will be properly assigned.
Steps To Reproduce1) In 2.50 environment clone and install Payment Priorities module
https://code.openbravo.com/erp/pmods/org.openbravo.financial.paymentpriorities/ [^]
1.1) Download from central repository last Selector for 2.50 module.
1.2) Clone APRM for 2.50
https://code.openbravo.com/erp/pmods/org.openbravo.advpaymentmngt/ [^]

2) Go to Financial Management || Receivables & Payables || Setup || Payment Priority || Payment Priority window and create the following priorities:
Org: A
Name: High
Priority: 1
Default: No

Org: A
Name: Standard
Priority: 2
Default: Yes

At this point, if we create a new Sales/Purchase Invoice/Order for organization A it should select by default 'Standard' payment priority.

3) Important: open in edit view a existing Sales Invoice for organization Main.

4) Click on new button and notice that the payment priority is empty.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 00159472.50MP27 closedmirurita @AD_Org_Id@ not working properly in a default value for a column 

-  Notes
(0034140)
hgbot (developer)
2011-02-10 19:57

Repository: erp/devel/pi
Changeset: fc82f636ea78dee874cf36439b23226b84790fef
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Thu Feb 10 19:56:03 2011 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/fc82f636ea78dee874cf36439b23226b84790fef [^]

Fixes issue 15834: @AD_Org_Id@ not working properly

---
M src-db/database/sourcedata/AD_COLUMN.xml
---
(0034182)
psanjuan (manager)
2011-02-14 16:59

fixed and working

- Issue History
Date Modified Username Field Change
2011-02-01 16:38 mirurita New Issue
2011-02-01 16:38 mirurita Assigned To => alostale
2011-02-01 16:38 mirurita Modules => Core
2011-02-01 16:40 mirurita File Added: aprm.diff
2011-02-01 16:40 mirurita File Added: core.diff
2011-02-01 16:40 mirurita Summary Default value @AD_Org_Id@ value not working properly => @AD_Org_Id@ not working properly in a default value for a column
2011-02-01 16:41 mirurita Target Version => 2.50MP27
2011-02-01 19:12 mirurita Steps to Reproduce Updated View Revisions
2011-02-01 19:12 mirurita File Deleted: aprm.diff
2011-02-01 19:13 mirurita File Deleted: core.diff
2011-02-07 08:31 alostale Status new => scheduled
2011-02-10 19:53 mirurita Assigned To alostale => mirurita
2011-02-10 19:57 hgbot Checkin
2011-02-10 19:57 hgbot Note Added: 0034140
2011-02-10 19:57 hgbot Status scheduled => resolved
2011-02-10 19:57 hgbot Resolution open => fixed
2011-02-10 19:57 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fc82f636ea78dee874cf36439b23226b84790fef [^]
2011-02-10 19:58 mirurita Status resolved => new
2011-02-10 19:58 mirurita Resolution fixed => open
2011-02-10 19:59 mirurita Status new => scheduled
2011-02-10 19:59 mirurita fix_in_branch => pi
2011-02-10 19:59 mirurita version 2.50MP25EU2 => pi
2011-02-10 19:59 mirurita Target Version 2.50MP27 => 3.0RC4
2011-02-10 19:59 mirurita fix_in_branch pi =>
2011-02-10 20:00 mirurita Status scheduled => resolved
2011-02-10 20:00 mirurita Resolution open => fixed
2011-02-14 16:59 psanjuan Note Added: 0034182
2011-02-14 16:59 psanjuan Status resolved => closed
2011-02-15 00:00 anonymous sf_bug_id 0 => 3181409


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker