<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/static/src/js/components, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[FIX] web: compute default locale of Date(Time)Picker at the right time</title>
<updated>2021-03-17T16:08:32+00:00</updated>
<author>
<name>Nasreddin (bon)</name>
<email>bon@odoo.com</email>
</author>
<published>2021-03-08T12:57:03+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e2c46bb80e1e312dd34ac554d79813ef35282e62'/>
<id>e2c46bb80e1e312dd34ac554d79813ef35282e62</id>
<content type='text'>
Issue
        - Install "Accounting"
        - Change user language to arabic
        - Go to Customer Invoices list view
        - Try to filter on field "Created On"

        Traceback is raised from the DatePicker Component

Cause
	The cause is two fold:
	There is an issue in moment that behaves abnormally when its internals
	are not able to extract the month in a locale, and, instead of returning an
	invalid moment, it returns a valid moment with the month set to January
	which just happens to be the first month of moment's default locale
	ref: https://github.com/moment/moment/issues/5600

	Secondly, the defaultProps "locale" of the DatePicker was set to moment.locale()
	at the file's initial loading, that is, before any user locale parameters were loaded
	The bootstrap datepicker was then set with the wrong locale, and the case fell under moment's issue

After this commit, the locale of the DatePicker is always the one of the user, and there is no traceback

opw-2460156

closes odoo/odoo#67320

Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Lucas Perais &lt;lpe@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Issue
        - Install "Accounting"
        - Change user language to arabic
        - Go to Customer Invoices list view
        - Try to filter on field "Created On"

        Traceback is raised from the DatePicker Component

Cause
	The cause is two fold:
	There is an issue in moment that behaves abnormally when its internals
	are not able to extract the month in a locale, and, instead of returning an
	invalid moment, it returns a valid moment with the month set to January
	which just happens to be the first month of moment's default locale
	ref: https://github.com/moment/moment/issues/5600

	Secondly, the defaultProps "locale" of the DatePicker was set to moment.locale()
	at the file's initial loading, that is, before any user locale parameters were loaded
	The bootstrap datepicker was then set with the wrong locale, and the case fell under moment's issue

After this commit, the locale of the DatePicker is always the one of the user, and there is no traceback

opw-2460156

closes odoo/odoo#67320

Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Lucas Perais &lt;lpe@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: Auto close dropdown is broken</title>
<updated>2021-02-01T10:50:51+00:00</updated>
<author>
<name>Romain Estievenart</name>
<email>res@odoo.com</email>
</author>
<published>2021-01-28T14:01:32+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7cb24db622b231b89558755d9c0e7d899fc994bf'/>
<id>7cb24db622b231b89558755d9c0e7d899fc994bf</id>
<content type='text'>
Steps to reproduce:
1. Go to Project App
2. Open and edit a task
3. Click on Customer =&gt; search more
5. Click on "Filters"
6. Click on "Group by"
=&gt; The "Filters" and "Group by" dropdown are open at same time =&gt; bug

Since odoo/odoo@e4f87710e16357f24f388159a7b1e82eccda598a, we added a way
to prevent bs and owl dropdown to be open in the same time.

But when the web-editor is present, the CSS selector used to match the
opened modal ("search more" in this case) conflicts with the DOM created
by the web-editor  (modals identified by the classes: .web-editor,
.note-picture-dialog, .note-link-dialog, .note-help-dialog).

To avoid this conflict, this commit uses a more restrictive CSS selector
to match only the first (active) opened modal (as web-editor doesn't
attach its modals at the root of the body).

closes odoo/odoo#65274

Signed-off-by: Pierre Paridans &lt;pparidans@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps to reproduce:
1. Go to Project App
2. Open and edit a task
3. Click on Customer =&gt; search more
5. Click on "Filters"
6. Click on "Group by"
=&gt; The "Filters" and "Group by" dropdown are open at same time =&gt; bug

Since odoo/odoo@e4f87710e16357f24f388159a7b1e82eccda598a, we added a way
to prevent bs and owl dropdown to be open in the same time.

But when the web-editor is present, the CSS selector used to match the
opened modal ("search more" in this case) conflicts with the DOM created
by the web-editor  (modals identified by the classes: .web-editor,
.note-picture-dialog, .note-link-dialog, .note-help-dialog).

To avoid this conflict, this commit uses a more restrictive CSS selector
to match only the first (active) opened modal (as web-editor doesn't
attach its modals at the root of the body).

closes odoo/odoo#65274

