Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0013777Openbravo ERPA. Platformpublic2010-06-24 19:342010-06-30 12:17
psarobe 
alostale 
immediatemajoralways
closedfixed 
5
pi 
2.50MP19 
Core
No
0013777: Read only logic does not work in Order Lines tab
When you define an auxiliary input to be used for "Read only logic" purposes does not work at all. That looks like the pattern but not sure because there is a field that works even having an auxiliary input assigned.
In the table c_orderline the column lineno has an auxiliary input and works but the rest of the columns don't

This was working in MP18 but now, in MP19 release candidate, is not working. You can find several examples of this in every transactional window but in the child tabs of the header, for example in tab lines of the Sales order window
1. Login as Openbravo/openbravo Openbravo Admin role
2. Go to sales management/transactions/Sales order
3. Click new and fill the mandatory fields. Save
4. Move to Lines tab. Fill the mandatory fields and save
5. Move back to the header and complete
6. Move again to lines tab and notice that the fields that should be read only are not read only.

Current read only fields:
=========================
Line no.

Expected read only fields:
==========================
Line no.
Product
Warehouse
Ordered quantity
Net unit price
Net list price
Tax
Line net amount
Regression QA
related to defect 00125482.50MP19 closed harikrishnan Sales order window: In lines tab the field Resource Assignment has to be removed 
Issue History
2010-06-24 19:34psarobeNew Issue
2010-06-24 19:34psarobeAssigned To => alostale
2010-06-24 19:35psarobeTag Attached: Regression QA
2010-06-24 19:35psarobeStatusnew => scheduled
2010-06-24 19:35psarobefix_in_branch => pi
2010-06-25 07:19priyamIssue Monitored: priyam
2010-06-25 09:35alostaleRelationship addedrelated to 0012548
2010-06-25 09:39alostaleNote Added: 0028760
2010-06-25 09:46alostalefix_in_branchpi =>
2010-06-25 09:46alostaleSummaryRead only logic does not work in children tabs => Read only logic does not work in Order Lines tab
2010-06-25 09:55alostaleNote Added: 0028761
2010-06-25 09:57hgbotCheckin
2010-06-25 09:57hgbotNote Added: 0028762
2010-06-25 09:57hgbotStatusscheduled => resolved
2010-06-25 09:57hgbotResolutionopen => fixed
2010-06-25 09:57hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f0cd31fd27dd1336ec7380871d5756140c294beb [^]
2010-06-25 10:55alostaleNote Added: 0028766
2010-06-25 12:54psarobeNote Added: 0028774
2010-06-25 12:54psarobeStatusresolved => closed
2010-06-25 12:54psarobeFixed in Version => 2.50MP19
2010-06-26 00:00anonymoussf_bug_id0 => 3021593
2010-06-30 12:17hudsonbotCheckin
2010-06-30 12:17hudsonbotNote Added: 0028907

Notes
(0028760)
alostale   
2010-06-25 09:39   
This regression was introduced by 0012548

C_Order.S_ResourceAssignment_ID column was marked as inactive, this causes that no hidden field is generated in the html page for this column. The problem is that this field is used in the readonlylogic for M_Product column, as now there is no field the javascript fails silently making the rest of display logics not to be executed.
(0028761)
alostale   
2010-06-25 09:55   
Note that warehouse field is set as readonly in case the order type is no "SO", it is not related with completing the order.
(0028762)
hgbot   
2010-06-25 09:57   
Repository: erp/devel/pi
Changeset: f0cd31fd27dd1336ec7380871d5756140c294beb
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jun 25 09:47:27 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f0cd31fd27dd1336ec7380871d5756140c294beb [^]

fixed bug 13777: Read only logic does not work in Order Lines tab

  C_Order.S_ResourceAssignment_ID is active again in order to generate its hidden field.

---
M src-db/database/sourcedata/AD_COLUMN.xml
---
(0028766)
alostale   
2010-06-25 10:55   
Checking for more cases with this problem: only found this one.

This are the queries executed (they only work in PG) to check it:

*Columns with read only logic where participates a column that is not active or has not field (current case).

select t.tablename, c.columnname, c.ad_column_id, c.readonlylogic, a.logicColumn
  from ad_column c, ad_table t,
(select regexp_split_to_table(c1.readonlylogic, E'\\@+') as logicColumn, c1.ad_column_id
  from ad_column c1) a
  where c.readonlylogic like '%@%'
   and a.ad_column_id = c.ad_column_id
   and t.ad_table_id = c.ad_table_id
   and exists (select 1
                 from ad_column c2
                where c2.ad_table_id = c.ad_table_id
                  and c2.columnname = a.logicColumn
                  and (c2.isactive='N'
                       or not exists (select 1
                                        from ad_field f
                                       where f.ad_column_id = c2.ad_column_id)));

*Fields with display logic where participates a column that is not active or has not field.

select f.name, f.displaylogic, a.logicColumn
  from ad_field f, ad_column c,
       (select regexp_split_to_table(f1.displaylogic, E'\\@+') as logicColumn, f1.ad_field_id
          from ad_field f1) a
  where f.displaylogic like '%@%'
    and f.ad_field_id = a.ad_field_id
    and c.ad_column_id = f.ad_column_id
    and exists (select 1
                 from ad_column c2
                where c2.ad_table_id = c.ad_table_id
                  and c2.columnname = a.logicColumn
                  and (c2.isactive='N'
            or not exists (select 1
                                        from ad_field f
                                       where f.ad_column_id = c2.ad_column_id)));
(0028774)
psarobe   
2010-06-25 12:54   
Tested working fine
(0028907)
hudsonbot   
2010-06-30 12:17   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/f0cd31fd27dd [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/0670375d782d [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17726.obx [^]