732ccd17151052acc819acdd2fc426da198f218a
There is a discrepancy between what country is used to compute the fees for a transaction depending on where we are in the payment flow. At rendering, the country of the order's shipping partner is used (since it is set as the main partner in the rendering values dict through `render_sale_button`). At creation, the country of the partner is used (since the `payment.transaction` record is created with the order's main `partner_id` in `_create_payment_transaction`). This is unfortunate and can cause issues with payment flows if there is a mismatch between countries of the shipping/invoice/main partner, as the fees may be computed as 'international' in one case and 'domestic' in another - this causes the values sent to Paypal to differ from those saved on the transaction, which causes the transaction to be rejected upon return from Paypal because of an amount mismatch. Since the transaction is created using the main partner of the order, I believe it is preferrable to use it for the rendering as well. Some may dislike this choice, as it means that if you use these fees to manage your delivery fees, a customer with a shipping address to is not the same as the company's country will pay domestic fees, while they should pay international ones. However, this is mitigated by the fact that: - this did not work before this commit (hell of an argument) - the delivery module is there to handle those cases with much higher configurability - having a consistent computation is more important than managing this case opw-2225023 closes odoo/odoo#48519 X-original-commit: a8689769afa22fb633f2e911f1a4dea6caa193d3 Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%