Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0009561Openbravo ERP00. Application dictionarypublic2009-06-19 13:212012-09-13 10:43
FrancescoFinamore 
dmiguelez 
highminorhave not tried
scheduledopen 
20rPath Linux
2.50MP1 
 
Core
No
0009561: Default value of Country
I have set on Table of Country the Default Country = Italy ,
but when i try to create a bank account for a Business Partner the Default Value
is Spain.
On the Tab of BP Bank Account there isn't a Default Value.
(The same problem when i try to create a Location)
 
1) Go to General Setup || Application || Preference
2) Edit record C_Counrty_ID and set 214 (Italy)
SELECT NAME AS COUNTRY, C_COUNTRY_ID AS ID
FROM C_COUNTRY
WHERE UPPER(NAME) LIKE '%CHINA%' OR UPPER(NAME) LIKE '%ITALY%'
3) Log out and log in again.
4) Go to Master Data Management || Business Partner || Business Partner >> Bank Account and create a new record: Italy is selected by default in Country drop-down: OK
5) Go to Master Data Management || Business Partner || Business Partner >> Location/Address and create a new record: in Location selector Spain is selected by default instead of Italy: WRONG
No tags attached.
Issue History
2009-06-19 13:21FrancescoFinamoreNew Issue
2009-06-19 13:21FrancescoFinamoreAssigned To => rafaroda
2009-06-30 19:51psarobeNote Added: 0017690
2009-06-30 19:51psarobeStatusnew => feedback
2009-08-07 07:33luciaguNote Added: 0018871
2009-08-31 11:08rafarodaAssigned Torafaroda => jeneivemalarkodi
2009-08-31 11:08rafarodaPrioritynormal => high
2009-08-31 11:08rafarodaStatusfeedback => scheduled
2009-08-31 11:08rafarodaProposed Solution updated
2009-08-31 11:09rafarodaProposed Solution updated
2010-03-10 11:02rafarodaAssigned Tojeneivemalarkodi => adrianromero
2011-06-03 11:00dalsasuaAssigned Toadrianromero => dalsasua
2011-07-20 18:12dalsasuaAssigned Todalsasua => jonalegriaesarte
2011-10-28 18:10psarobeNote Added: 0042281
2011-10-28 18:11psarobeTypedefect => design defect
2012-09-13 10:43jonalegriaesarteAssigned Tojonalegriaesarte => dmiguelez

Notes
(0017690)
psarobe   
2009-06-30 19:51   
Hi Francesco,

Please take a look into the preference window. You probably have defined Spain as default country.

Waiting for your news
(0018871)
luciagu   
2009-08-07 07:33   
I have the same question about default country selection. In location search window, the default country remains spain.But I have changed the default country to China.

And I go to preference window, finding no definition record about Spain as default country.

Can you give some advice?
(0042281)
psarobe   
2011-10-28 18:10   
The default country is calculated like this:

String strDefaultCountry = LocationSearchData.selectDefaultCountry(this, vars.getOrg(),
          Utility.getContext(this, vars, "#User_Client", strWindow));
      if (strDefaultCountry.equals("")) {
        strDefaultCountry = "106";

And the query for LocationSearchData.selectDefaultCountry is:

 <SqlMethod name="selectDefaultCountry" type="preparedStatement" return="String">
   <SqlMethodComment>Select Organization</SqlMethodComment>
   <Sql><![CDATA[
    SELECT MIN(l.C_COUNTRY_ID) FROM AD_ORG o
                left join AD_ORGINFO oinf on oinf.AD_ORG_ID = o.AD_ORG_ID
                left join C_LOCATION l on oinf.C_LOCATION_ID = l.C_LOCATION_ID
    WHERE
     ? IN (o.AD_ORG_ID, '0')
    AND o.ISACTIVE = 'Y'
    AND o.AD_Client_ID IN ('1')
    ]]></Sql>
   <Parameter name="adOrgId"/>
   <Parameter name="adUserClient" type="replace" optional="true" after="o.AD_Client_ID IN (" text="'1'"/>
   </SqlMethod>
</SqlClass>

So it calculates the default country based on the organization info tab of the logged organization. If there is no data then it puts spain