Error while loading CSV file data

Hello,

I’m triying to import accounting account management in csv, but I get the below error message for each row:

javax.validation.ConstraintViolationException: Validation failed for classes [com.axelor.apps.account.db.Journal] during persist time for groups [javax.validation.groups.Default, ]
List of constraint violations:[
	ConstraintViolationImpl{interpolatedMessage='ne doit pas être nul', propertyPath=journalType, rootBeanClass=class com.axelor.apps.account.db.Journal, messageTemplate='{javax.validation.constraints.NotNull.message}'}
	ConstraintViolationImpl{interpolatedMessage='ne doit pas être nul', propertyPath=name, rootBeanClass=class com.axelor.apps.account.db.Journal, messageTemplate='{javax.validation.constraints.NotNull.message}'}
]

This is a part of my binding file

<input
      file="paymentMode_accountManagement.csv"
      separator=";"
      type="com.axelor.apps.account.db.AccountManagement"
    >
      <bind to="importOrigin" eval="_dataFileName"/>
      <bind to="company" search="self.code = :company_code" update="true" if="company_code"/>
      <bind to="journal" search="self.company.code = :company_code and self.code = :journal_code"
        update="true" if="journal_code"/>
...
</input>

Of course I have a column named « journal_code » and another named « company_code », and « com.axelor.apps.account.db.AccountManagement » has a « journal » ManyToOne fied. So where can be this issue comes from and how to solve it

Hello
Welcome to Axelor community !!

In your CSV data file there are some journal_code values, which is not there in Journal records (Journal with that code is not exists). So in this case it will try to create new Journal record.

Now in Journal , name & journalType are required field which prevents the creation of that record.

So solution for this issue is , specify inner binding for journal binding. with name & journalType and add these two column values in your csv data file.

Hope this will resolve your issue.

Thank you