Skip to Content
Menu
This question has been flagged
2 Replies
2031 Views

Whenever a customer changes their billing address on the website, it changes all their addresses on their previous invoices  that used  the  billing  address  to the new one. This is a big problem as invoices need to remain unchanged when you store them. I have asked odoo, but they say it is how odoo is meant to work. It is a big issue so I am surprised it has not been fixed.

Is there any quick fixes to this?


How can I record the original delivery and billing addresses of the invoice so that a copy of the original data is preserved and not changed? 

I want to do this without adding code or modules (using code inside odoo is fine though, e.g  automated  actions  executing  python  code  is  fine)

Thanks for the Help!

Avatar
Discard
Best Answer

I think a simple workaround would be instead of changing the existing billing address create a new one and archive the old one that's way old invoice still reference to old address and could not be select anymore for new invoice  because it's archived   

Avatar
Discard
Author

Thanks for the help this is a useful method for changing the billing address in the backend. But it cant stop website users causing the problem so ill have to find a way to solve that part. I will use your method in the back end though.

Thanks for the help!

Best Answer

Hello James Camfield

As per your comment.

Yes,you can create schedule action(automated actions executing python code) .
In python code :
1) Check or find partner's invoice(group by partner_id and created from website).
2) invoice state (not posted,cancel)
3) take latest invoice by in search method order='id desc',limit=1---last one invoice
4) check last invoice Address != older er one invoice

then update invoice address as last invoice address

Thanks & Regards,

Email: odoo@aktivsoftware.com

Skype: kalpeshmaheshwari

Avatar
Discard
Author

Hi Jainesh Shah,

Thankyou for posting an answer. I didn't quite understand your last step. What do you do with the latest invoice? could you perhaps give some simple code so I can understand.

Thanks for your help!

Related Posts Replies Views Activity
1
Apr 24
319
3
Oct 23
6411
2
Jun 22
1706
1
Apr 22
946
0
Feb 22
3240