Signed-off-by: Pierre Paridans &lt;pparidans@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] survey, web, web_editor, website, website_form: Prevent invalid date stock.picking</title>
<updated>2020-12-04T11:02:41+00:00</updated>
<author>
<name>Achraf (abz)</name>
<email>abz@odoo.com</email>
</author>
<published>2020-12-03T12:13:33+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b873bda1e560bc49ab707aa238fdc962f23bc1e4'/>
<id>b873bda1e560bc49ab707aa238fdc962f23bc1e4</id>
<content type='text'>
What are the steps to reproduce your issue?

1. Install "stock"
2. Go to Inventory/Inventory Overview/Internal Transfer
3. Create new record and set manually a date with year &lt; 1000 like "0008-10-10 18:35:00"
4. Save
What is currently happening?

An error arises when saving the record, and it is then no longer
possible to reopen the records or any view containing it.
This also prevents us from correcting the date to no longer have the error
Why is this happening?

The root cause is an inconsistency in `strftime` for years &lt; 1000 [1, 2]. To take it into
account, a zero-padding is needed in the DateTime parser.
How to fix the bug?

The missing padding is added.

However, such dates lead to problematic behaviors in Python:

```
DT_FORMAT = "%Y-%m-%d %H:%M:%S"
new_date = "0008-02-05 18:10:10"
datetime.strptime(
    datetime.strptime(
        new_date, DT_FORMAT
    ).strftime(DT_FORMAT),
    DT_FORMAT
)
```

This raises:
```
ValueError: time data '8-02-05 18:10:10' does not match format '%Y-%m-%d %H:%M:%S'
```

As of today there was no reported business cases where dates with year &lt; 1000 would be
necessary. Therefore, we limit the range to years &gt;= 1000.
[1] https://bugs.python.org/issue13305
[2] https://docs.python.org/dev/library/datetime.html#strftime-strptime-behavior

opw-2408260

closes odoo/odoo#62818

Signed-off-by: Nicolas Martinelli (nim) &lt;nim@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
What are the steps to reproduce your issue?

1. Install "stock"
2. Go to Inventory/Inventory Overview/Internal Transfer
3. Create new record and set manually a date with year &lt; 1000 like "0008-10-10 18:35:00"
4. Save
What is currently happening?

An error arises when saving the record, and it is then no longer
possible to reopen the records or any view containing it.
This also prevents us from correcting the date to no longer have the error
Why is this happening?

The root cause is an inconsistency in `strftime` for years &lt; 1000 [1, 2]. To take it into
account, a zero-padding is needed in the DateTime parser.
How to fix the bug?

The missing padding is added.

However, such dates lead to problematic behaviors in Python:

```
DT_FORMAT = "%Y-%m-%d %H:%M:%S"
new_date = "0008-02-05 18:10:10"
datetime.strptime(
    datetime.strptime(
        new_date, DT_FORMAT
    ).strftime(DT_FORMAT),
    DT_FORMAT
)
```

This raises:
```
ValueError: time data '8-02-05 18:10:10' does not match format '%Y-%m-%d %H:%M:%S'
```

As of today there was no reported business cases where dates with year &lt; 1000 would be
necessary. Therefore, we limit the range to years &gt;= 1000.
[1] https://bugs.python.org/issue13305
[2] https://docs.python.org/dev/library/datetime.html#strftime-strptime-behavior

opw-2408260

closes odoo/odoo#62818

Signed-off-by: Nicolas Martinelli (nim) &lt;nim@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: datepicker inside a dropdown</title>
<updated>2020-11-03T12:23:54+00:00</updated>
<author>
<name>Romain Estievenart</name>
<email>res@odoo.com</email>
</author>
<published>2020-10-30T14:13:39+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e7b5ae8cac8d1cab57785385b7e036389e8ff266'/>
<id>e7b5ae8cac8d1cab57785385b7e036389e8ff266</id>
<content type='text'>
Steps to reproduce:

1. Go to Project
2. Filter &gt; Add custom filter &gt; Last Updated on
3. Click on the date field and use the date picker to change the value
4. The dropdown is closed and you lost your selection =&gt; BUG

This bug was due to a conflict between owl and bs dropdown (e4f87710),
to prevent this bug, we added a check to ensure there are no open
bootstrap calendar inside the current dom.

Note that if you click outside the dropdown, the datepicker is already
closed when you go through this code. It means that the datepicker will
not be present in the DOM anymore and the dropdown can be closed too.

opw-2373573

closes odoo/odoo#61258

X-original-commit: 73dfc1f7a8e2197fcdd4053ec57c260576593a15
Signed-off-by: Adrien Dieudonné (adr) &lt;adr@odoo.com&gt;
Signed-off-by: res-odoo &lt;res-odoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps to reproduce:

1. Go to Project
2. Filter &gt; Add custom filter &gt; Last Updated on
3. Click on the date field and use the date picker to change the value
4. The dropdown is closed and you lost your selection =&gt; BUG

This bug was due to a conflict between owl and bs dropdown (e4f87710),
to prevent this bug, we added a check to ensure there are no open
bootstrap calendar inside the current dom.

Note that if you click outside the dropdown, the datepicker is already
closed when you go through this code. It means that the datepicker will
not be present in the DOM anymore and the dropdown can be closed too.

opw-2373573

closes odoo/odoo#61258

X-original-commit: 73dfc1f7a8e2197fcdd4053ec57c260576593a15
Signed-off-by: Adrien Dieudonné (adr) &lt;adr@odoo.com&gt;
Signed-off-by: res-odoo &lt;res-odoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: DropdownMenu autoclose behavior should match Bootstrap</title>
<updated>2020-10-28T15:02:27+00:00</updated>
<author>
<name>Romain Estievenart</name>
<email>res@odoo.com</email>
</author>
<published>2020-10-12T09:04:34+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7f1bcc8ceb78729725f65585e923b08f94bf75b5'/>
<id>7f1bcc8ceb78729725f65585e923b08f94bf75b5</id>
<content type='text'>
Before this commit, with an opened DropdownMenu component, when the user
clicks on a Bootstrap's dropdown the DropdownMenu doesn't close.

This issue is due to a conflict between the global click listener
registered to close the DropdownMenu and the listener registered by the
Bootstrap dropdown:
the last one prevents the event from bubbling up to the `window` element
and be handled by the first one.

This commit fixes it by enabling the `capture` flag on the DropdownMenu
global click listener, giving it the opportunity to handling it properly
 and close the DropdownMenu.

