Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0004485Openbravo ERP01. General setuppublic2008-07-22 14:252011-02-04 09:16
andrewballantine 
rmorley 
normalminoralways
acknowledgedopen 
5
2.35MP4 
 
Core
No
0004485: Setting country as default does not clear previous default
When setting a country to be the default the system merely set the default with no further action, thus any other country that has the default flag set is also default.
By definition you can only have one DEFAULT.
The problem is compounded by the fact that the country definitions are shared by all clients of the system.

As currently coded separate clients cannot have different default countries.

This bug affects Import routines.
go to
General Setup || Application || Country Region and City || Country
Set a country to be default, set another country to be default.
Go to grid view & click the header of the default column.
You have two countries set as default.
Change to a different client and repeat with different countries.
You now have four countries set as default.
Initially the system has all countries defined under System (client_ID=0)
and US set as default.
When a client sets a country as default a NEW country record should be created, if one does not exist, using the current client_ID (e.g. not 0) and then set as the default country.
Then set ALL other countries, for this client, isdefault = 'N'

This way each client can have their own default country without affecting the data of other clients.

However, in the current version, there is a restraint on the country code to be unique, so this would need to be changed to be unique per client.

Alternatively enforce a single default country and make this a system administrator only function to emphasise that it affects all users.
ReleaseCandidate, ToBeReviewed
Issue History
2008-07-22 14:25andrewballantineNew Issue
2008-07-22 14:25andrewballantineAssigned To => cromero
2008-07-22 14:25andrewballantinesf_bug_id0 => 2024607
2008-07-30 14:06andrewballantineNote Added: 0008435
2008-07-30 18:09psarobeNote Added: 0008442
2008-07-30 18:09psarobeTypedefect => feature request
2008-07-30 18:37andrewballantineNote Added: 0008446
2008-07-30 18:44andrewballantineNote Added: 0008447
2008-08-13 12:32andrewballantineNote Added: 0008536
2008-11-10 13:10cromeroAssigned Tocromero => pjuvara
2008-11-16 15:58pjuvaraTag Attached: ToBeReviewed
2008-11-16 15:59pjuvaraTag Attached: ReleaseCandidate
2008-11-16 15:59pjuvaraStatusnew => acknowledged
2011-02-04 09:16jpabloaeAssigned Topjuvara => rmorley

Notes
(0008435)
andrewballantine   
2008-07-30 14:06   
It appears that all records in the system that have a default option,

e.g. regions, tax category, tax rate...

all have this bug in that the system allows operators to set multiple defaults.
(0008442)
psarobe   
2008-07-30 18:09   
Hi Andrew,

This is not a bug but yes a feature request. Which is the point of having the same country into different Client_ID?. I understand your point but the solution is not good enough and I certainly think that needs to spend more time thinking the best one
(0008446)
andrewballantine   
2008-07-30 18:37   
"This is not a bug but yes a feature request"
I strongly disagree. Marking more than one record especially Region, tax Category, Tax rate causes unpredictable results. Any system that exhibits unpredictable results has a bug.
Now you may consider this a very minor bug and publish a work-around, which is manually clear unwanted defaults, and you may wish to consider the design implications. However it is still a bug.

"Which is the point of having the same country into different Client_ID?"
Because of this and other signs I have seen in Openbravo, there is no way Openbravo is suitable for multi-client use with complete separation of data.

Maybe you are using the wrong definition viz "Default"
A default is something that is used when nothing is specified. If there is more than one default how is the system going to know which one to use. It doesn't, it uses the first one it comes to, which is an unpredictable selection because of the way databases store their data.

It is a bug.
(0008447)
andrewballantine   
2008-07-30 18:44   
This bug became an issue when importing business partners. Because we did not need to specify the country it defaulted to USA. When we noticed this we set the default country to GB, but it still defaulted to USA. When we cleared the default flag for the USA, GB was selected as the default.

If you had 2 clients on the system requiring different defaults, they would interfere with each other. So I assumed that each client could define their own country record to set as default, but no Country_code must be unique.

Therefore you have a multi-client design problem, so you have a bug.
(0008536)
andrewballantine   
2008-08-13 12:32   
I am extremely disappointed that this bug report has been changed against my wishes into a feature request. Over the years I have seen many Proprietary supplier of software use the "It's not a bug, it's a feature" routine to keep their bug count down. Looks like Openbravo are doing the same.

This is a bug.