Created
February 21, 2019 06:00
-
-
Save umiphos/6be5abb187cc376c8b63bdff7379f952 to your computer and use it in GitHub Desktop.
This gist will fix fix the account_id from a bad placed account in a move.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
right_journal = env.ref('absa.account_journal_B2353') | |
bad_account = env.ref('absa.account_account_102_01_016') | |
for rec in records: | |
move_id = rec.mapped('move_id') | |
move_id.button_cancel() | |
for line in move_id.line_ids: | |
if line.journal_id == right_journal and line.account_id == bad_account: | |
line.write({'account_id': | |
right_journal.default_debit_account_id.id}) | |
move_id.action_post() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment