You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by pankaj savita <pa...@gmail.com> on 2008/02/28 05:56:49 UTC

Re: svn commit: r631785 - /ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml

Si,
Problems have been encountered while loading data due to this code.

(ERROR: insert or update on table "gl_account_type" violates foreign key
constraint "glactty_par"
 Detail: Key (parent_type_id)=(EXPENSE) is not present in table
"gl_account_type".)). Rolling back transaction.

Regards,
Pankaj Savita

On Thu, Feb 28, 2008 at 5:43 AM, <si...@apache.org> wrote:

> Author: sichen
> Date: Wed Feb 27 16:12:58 2008
> New Revision: 631785
>
> URL: http://svn.apache.org/viewvc?rev=631785&view=rev
> Log:
> Add relation for GlAccountType's parent/child structure.
>
> Modified:
>    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
>
> Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
> URL:
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=631785&r1=631784&r2=631785&view=diff
>
> ==============================================================================
> --- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
> (original)
> +++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Wed Feb
> 27 16:12:58 2008
> @@ -1885,6 +1885,9 @@
>       <field name="hasTable" type="indicator"></field>
>       <field name="description" type="description"></field>
>       <prim-key field="glAccountTypeId"/>
> +      <relation type="one" fk-name="GLACTTY_PAR" title="Parent"
> rel-entity-name="GlAccountType">
> +        <key-map field-name="parentTypeId"
> rel-field-name="glAccountTypeId"/>
> +      </relation>
>     </entity>
>     <entity entity-name="GlAccountTypeDefault"
>             package-name="org.ofbiz.accounting.ledger"
>
>
>



<http://www.hotwaxmedia.com>

Re: svn commit: r631785 - /ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml

Posted by Jacopo Cappellato <ti...@sastau.it>.
Christian Geisert wrote:
> I think Si isn't subscribed to this mailing list...
> 

As a committer, Si should really be subscribed to all the OFBiz's public 
lists; I would be surprised of the contrary, but I'm copying this 
message to Si so that he can subscribe if he is not.

> Anyway, this change just triggered a problem in the demo data which
> I noticed by coincidence yesterday while looking at the
> AccountingTypeData.xml ;-)

The data loading issue should be fixed in rev. 631906

Pankaj, Christian, thanks for your help.

Jacopo


> 
> A fix for this is either to add a GlAccountType "EXPENSE" or remove
> the parentTypeId from "PURCHASE_PRICE_VAR"
> (For example "OTHER_EXPENSE" has no parent "EXPENSE")
> 
> I'm not sure which is better...
> 
> Christian


> 
>> Si,
>> Problems have been encountered while loading data due to this code.
>>
>> (ERROR: insert or update on table "gl_account_type" violates foreign key
>> constraint "glactty_par"
>>  Detail: Key (parent_type_id)=(EXPENSE) is not present in table
>> "gl_account_type".)). Rolling back transaction.
>>
>> Regards,
>> Pankaj Savita
>>

Re: svn commit: r631785 - /ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml

Posted by Christian Geisert <ch...@isu-gmbh.de>.
I think Si isn't subscribed to this mailing list...

Anyway, this change just triggered a problem in the demo data which
I noticed by coincidence yesterday while looking at the
AccountingTypeData.xml ;-)

A fix for this is either to add a GlAccountType "EXPENSE" or remove
the parentTypeId from "PURCHASE_PRICE_VAR"
(For example "OTHER_EXPENSE" has no parent "EXPENSE")

I'm not sure which is better...

Christian

