<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web/static/src/js/fields/field_utils.js, 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: parseDateTime util optimizations</title>
<updated>2021-05-28T13:29:21+00:00</updated>
<author>
<name>Bruno Boi</name>
<email>boi@odoo.com</email>
</author>
<published>2021-05-12T14:07:05+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=2ac6492cc29b7300cf1ab1635222d3b96ea5507d'/>
<id>2ac6492cc29b7300cf1ab1635222d3b96ea5507d</id>
<content type='text'>
- `parseDateTime` util: we now caches "without zero" date and time formats

Taskid: 2412172</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- `parseDateTime` util: we now caches "without zero" date and time formats

Taskid: 2412172</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>[IMP] web: add smart date input on date field</title>
<updated>2020-08-11T14:15:43+00:00</updated>
<author>
<name>Michael Mattiello (mcm)</name>
<email>mcm@odoo.com</email>
</author>
<published>2020-08-03T12:17:25+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a5cca2cda3b5dc9468961fe7bebeb1257d67ecdd'/>
<id>a5cca2cda3b5dc9468961fe7bebeb1257d67ecdd</id>
<content type='text'>
This commit adds smart date inputs for date and datetime fields.

The goal of smart date input is to provide the user some shortcuts
when setting dates.

The rule is [+-]\d+[dwmy]?
So we can enter inputs like:
  +3  to have today + 3 days
  -2w to have today - 2 weeks
  +1y to have today + 1 year
  +5m to have today + 5 months
  -4d to have today - 4 days

closes odoo/odoo#55602

Task: 2270347
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds smart date inputs for date and datetime fields.

The goal of smart date input is to provide the user some shortcuts
when setting dates.

The rule is [+-]\d+[dwmy]?
So we can enter inputs like:
  +3  to have today + 3 days
  -2w to have today - 2 weeks
  +1y to have today + 1 year
  +5m to have today + 5 months
  -4d to have today - 4 days

closes odoo/odoo#55602

Task: 2270347
Signed-off-by: Aaron Bohy (aab) &lt;aab@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>
<entry>
<title>[FIX] web: properly display boolean fields in kanban</title>
<updated>2020-07-07T09:17:37+00:00</updated>
<author>
<name>Hardik Prajapati</name>
<email>hap@odoo.com</email>
</author>
<published>2020-07-01T11:23:31+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=8e91b0ad3b1119b69f7a2922d1c61bb9a06529f5'/>
<id>8e91b0ad3b1119b69f7a2922d1c61bb9a06529f5</id>
<content type='text'>
Before this commit, boolean fields (without widget="boolean") in
kanban views were displayed as [Object object], because when no
widget is specified, we display the (textual) formatted value of
the field. However, the boolean formatter returns by default a
string encoding an html checkbox.

This commit passes the correct option to force a string formatting,
so it now displays "True" or "False". Moreover, this commit
uniformizes formatter options for that purpose, as another option
had been recently introduced for monetary field.

Note that those options should not be necessary, as formatters
should always return text values (no html). But this is a larger
change, that we might do in the future.

Task 2280394

closes odoo/odoo#53937

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, boolean fields (without widget="boolean") in
kanban views were displayed as [Object object], because when no
widget is specified, we display the (textual) formatted value of
the field. However, the boolean formatter returns by default a
string encoding an html checkbox.

This commit passes the correct option to force a string formatting,
so it now displays "True" or "False". Moreover, this commit
uniformizes formatter options for that purpose, as another option
had been recently introduced for monetary field.

Note that those options should not be necessary, as formatters
should always return text values (no html). But this is a larger
change, that we might do in the future.

Task 2280394

closes odoo/odoo#53937

Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: kanban: format monetary w/o widget</title>
<updated>2020-06-22T09:07:21+00:00</updated>
<author>
<name>Victor Feyens</name>
<email>vfe@odoo.com</email>
</author>
<published>2020-06-05T13:22:27+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7f21258d39053a398ef8b1fed3039b879346f65a'/>
<id>7f21258d39053a398ef8b1fed3039b879346f65a</id>
<content type='text'>
Before this commit, monetary fields occurring in kanban views
without widget="monetary" specified weren't correctly formatted:
the whitespace separating the value from the currency symbol was
formatted has $nbsp; (html) instead of a simple whitespace.

closes odoo/odoo#52521

Signed-off-by: Aaron Bohy (aab) &lt;aab@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, monetary fields occurring in kanban views
without widget="monetary" specified weren't correctly formatted:
the whitespace separating the value from the currency symbol was
formatted has $nbsp; (html) instead of a simple whitespace.

closes odoo/odoo#52521

Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Aaron Bohy &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: add options to formatFloatTime</title>
<updated>2020-06-15T13:53:21+00:00</updated>
<author>
<name>Michael Mattiello (mcm)</name>
<email>mcm@odoo.com</email>
</author>
<published>2020-06-08T07:10:08+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4197ebfabc1329110b18aa4972b5317e739d4dc0'/>
<id>4197ebfabc1329110b18aa4972b5317e739d4dc0</id>
<content type='text'>
This commit adds noLeadingZeroHour option to formatFloatTime.
The noLeadingZeroHour option can be used to format the value
like 1:30 instead of 01:30

This format behaviour is wanted for fields in web_grid module.

Task 2261853

closes odoo/odoo#52217

Related: odoo/enterprise#10870
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Hardik Prajapati &lt;hap@odoo.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds noLeadingZeroHour option to formatFloatTime.
The noLeadingZeroHour option can be used to format the value
like 1:30 instead of 01:30

This format behaviour is wanted for fields in web_grid module.

Task 2261853

closes odoo/odoo#52217

Related: odoo/enterprise#10870
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
Co-authored-by: Hardik Prajapati &lt;hap@odoo.com&gt;
Co-authored-by: Mohammed Shekha &lt;msh@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: introduce parser for `many2one_reference`</title>
<updated>2020-03-10T18:41:00+00:00</updated>
<author>
<name>Damien Bouvy</name>
<email>dbo@odoo.com</email>
</author>
<published>2020-03-10T16:09:10+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6bcf02efebf7e237db4955249b6141d10664ec46'/>
<id>6bcf02efebf7e237db4955249b6141d10664ec46</id>
<content type='text'>
Follow-up of d0c852f

The parser of `many2one_reference` was not introduced when the new field
type was created and then later when the formatter was added, which
leads to errors when the web client is trying to set the value of such
fields.

Since the value of this field is an ID, it is parsed as an integer.

closes odoo/odoo#47330

X-original-commit: db1e16bc041e1d892fd1f3ac5b694e12496a32f9
Signed-off-by: Damien Bouvy (dbo) &lt;dbo@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Follow-up of d0c852f

The parser of `many2one_reference` was not introduced when the new field
type was created and then later when the formatter was added, which
leads to errors when the web client is trying to set the value of such
fields.

Since the value of this field is an ID, it is parsed as an integer.

closes odoo/odoo#47330

X-original-commit: db1e16bc041e1d892fd1f3ac5b694e12496a32f9
Signed-off-by: Damien Bouvy (dbo) &lt;dbo@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web: show % symbol outside the input in percentage widget</title>
<updated>2020-02-06T11:55:13+00:00</updated>
<author>
<name>Michael Mattiello (mcm)</name>
<email>mcm@odoo.com</email>
</author>
<published>2020-01-27T07:17:49+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c5e34d77f5d84c1811e29cabdffdd408695d1d2d'/>
<id>c5e34d77f5d84c1811e29cabdffdd408695d1d2d</id>
<content type='text'>
Before this commit the % symbol was part of the input. We could write a
value with the % symbol to divide the value by 100 (50% = 0.5, 50 = 50)

This commit removes the % symbol from the input and adds it in a span
after the input so we do not need to write the % symbol anymore.

The value from the input will be saved as $value / 100 in database.

task-2065078

closes odoo/odoo#43995

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 % symbol was part of the input. We could write a
value with the % symbol to divide the value by 100 (50% = 0.5, 50 = 50)

This commit removes the % symbol from the input and adds it in a span
after the input so we do not need to write the % symbol anymore.

The value from the input will be saved as $value / 100 in database.

task-2065078

closes odoo/odoo#43995

Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web: handle m2o whose comodel name field is an m2o</title>
<updated>2019-11-20T10:39:29+00:00</updated>
<author>
<name>Aaron Bohy</name>
<email>aab@odoo.com</email>
</author>
<published>2019-11-19T12:21:32+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=8aba4cd406709453ea4c63b8087a240de6ce00b2'/>
<id>8aba4cd406709453ea4c63b8087a240de6ce00b2</id>
<content type='text'>
This is a weird situation, but the python handles it. Let's assume
a many2one field F1 on model M1 with comodel M2, and on M2 the name
field (which is the _rec_name) being itself a many2one, and the
following scenario:
 - create a new record for M1
 - for field F1, select 'Create and Edit': it opens a form view for
   M2 in a dialog
 - type something in F2 input, and click 'Quick create'
 - save the dialog

Before this rev., the value of F1 was [object Object]. Now, the new
value is properly displayed.

OPW 2091106

closes odoo/odoo#40549

X-original-commit: 5a04ea848abf50b1fb1f9893d1fcd98013bc025d
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a weird situation, but the python handles it. Let's assume
a many2one field F1 on model M1 with comodel M2, and on M2 the name
field (which is the _rec_name) being itself a many2one, and the
following scenario:
 - create a new record for M1
 - for field F1, select 'Create and Edit': it opens a form view for
   M2 in a dialog
 - type something in F2 input, and click 'Quick create'
 - save the dialog

Before this rev., the value of F1 was [object Object]. Now, the new
value is properly displayed.

OPW 2091106

closes odoo/odoo#40549

X-original-commit: 5a04ea848abf50b1fb1f9893d1fcd98013bc025d
Signed-off-by: Aaron Bohy (aab) &lt;aab@odoo.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
