OCA / l10n-portugal

Odoo Portuguese localization
GNU Affero General Public License v3.0
4 stars 26 forks source link

[IMP] l10n_pt_account_invoicexpress: force update of Invx stored Contact details #68

Closed dreispt closed 2 years ago

dreispt commented 2 years ago

/ocabot merge patch

OCA-git-bot commented 2 years ago

What a great day to merge this nice PR. Let's do it! Prepared branch 14.0-ocabot-merge-pr-68-by-dreispt-bump-patch, awaiting test results.

OCA-git-bot commented 2 years ago

Congratulations, your PR was merged at d8bd41378a16b2867c51067cb83112500736c6c6. Thanks a lot for contributing to OCA. ❤️

ljsalvatierra-factorlibre commented 2 years ago

Hi @dreispt, if i am not mistaken, the contact gets updated every time an invoice is sent, right?

Also, why do you send non required contact data to the API? Only name and code are required...

https://invoicexpress.com/api-v2/clients/create-4

imagen

dreispt commented 2 years ago

Yes. When we weren’t doing it we got invoices for outdated addresses.

dreispt commented 2 years ago

What contact data are we missing?

ljsalvatierra-factorlibre commented 2 years ago

Yes. When we weren’t doing it we got invoices for outdated addresses.

Hi @dreispt, thank you for your response.

Ok, instead of updating the contact for each invoice, you could store a hash of the last sent data and compare it every time you send the invoice, so you only make a request to the API when the contact information changes.

What contact data are we missing?

What i am trying to say is that it is not necessary to send all the contact information, only the code and name.

dreispt commented 2 years ago

I see, you mean avoid unnecessary requests, not really data missing on calls. What you suggest is more efficient for sure. It will add more lines of code, but It would be a welcome addition if you want to propose it.

dreispt commented 2 years ago

What i am trying to say is that it is not necessary to send all the contact information, only the code and name.

You need all them it to update any of the elements that may have changed. I might skip the call entirely if you're sure there are no changes, but that's the improvement you suggested.

ljsalvatierra-factorlibre commented 2 years ago

What i am trying to say is that it is not necessary to send all the contact information, only the code and name.

You need all them it to update any of the elements that may have changed. I might skip the call entirely if you're sure there are no changes, but that's the improvement you suggested.

I mean on creation and update, what i see in the API documentation is that only are required name and code, the rest of the contact information is optional for Invoicexpress. Maybe there is something i am not understanding.

dreispt commented 2 years ago

It is optional but you still want to provide it so that the data in the Invoice is complete. If you want a different behavior, you can extend the partner prepare values method and implement something different.

ljsalvatierra-factorlibre commented 2 years ago

It is optional but you still want to provide it so that the data in the Invoice is complete. If you want a different behavior, you can extend the partner prepare values method and implement something different.

Ok, in some cases having the complete invoice on Odoo is sufficient. Thank you for the help and your time :)