Files
odoo_source/addons/base_import/models
Nicolas Martinelli f925026501 [FIX] base_import: date pattern
- Change the date format of the users language to "%b %d, %Y"
- Export any res.partner as .csv and include at least 'Display Name' in
the fields to Export
- Import the file exported

The import fail with error: "Import preview error failed due to: 'b'".

This was introduced with commit 32c2666d18 where the format of the
user was added in the list of patterns to match. Since we use a limited
version of TimeRE (see Python module `_strptime`), only the patterns
defined in `_P_TO_RE` are supported. If an unsupported format is used, a
`KeyError` is raised.

We simply skip the pattern if it cannot be parsed. Another solution
would be to instanciate TimeRE, but that would also require to set the
locale correctly. Long story short: things will start to get messy for a
nice-to-have feature, a.k.a being able to import dates such as
`January 1, 2019`.

Fixes #35868

opw-2055971
opw-2055140

closes odoo/odoo#35883

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-08-21 07:44:02 +00:00
..
2019-08-21 07:44:02 +00:00