Daily updates from Odoo
Friday, January 26, 2024
2 changes
Resolved issues and error corrections
This fix resolves an issue where recurring subscription payments were incorrectly marked as failed even though the payment was successfully processed through Razorpay. The problem occurred due to database conflicts when multiple processes tried to update subscription records simultaneously. The fix improves how subscription status is updated during payment processing to prevent these conflicts and ensure accurate payment status reporting.
Original PR description
Steps: - Install subscription app and razorpay provider. - Configure and publish razorpay provider. - Create a subscription and pay via razorpay. - Now change system date to next recurring date.…
Steps: - Install subscription app and razorpay provider. - Configure and publish razorpay provider. - Create a subscription and pay via razorpay. - Now change system date to next recurring date. Issue: - Subscription is in `Payment Failure` state even though payment is successfully captured. Cause: - Because of concurrent update in database while creating transaction from token for recurring charges - When razorpay make tokenize request via `_send_payment_request` method then transaction process data via `_handle_notification_data` and from web-hook so it tries to write on transaction with same data multiple times and at same time subscription also tries to write so because of concurrent update it skips to write on subscription and subscription stays in `Payment Failure` state. Fix: - Handle writing on subscription in there state changing method instead of trying to write in between when transaction processing so it does not skip writing on subscription and properly set/remove subscription state. task-3652228
This fix resolves a problem where website visitors (public users) couldn't add products to their cart when the system was configured to automatically detect their location and apply taxes using AvaTax. The issue occurred because the system tried to validate the visitor's address before they had entered one. The fix skips this validation for public users, allowing them to proceed with adding items to their cart normally.
Original PR description
Currently, a public user can't add any product to the cart when using GeoIP and Avatax. ### Steps to reproduce * setup GeoIP[^1] * setup Avatax credentials * enable "Detect Automatically" on the…
Currently, a public user can't add any product to the cart when using GeoIP and Avatax.
### Steps to reproduce
* setup GeoIP[^1]
* setup Avatax credentials
* enable "Detect Automatically" on the "Automatic Tax Mapping (AvaTax)" fiscal position
* access to the website as a public user with an IP address from the US[^1]
* try adding a product to the cart.
You should be met with a validation pop.
[^1]:
This is quite annoying to reproduce on a local database. In cases like these, I find it much easier to directly modify the code in order to emulate the behavior we want. Here, you can simply replace the entire content of `odoo/addons/http_routing/geoipresolver.py` with the following:
```py
class GeoIPResolver(object):
@classmethod
def open(cls, fname):
return GeoIPResolver()
def resolve(self, ip):
return {
'city': 'New York',
'country_code': 'US',
'country_name': 'United States',
'latitude': 40.7263,
'longitude': -73.9818,
'region': 'NY',
'time_zone': 'America/New_York'
}
```
### Cause
For the Avatax fiscal position to work, we need the partner's country, state and zip code. Usually, this isn't a problem because the fiscal position is set after the Public User enters their address. But, when using GeoIp, the fiscal position is set right when the user lands on the page, based on their location data. This triggers a check for the address, but the Public User hasn't entered one yet, which causes a validation error.
opw-3625410
Forward-Port-Of: odoo/enterprise#53547