This question has been flagged
2 Replies
3728 Views

Hi

Is there anyway to change the invoice or payment journal after post?

Avatar
Discard
Author

Hi Waleed

thank you for reply but this is not the answer. i want to change the journal. when i trying to change the journal there is an error

You cannot edit the journal of an account move if it has been posted once.

Best Answer

You can change the posted invoice by reset it to draft and you can the button in invoice form and it will be visible if the invoice journal not configured as "Lock Posted Entries with Hash" so you can reset the invoice to draft and change it and confirm it again.

If you already has a payment link with the invoice and you will find it in invoice form under the total amount so if you rested the invoice to draft, the payments unreconciled automatically and once you did your changes you can link them again to the invoice.


For payment, You can reset the payment to draft and if it's already reconciled with an invoice it will be unreconciled automatically and once you changed your payment and posted it again you will reconcile it with the invoice.

Avatar
Discard
Author


Hi Waleed

thank you for reply but this is not the answer. i want to change the journal. when i trying to change the journal there is an error

You cannot edit the journal of an account move if it has been posted once.

Sorry for misunderstanding, You can't change the journal field after posting because the sequence already created for the old journal. I'm afraid you can't do it.

I have did some test on posted send payment and you can try it in your test environment, i have rested the payment to draft, then I export the payment to excel with fields (Number, posted before) and select the checkbox "I want to update data (import-compatible export)" then I opened the excel and changed the Number to / and posted before to False then save, I have imported the excel and I was able o change the journal and post it.

Thank you for your reply i did same but unfortunately doesn’t work for me do you think i have missed something?

On 10 June 2022 at 18:53:12, Waleed Mohsen (notifications@mail.odoo.com) wrote:

I have did some test on posted send payment and you can try it in your test environment, i have rested the payment to draft, then I export the payment to excel with fields (Number, posted before) and select the checkbox "I want to update data (import-compatible export)" then I opened the excel and changed the Number to / and posted before to False then save, I have imported the excel and I was able o change the journal and post it.

Sent by Odoo S.A. using Odoo.

Author

Waleed
i Did same but still i am not able to do that now error is different
at the beginig error was (You cannot edit the journal of an account move if it has been posted once.)
now it is (You cannot edit the journal of an account move if it already has a sequence number assigned.)
Do you have any idea?

Author

Finally i did it there is an easier way by studio, posted before filed is invisible in the invoice so you can unhide it an uncheck it. any way thank you for your help it was very helpful

Thanks, That was an easy way using studio.

Best Answer

Hi Kamran,

You can not edit journal entry once is posted and sequence number are generated.
Even if you want to edit or update journal entry ex. Journal then you need to write server action call from related journal entry Action menu.

Accounting -> Accounting > Journal Entry > Action > Edit Journal Entry
Model: Journal Entry (account.move)
Execution: Execute Function

for rec in records:

    rec.button_draft()

    rec.button_cancel()

    rec.write({'name': '','posted_before': False})

    rec.write({'journal_id': journal.id})

    rec.action_post()

Thanks.

Avatar
Discard