> Si,
> Problems have been encountered while loading data due to this code.
> 
> (ERROR: insert or update on table "gl_account_type" violates foreign key
> constraint "glactty_par"
>  Detail: Key (parent_type_id)=(EXPENSE) is not present in table
> "gl_account_type".)). Rolling back transaction.
> 
> Regards,
> Pankaj Savita
> 
> On Thu, Feb 28, 2008 at 5:43 AM, <si...@apache.org> wrote:
> 
>> Author: sichen
>> Date: Wed Feb 27 16:12:58 2008
>> New Revision: 631785
>>
>> URL: http://svn.apache.org/viewvc?rev=631785&view=rev
>> Log:
>> Add relation for GlAccountType's parent/child structure.
>>
>> Modified:
>>    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
>>
>> Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
>> URL:
>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=631785&r1=631784&r2=631785&view=diff
>>
>> ==============================================================================
>> --- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
>> (original)
>> +++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Wed Feb
>> 27 16:12:58 2008
>> @@ -1885,6 +1885,9 @@
>>       <field name="hasTable" type="indicator"></field>
>>       <field name="description" type="description"></field>
>>       <prim-key field="glAccountTypeId"/>
>> +      <relation type="one" fk-name="GLACTTY_PAR" title="Parent"
>> rel-entity-name="GlAccountType">
>> +        <key-map field-name="parentTypeId"
>> rel-field-name="glAccountTypeId"/>
>> +      </relation>
>>     </entity>
>>     <entity entity-name="GlAccountTypeDefault"
>>             package-name="org.ofbiz.accounting.ledger"
>>
>>
>>
> 
> 
> 
> <http://www.hotwaxmedia.com>
> 


-- 
Mit freundlichen Grüßen
Christian Geisert

ISU GmbH * Kreisstr. 9 * 76297 Stutensee * Germany
Tel. 0721/96731-13 * Fax 0721/96731-55
www.isu-gmbh.de * christian.geisert@isu-gmbh.de

Geschäftsführer: Hartmut Glasenapp
Amtsgericht Mannheim HRB 106505
USt.-Id Nr. DE 158792445
St.-Nr. 34 413 82630

Re: svn commit: r631785 - /ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml

Posted by Mridul Pathak <mr...@hotwaxmedia.com>.
The error is actually due to the following data record in
AccountingTypeData.xml:
LINE 301: <GlAccountType description="Purchase Price Variance"
glAccountTypeId="PURCHASE_PRICE_VAR" hasTable="N" parentTypeId="EXPENSE"/>

Here glAccoutTypeId="EXPENSE" does not exists so can't be used as a
parentTypeId as it violates FK constraints according to this commit,  I
think we can use parentTypeId="OTHER_EXPENCE".

On Thu, Feb 28, 2008 at 10:26 AM, pankaj savita <pa...@gmail.com>
wrote:

> Si,
> Problems have been encountered while loading data due to this code.
>
> (ERROR: insert or update on table "gl_account_type" violates foreign key
> constraint "glactty_par"
>  Detail: Key (parent_type_id)=(EXPENSE) is not present in table
> "gl_account_type".)). Rolling back transaction.
>
> Regards,
> Pankaj Savita
>
> On Thu, Feb 28, 2008 at 5:43 AM, <si...@apache.org> wrote:
>
> > Author: sichen
> > Date: Wed Feb 27 16:12:58 2008
> > New Revision: 631785
> >
> > URL: http://svn.apache.org/viewvc?rev=631785&view=rev
> > Log:
> > Add relation for GlAccountType's parent/child structure.
> >
> > Modified:
> >    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
> >
> > Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
> > URL:
> >
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=631785&r1=631784&r2=631785&view=diff
> >
> >
> ==============================================================================
> > --- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
> > (original)
> > +++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Wed
> Feb
> > 27 16:12:58 2008
> > @@ -1885,6 +1885,9 @@
> >       <field name="hasTable" type="indicator"></field>
> >       <field name="description" type="description"></field>
> >       <prim-key field="glAccountTypeId"/>
> > +      <relation type="one" fk-name="GLACTTY_PAR" title="Parent"
> > rel-entity-name="GlAccountType">
> > +        <key-map field-name="parentTypeId"
> > rel-field-name="glAccountTypeId"/>
> > +      </relation>
> >     </entity>
> >     <entity entity-name="GlAccountTypeDefault"
> >             package-name="org.ofbiz.accounting.ledger"
> >
> >
> >
>
>
>
> <http://www.hotwaxmedia.com>
>



-- 
Thanks & Regards
Mridul Pathak
Hotwax Media
http://www.hotwaxmedia.com
mridul.pathak@hotwaxmedia.com
__________________________________
Office          :   509.855.4113
Mobile         : +919425926892