Skip to Content
Menu
This question has been flagged
3 Replies
7299 Views

i try to import data in accounting/journal entry and i got this error

new row for relation "account_move_line" violates check constraint "account_move_line_credit_debit1" DETAIL: Failing row contains (35379, null, null, null, null, 4298826.01, 4298826.01, null, null, null, null, 0.0, null, null, null, null, null, 296, 50278, null, null, null, null, f, null, null, f, 2019-05-06, null, null, null, null, null, null, null, t, 1, 2019-05-06 12:12:22.167708, 1, 2019-05-06 12:12:22.167708, null). entre les lignes 2 et 1136

can anyone help

Avatar
Discard

Hello Haffis,

Is it possible share Journal entry csv or excel file here ? It seems some required fields are missing in csv file.

yes here some required data it gots null value.. (ex. account_move_line_credit_debit1, so here if no value then put 0.0)

Author

yes i delete constraint from pg admin and it work my problem now is i want one record in account.move and sex record in account.move.line i can't got it i got sex recored in account

move

Best Answer

In my case, the error was when generating the payment, I was missing the writeoff_account_id field, just send the id you need from the account.account model and there should be no problem

payment = Payment.create({
'writeoff_account_id': self.env['account.account'].browse("you id").id,
})

Avatar
Discard
Best Answer
  1. You have to make sure there are only positive numbers in your import sheet; so -123 credit should be converted into 123 debet
  2. You have to make sure that you add a 'suspense' line as the latest line to balane your import; i.e. add the absolute value of the sum of all your credits - sum of all debets, and put that in the credit column if the sum of debet > sum of credit; else put it in the debet column

Hope this helps.

Avatar
Discard
Best Answer

Hello Haffis, 

I got the same error and fixed it like this: should be no lines where both "CREDIT" and "DEBIT" are not empty.


P.S. I also checked: if you set, for example, "0" into column "credit" where "debit" is not 0  - it doesn't affect the error.

Avatar
Discard