Skip to Content
Menú
This question has been flagged
2 Respostes
2935 Vistes

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
Descartar
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
Descartar
Autor

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
Descartar
Autor

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 Respostes Vistes Activitat
1
d’abr. 24
1767
3
d’oct. 23
8028
2
de juny 22
3278
1
d’abr. 22
2136
0
de febr. 22
4472