Sunday, September 29, 2024
3 changes · master
Miscellaneous changes
Before this commit, when account_online_payment was installed and no payment initiation was configured on a bank journal, the batch validation and export buttons never appeared on the batch payments made on this journal. Forward-Port-Of: odoo/enterprise#70952
Original PR description
Before this commit, when account_online_payment was installed and no payment initiation was configured on a bank journal, the batch validation and export buttons never appeared on the batch payments made on this journal. Forward-Port-Of: odoo/enterprise#70952
Steps to reproduce the error: - Install "contacts" and "whatsapp" module - Configure WhatsApp Business Account and create a whatsapp template - Go to Contacts > Create a new contact > add mobile number > click on whatsapp button > select template > send message - reply to message from mobile number - Delete contact - Go to Discuss > open channel of contact > send message Traceback: ``` IndexError: tuple index out of range File "odoo/http.py", line 2256, in __call__ response
Original PR description
Steps to reproduce the error: - Install "contacts" and "whatsapp" module - Configure WhatsApp Business Account and create a whatsapp template - Go to Contacts > Create a new contact > add mobile…
Steps to reproduce the error:
- Install "contacts" and "whatsapp" module
- Configure WhatsApp Business Account and create a whatsapp template
- Go to Contacts > Create a new contact > add mobile number >
click on whatsapp button > select template > send message
- reply to message from mobile number
- Delete contact
- Go to Discuss > open channel of contact > send message
Traceback:
```
IndexError: tuple index out of range
File "odoo/http.py", line 2256, in __call__
response = request._serve_db()
File "odoo/http.py", line 1832, in _serve_db
return self._transactioning(_serve_ir_http, readonly=ro)
File "odoo/http.py", line 1852, in _transactioning
return service_model.retrying(func, env=self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1830, in _serve_ir_http
return self._serve_ir_http(rule, args)
File "odoo/http.py", line 1837, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 2062, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 220, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 742, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "home/odoo/src/enterprise/saas-17.2/whatsapp/controller/main.py", line 41, in webhookpost
request.env['whatsapp.message']._process_statuses(value)
File "home/odoo/src/enterprise/saas-17.2/whatsapp/models/whatsapp_message.py", line 413, in _process_statuses
whatsapp_message_id._update_message_fetched_seen()
File "home/odoo/src/enterprise/saas-17.2/whatsapp/models/whatsapp_message.py", line 426, in _update_message_fetched_seen
channel_member = channel.channel_member_ids.filtered(lambda cm: cm.partner_id == channel.whatsapp_partner_id)[0]
File "odoo/models.py", line 6580, in __getitem__
return self.browse((self._ids[key],))
```
https://github.com/odoo/enterprise/blob/a134bea9c6fa1a0806c5501046e358c82d7a3fe5/whatsapp/models/whatsapp_message.py#L428
Here, when user deletes the contact, channel.whatsapp_partner_id will be False,
and channel_member will become an empty tuple,
So when it tries to access the index of an empty tuple,
It will lead to the above traceback.
sentry-5314291061
Forward-Port-Of: odoo/enterprise#62262Forward-Port-Of: odoo/enterprise#71009
Original PR description
Forward-Port-Of: odoo/enterprise#71009