Sunday, September 29, 2024
2 changes · saas-17.2
Miscellaneous changes
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#62262When a snippet is in grid mode, the grid items horizontal padding can be modified with the "Padding (Y, X)" option. When we are in mobile view, the display is back to `flex`, in order for the layout to look like the snippets in normal mode. However, while the normal mode columns all have the same padding, which depends on the `--gutter-x` CSS variable, the grid items still keep the horizontal grid padding, making them misaligned with the other contents. An other inconsistency in grid mode
Original PR description
When a snippet is in grid mode, the grid items horizontal padding can be modified with the "Padding (Y, X)" option. When we are in mobile view, the display is back to `flex`, in order for the layout…
When a snippet is in grid mode, the grid items horizontal padding can be modified with the "Padding (Y, X)" option. When we are in mobile view, the display is back to `flex`, in order for the layout to look like the snippets in normal mode. However, while the normal mode columns all have the same padding, which depends on the `--gutter-x` CSS variable, the grid items still keep the horizontal grid padding, making them misaligned with the other contents. An other inconsistency in grid mode is the `--gutter-x` variable: in order for the container to be well aligned with the header, it was set to 0 (except when the container is full-width, where it is 30px). The issue is that this rule is applied on mobile too, making the container inconsistent with the normal snippets. This commit fixes these issues by blocking the horizontal grid padding in mobile view, and by setting the `--gutter-x` variable rule only for the desktop view. This commit also moves the rule added in commit [1], which is used to compensate the margins of the rows that are direct children of grid items. Indeed, now that the padding is not variable in mobile view, this rule is only needed in desktop view. [1]: https://github.com/odoo/odoo/commit/d7c2f8b4a3535f5c15043226a296d10be4208cec task-4194685 Forward-Port-Of: odoo/odoo#180665 Forward-Port-Of: odoo/odoo#180649