Closed bhaveshselarka closed 4 years ago
No you can't, its well known you can't import journal entries via the standard csv import. Plenty of other solutions exist. Odoo themselves has a tool somewhere, and OCA too.
@sswapnesh @Yenthe666 Any Idea about this? Please let me know if you have.
@gdgellatly I have found this one. But a lot more depended on modules which are not required.
https://apps.odoo.com/apps/modules/10.0/account_move_csv_import/
@bhaveshselarka I don't them so well. When I hit this we just used odoo shell scripts to connect to a remote system, transform the data and create the entries. But if all your data is in csv's with correct column headings, it would be easy to use a shell script to do the creation.
Alternatively, you could just disable the constraint for import if you are sure your data is correct.
Or Create Python function which reads and Creates move (and AML). Ps: It would be faster than debugging this error on Import..
Closing this as answered and no Odoo issue at all.
ONLY DO THIS IF YOU KNOW JOURNAL ENTRY DATA IS BALANCED: You have to comment line in file account_move.py what validates this unbalanced journal in file (this could be different in your version odoo-12.0.post20190618-py3.7.egg)
/opt/bitnami/apps/odoo/lib/odoo-12.0.post20190618-py3.7.egg/odoo/addons/account/models
replace this line : if len(self.cr.fetchall()) != 0: raise UserError(("Cannot create unbalanced journal entry."))
#raise UserError(_("Cannot create unbalanced journal entry."))
RESTART ODOO AND APACHE
IMPORT YOUR DATA (successful import)
AFTER THAT UNCOMMENT THE LINE (in 2) TO PUT THE RIGHT CODE AGAIN
RESTART ODOO AND APACHE
Impacted versions: v10, v11
http://521675-10-0-4039fc.runbot11.odoo.com/web?debug=1#model=account.move&action=import http://521681-11-0-daf976.runbot17.odoo.com/web?#model=account.move&action=import
account.move (4).csv.zip
Simply trying to import Journal entries. Here I have attached the sample file as well.