automatically try to detect type of columns from the first 10 rows of file:
If column only contains integer, only show, int, float, monetary, m2o, o2m, m2m fields in wizard
If column only contains true/false values, only show boolean fields in wizard
etc
add an advanced mode which is the same as previous import (show all fields)
Support different date format and float value with currency as well as float value with parenthesis to reprensent negative value.
SQL dump:
- Recent export with -O to remove owners
- correct poor Ramzy name
purchase order CSV:
- use correct column names
- remove destination and pricelist columns
- first file should not contain order lines
- second file should be same as first + lines
Missing bit from #10374: because the _read_xls function is a generator
it is *entirely* lazy and Python doesn't execute *any* code when it's
initially called, which means the file is actually (tentatively) parsed
when the first line is requested which happens outside of
_read_file (and thus of the fallback mechanism implemented by #10374).
Fix by splitting _read_xls between the opening of the workbook (eager)
and the actual iteration (which remains lazy).
CSV export was added in f146e2a and since then newline were not
exported.
But new line should be allowed if the string is quoted by " characters
which is done in Odoo.
closes#11005
opw-667853
Rather than trust the user-controlled mimetype or extension of imported
files which may be incorrect (because the user is lying, because the
system is misconfigured, because software is not installed, because
software is registering non-standard mimetypes, etc...), start by trying
to guess the mimetype *then* fallback on trying the type/ext.
Of note: CSV is becoming less and less great as it's nigh impossible to
guess for it.
If the user provides a known mimetype which doesn't actually match the
file as far as we're concerned, warn and fallback on extension rather
than blow up.
This comes up when a user installs Excel on Windows: it associates CSV
files with itself and sets their mime type to application/vnd.ms-excel,
which is not correct and leads to us trying to load a CSV with xlrd (an
excel-parsing library).
Fixes#9779