Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031425Openbravo ERPA. Platformpublic2015-11-11 11:022022-02-01 08:09
alostale 
Triage Platform Base 
normaltrivialhave not tried
acknowledgedopen 
5
 
 
Core
No
0031425: many boolean columns incorrectly defined in AD and DB
Boolean columns (reference Y/N) should be defined as:
1. Mandatory: other case when working with DAL a Boolean null object is obtained failing when doing "if (object)"
2. They should have standard DB check for Y/N values
For case 1, check with:
select t.tablename, c.columnname
 from ad_column c, ad_table t
where c.ad_reference_id = '20'
 and t.ad_table_id = c.ad_table_id
 and t.isview ='N'
 and c.ismandatory ='N'
 order by 1,2

For case 2, check with:
select t.tablename, c.columnname
 from ad_column c, ad_table t
where c.ad_reference_id = '20'
 and t.ad_table_id = c.ad_table_id
 and t.isview ='N'
 and not exists (
        select 1
        from pg_constraint ct, pg_class pt
        where pt.relname ilike t.tablename
        and ct.conrelid = pt.oid
        and contype ='c'
        and consrc ilike '%'||c.columnname||'%'
        and consrc ilike '%''Y''%'
        and consrc ilike '%''N''%')
order by 1,2
Decide whether we should enforce these two rules, if so, fix existent columns (note will be an API change) and automate test case to prevent it in future.
No tags attached.
duplicate of defect 0017609 acknowledged Triage Platform Base Code-review for issue: 16639 
Issue History
2015-11-11 11:02alostaleNew Issue
2015-11-11 11:02alostaleAssigned To => platform
2015-11-11 11:02alostaleModules => Core
2015-11-11 11:02alostaleTriggers an Emergency Pack => No
2015-11-11 11:02alostaleStatusnew => acknowledged
2015-11-11 11:02alostaleRelationship addedduplicate of 0017609
2022-02-01 08:09alostaleAssigned Toplatform => Triage Platform Base

There are no notes attached to this issue.