Note: this commit also fixes an issue when a dialog is opened from a
DropdownMenu (like the favorite's delete action) and prevents it from
closing in the background (e.g. when the dialog is still opened).

opw-1879566

closes odoo/odoo#60909

X-original-commit: e4f87710e16357f24f388159a7b1e82eccda598a
Signed-off-by: Pierre Paridans &lt;pparidans@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, with an opened DropdownMenu component, when the user
clicks on a Bootstrap's dropdown the DropdownMenu doesn't close.

This issue is due to a conflict between the global click listener
registered to close the DropdownMenu and the listener registered by the
Bootstrap dropdown:
the last one prevents the event from bubbling up to the `window` element
and be handled by the first one.

This commit fixes it by enabling the `capture` flag on the DropdownMenu
global click listener, giving it the opportunity to handling it properly
 and close the DropdownMenu.

Note: this commit also fixes an issue when a dialog is opened from a
DropdownMenu (like the favorite's delete action) and prevents it from
closing in the background (e.g. when the dialog is still opened).

opw-1879566

closes odoo/odoo#60909

X-original-commit: e4f87710e16357f24f388159a7b1e82eccda598a
Signed-off-by: Pierre Paridans &lt;pparidans@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: hide action button when no action</title>
<updated>2020-10-06T11:12:20+00:00</updated>
<author>
<name>Priyanka Kakadiya</name>
<email>pka@odoo.com</email>
</author>
<published>2020-08-26T07:38:43+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=44055fd0f0de4f4a64635bd384c6004eb67c8374'/>
<id>44055fd0f0de4f4a64635bd384c6004eb67c8374</id>
<content type='text'>
Before this commit: the action menu registry items were rendered
regardless of their inner state. The problem is that these item
components can choose not to render themselves, leading to a blank
dropdown menu if no other item was present.

To fix this, the "getProps" function of the registry has been altered to
act as validation: the item will not be rendered if the return value is
falsy. The function has also been made asynchronous to allow RPC calls.

This solution is still flawed and hides a bad design choice which is to
register components and not items or item getters; this API is too
complex for its use case(s) and adds pointless depth to the DOM. The
shape of the registry should be simplified in an improvement in master.

closes odoo/odoo#59254

Task: 2325587
X-original-commit: 45c7d881a5d130f6b3222749c8c87b6c6b45e910
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit: the action menu registry items were rendered
regardless of their inner state. The problem is that these item
components can choose not to render themselves, leading to a blank
dropdown menu if no other item was present.

To fix this, the "getProps" function of the registry has been altered to
act as validation: the item will not be rendered if the return value is
falsy. The function has also been made asynchronous to allow RPC calls.

This solution is still flawed and hides a bad design choice which is to
register components and not items or item getters; this API is too
complex for its use case(s) and adds pointless depth to the DOM. The
shape of the registry should be simplified in an improvement in master.

closes odoo/odoo#59254

Task: 2325587
X-original-commit: 45c7d881a5d130f6b3222749c8c87b6c6b45e910
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Julien Mougenot &lt;jum@odoo.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: Disables pager on enter</title>
<updated>2020-10-06T13:03:19+00:00</updated>
<author>
<name>Julien Mougenot</name>
<email>jum@odoo.com</email>
</author>
<published>2020-08-12T10:31:20+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6916a386db4cad398c6faa02d745103617a1e512'/>
<id>6916a386db4cad398c6faa02d745103617a1e512</id>
<content type='text'>
Before this commit, the pager component would only quit the edit mode if
its value changed when hitting Enter.

Now, when pressing Enter while the pager value did not change, it will
leave the edit mode and trigger a "pager-changed" event regardless.

Task 2318738

closes odoo/odoo#59277

X-original-commit: a3197283d52bfda399ce45b7d5a52406885336d0
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, the pager component would only quit the edit mode if
its value changed when hitting Enter.

Now, when pressing Enter while the pager value did not change, it will
leave the edit mode and trigger a "pager-changed" event regardless.

Task 2318738

closes odoo/odoo#59277

X-original-commit: a3197283d52bfda399ce45b7d5a52406885336d0
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: prevent dropdown closing on mouseup</title>
<updated>2020-09-16T08:26:26+00:00</updated>
<author>
<name>Hardik Prajapati</name>
<email>hap@odoo.com</email>
</author>
<published>2020-08-05T13:10:26+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=450e0ec45005c3d6c2e8475e134113a7d8515e9f'/>
<id>450e0ec45005c3d6c2e8475e134113a7d8515e9f</id>
<content type='text'>
Before this commit, selecting the whole content of the custom filter
input and releasing the cursor outside of the dropdown closed the
dropdown.

With this commit, the dropdown is kept open in this situation.

task - 2276544

closes odoo/odoo#55660

Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, selecting the whole content of the custom filter
input and releasing the cursor outside of the dropdown closed the
dropdown.

With this commit, the dropdown is kept open in this situation.

task - 2276544

closes odoo/odoo#55660

Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: datepicker get correct database format</title>
<updated>2020-07-29T11:20:16+00:00</updated>
<author>
<name>Julien Mougenot</name>
<email>jum@odoo.com</email>
</author>
<published>2020-07-28T09:27:13+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d3f0632f4977cd1f7d7099fb2688722bcd451d27'/>
<id>d3f0632f4977cd1f7d7099fb2688722bcd451d27</id>
<content type='text'>
Before this commit, the format used by both date and datetime picker
components depended on default props which are evaluated on module
loading. This was an issue because the "time" module did not have time
to load and fetch the correct database value, hence using the default
ones.

Now, the format is evaluated on component instantiation, giving enough
time to the "time" module to load.

Task 2307258

closes odoo/odoo#55113

X-original-commit: 792b565a65a8c9f65bf13e94f30b88913f2bfa7f
Signed-off-by: Paul Morelle &lt;madprog@users.noreply.github.com&gt;
Signed-off-by: Julien Mougenot (jum) &lt;jum@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, the format used by both date and datetime picker
components depended on default props which are evaluated on module
loading. This was an issue because the "time" module did not have time
to load and fetch the correct database value, hence using the default
ones.

Now, the format is evaluated on component instantiation, giving enough
time to the "time" module to load.

Task 2307258

closes odoo/odoo#55113

X-original-commit: 792b565a65a8c9f65bf13e94f30b88913f2bfa7f
Signed-off-by: Paul Morelle &lt;madprog@users.noreply.github.com&gt;
Signed-off-by: Julien Mougenot (jum) &lt;jum@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: remove min date limitation of year 1900</title>
<updated>2020-07-28T14:02:10+00:00</updated>
<author>
<name>Harpritsinh Sisodiya</name>
<email>hsi@odoo.com</email>
</author>
<published>2020-05-15T14:29:17+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6aa6c321a6cfc08e5490781c4fc7ee62beeebb15'/>
<id>6aa6c321a6cfc08e5490781c4fc7ee62beeebb15</id>
<content type='text'>
Before this commit, user could not selecta a date before year 1900.
This was an historical limitation due to python &lt; 3.2 that didn't
support dates before 1900.

After this commit, user can select any date, user can select any
date from 01/01/0001.

taskID: 2166761
Fixes #41788
Closes #43055

closes odoo/odoo#51406

Signed-off-by: Géry Debongnie (ged) &lt;ged@openerp.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@odoo.com&gt;
Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, user could not selecta a date before year 1900.
This was an historical limitation due to python &lt; 3.2 that didn't
support dates before 1900.

After this commit, user can select any date, user can select any
date from 01/01/0001.

taskID: 2166761
Fixes #41788
Closes #43055

closes odoo/odoo#51406

Signed-off-by: Géry Debongnie (ged) &lt;ged@openerp.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@odoo.com&gt;
Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
