src-db/database/model/tables/M_REQUISITION.xml
author Carlos Aristu <carlos.aristu@openbravo.com>
Wed, 13 Nov 2019 19:14:34 +0100
changeset 36742 0a493e062362
parent 8505 a2bb7e6fb443
permissions -rw-r--r--
fixes bug 42270: window can be not initialized if default saved view is missing

Having a window with several saved view personalizations, if the default saved view is not provided by the WindowSettingsActionHandler then the header's grid was not properly initialized, leaving it in an inconsistent state which did not allow to save records.

Note that it already exists a mechanism that tries to avoid this scenario by deleting the configuration used to mark a personalization as default in case it does not exists (WindowPersonalizationEventHandler). But this inconsistent state can be also reached in case the window personalization is manually deleted through the database (i.e., by deleting the corresponding obuiapp_uipersonalization record).

To fix this problem now we are forcing the grid initialization in case the default view is not found.
<?xml version="1.0"?>
  <database name="TABLE M_REQUISITION">
    <table name="M_REQUISITION" primaryKey="M_REQUISITION_KEY">
      <column name="M_REQUISITION_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DESCRIPTION" primaryKey="false" required="false" type="NVARCHAR" size="255" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DOCUMENTNO" primaryKey="false" required="true" type="NVARCHAR" size="30" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_BPARTNER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="M_PRICELIST_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_CURRENCY_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CREATEPO" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="DOCSTATUS" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default><![CDATA[DR]]></default>
        <onCreateDefault/>
      </column>
      <column name="DOCACTION" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default><![CDATA[CO]]></default>
        <onCreateDefault/>
      </column>
      <column name="PROCESSED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="AD_USER_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="PROCESSING" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <foreign-key foreignTable="AD_CLIENT" name="AD_CLIENT_M_REQUISITION">
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_ORG" name="AD_ORG_M_REQUISITION">
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_USER" name="AD_USER_M_REQUISITION">
        <reference local="AD_USER_ID" foreign="AD_USER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_BPARTNER" name="C_BPARTNER_M_REQUISITION">
        <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_CURRENCY" name="C_CURRENCY_M_REQUISITION">
        <reference local="C_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
      </foreign-key>
      <foreign-key foreignTable="M_PRICELIST" name="M_PRICELIST_M_REQUISITION">
        <reference local="M_PRICELIST_ID" foreign="M_PRICELIST_ID"/>
      </foreign-key>
      <check name="M_REQUISITION_CREATEPO_CHECK"><![CDATA[CREATEPO IN ('Y', 'N')]]></check>
      <check name="M_REQUISITION_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
    </table>
  </database>