odoo/odoo#165409
Created by fw-bot
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- label
- odoo-dev:master-17.0-fix-datepicker-calender-rde-DXgE-fw
- head
- 7f06d4486e74cb9b94e12bf71ba5cbb0e0b78013
- merged
- 2 years ago by Quentin Smetz (qsm)
| odoo/odoo | odoo/enterprise | |
|---|---|---|
| 17.0 | #161466 | |
| saas-17.1 | #165358 | |
| saas-17.2 | #165379 | |
| 18.0 | ||
| saas-18.2 | ||
| saas-18.3 | ||
| saas-18.4 | ||
| 19.0 | ||
| saas-19.1 | ||
| master | #165409 | #62635 |
[FW][FIX] web, *: make "input group date" calendar icon open the date picker
*: website, survey
Since commit 1 the calendar icon in input group date is not clickable
anymore and does not open the date picker anymore.
This commit simply restore that by auto discovering the calendar icon,
should the input group follow this common pattern:
<div class="input-group date">
<input
type="text"
class="form-control datetimepicker-input"
/>
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
This seems enough to cover all cases detected in the website apps:
- <details><summary>The two datepicker in /my/opportunity when editing the lead to adapt
the "Expected Closing" and "Next Activity Date" fields</summary>
</details>
- <details><summary>The website form date(time) input</summary>
</details>
- <details><summary>The ecommerce renting product rental period inputs ("from" and "to"
dates) </summary>
</details>
- <details><summary>The o_website_sale_daterange_picker snippet</summary>
</details>
- <details><summary>The survey date fields</summary>
</details>
- ..maybe other places..
Should there be cases needing this feature for calendar icons which are
not following the suggested input group layout, they can do it this way:
- this.call("datetime_picker", "create", {
+ const picker = this.call("datetime_picker", "create", {
// ...
}).enable();
+ this.el.parentNode.querySelector(".input-group-text").addEventListener("click", picker.openPicker(0));
Forward-Port-Of: #161466