summaryrefslogtreecommitdiff
path: root/addons/base_import/static/src/js/import.js
AgeCommit message (Collapse)Author
2016-07-07[MOV] base_import: module directory organizationHitesh Trivedi
Note: move test models file in models to not import tests directory, which breaks the mute_logger of test cases
2016-07-01[FIX] base_import: fix error when trying to load a file and then clicking on ↵Cedric Snauwaert
cancel while file opener is opened
2016-06-15[MERGE] forward port of branch saas-10 up to baf494cChristophe Simonis
# Conflicts: # addons/hr_timesheet/project_timesheet.py # addons/sale_layout/i18n/es_PE.po # addons/sale_layout/i18n/hu.po # addons/sale_layout/i18n/lo.po # addons/sale_layout/i18n/pl.po # addons/sale_service/i18n/es_MX.po # addons/sale_service/i18n/es_PE.po # addons/sale_service/i18n/lo.po # addons/stock/stock.py # addons/stock/stock_view.xml # addons/warning/i18n/es_PE.po # addons/warning/i18n/lo.po # addons/warning/i18n/ru.po # addons/web/i18n/cs.po # addons/web/i18n/ja.po # addons/web/i18n/lo.po # addons/web/i18n/th.po
2016-06-14[MERGE] forward port of branch saas-6 up to df95b1fChristophe Simonis
The changes in `l10n_es` [1] have been ignored. They will be ported to the new accouting later. [1] See 730890f3696e8117eec429bc302e5b67bee69fa0 and e3e5cfe82c43d9701858bd643e02df390f5f6f66
2016-06-14[FIX] base_import: handle other cases of wrong CVS mime typesOlivier Dony
Improves 8049d1e855204c64b56577ecdc32f838f494474c for other detected cases, e.g. on Firefox + OSX. opw-680347
2016-06-09[FIX] base_import: file type on WindowsNicolas Martinelli
When a user imports a CSV file on Windows, the "CSV Format Options…" field does not appear. This is an issue since it might be necessary to tune these options depending on the file, e.g. change the encoding. For some unknown reason, on Windows, the file type is empty whatever the browser used. Therefore, we fall back on the extension of the file. opw-680347
2016-06-08[FIX] base_import: disable tracking during validationMartin Trigaux
Force the value tracking_disable to be make sure that the validation (which is supposed to have no impact), will not send any email. Fixes #3173
2016-04-07[REF] base_import: simplify import by reducing choice for the columns based ↵Cedric Snauwaert
on heuristic 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.
2015-08-26[ADD] base_import: support for XLS and ODS filesXavier Morel
* added intermediate ``_read_file`` step dispatching between CSV, ODS and XLS(X) parsing - primary dispatch on mime type, secondary on file extension: + OS may not provide a relevant mime type if no software locally installed for the filetype (e.g. Windows sends excel files as application/octet-stream if excel is not installed, and ODS files as zip if OpenOffice/LibreOffice isn't installed) + applications may re-register extensions to non-standard mimetypes breaking the dispatcher So if the mimetype is found trust it, otherwise try with the filename's extension (if any) - all readers skip lines with only empty cells in their output - ODS and XLS content are "CSVified", rows are converted to arrays of unicode strings * UI altered to not assume CSV files everywhere, and avoid returning garbage preview data for non-CSV imports Various: * added a ``can_import`` utility function to tests.common, can be used to skip tests if an optional Python dependency is not installed (but one would like tests to run if the dependency is available) * fixed datetime issue in ir_fields * added converter for monetary fields (iso float) * spreadsheet don't have integers, twiddling required to ensure integral values won't be serialized as floats (breaking conversion back to Python) * improved some tests by asserting no error is generated (bonus: logs the error message if there is one, rather than just saying the result is blown) * because some systems only provide elderly versions of XLRD (e.g. current debian stable provides 0.9.2 from April 2013) - keep using xldate_as_tuple instead of 0.9.3's xldate_as_datetime, workaround is simple - check for xlrd.xlsx in case of pre-0.8 XLRD Authorship: Ronak Baxi <rba@odoo.com> Mohammed Shekha <msh@openerp.com> Task 10792 Closes #7285
2015-07-29[IMP] base_import: ControlPanelMixin and new design compatibilityAaron Bohy
- Use the ControlPanelMixin in the Import view; - Adapt the stylesheet to fit with both community and enterprise editions; - Convert the css into less, use mixins and variables defined in web; - Return the reload() deferred in the on_reverse_breadcrumb callback so that the previous action waits to be properly reloaded before being shown.
2015-07-29[FIX] base_import: action button 'Import'Aaron Bohy
Adapt the template according to the refactoring of the parent commit.
2015-07-10[IMP] web: split model.js into model.js and data_model.js. Web js modules ↵Christophe Matthieu
must call web.DataModel.
2015-03-20[IMP] Web and all views: ControlPanel atomic updateAaron Bohy
Change the logic of rendering and displaying/hidding the control elements (buttons, sidebar and pager) of all views. The views do no more render automatically their elements as this is rather done through the render_[element] function called by the ViewManager. This function only appends the element to the $node given as argument. If no argument is given, then it may appends it to the DOM directly, within the adequate div of its template. This allows the ViewManager to attach/detach all elements of the ControlPanel in an atomic may, to prevent the ControlPanel from flickering. Also detach the contents of the ControlPanel in headless mode. Headless means that the ControlPanel exists, but is hidden. Detaching its contents permits to have a cleaner DOM. Also remove the oe_form_dirty class on the buttons in the FormView, as this class is only used on the view itself. Side changes: * base_import: import.js: Extend render_buttons function to be compliant with the new buttons rendering logic * board: dashboard.js: Set flag search_view to True as the searchview is needed for the Views displayed in the Dashboard to retrieve the records to display. Necessary since we do no more construct the searchview when this is set to false * google_drive: drive.js, share: share.js: Module extending the Sidebar widget often add their own buttons by extending the start(), which is called each time the Widget is appended to the DOM. With our new design, this could be done in start() anymore as it should be done only one. It is now done in init() instead.
2015-03-18[IMP] web+addons: improvement to module systemGéry Debongnie
The module system needs to know the dependencies of a given module before executing the function. This is why the dependencies were defined once in an array, and then were described one more times in the call to require. But a trick can simplify this: the boot function can parse the string representation of the module and extract the calls to require from it. It is more work for the processor, but it leads to simpler module definitions.
2015-03-18[REF] base_import: update to the new module systemGéry Debongnie
2014-05-12[IMP] mail, base_import: context key disabling history trackingXavier Morel
* added a ``tracking_disable`` context key used by mail to completely disable subscriptions setup and events generation during create and write operations * added import option to optionally set up that context key and speed up imports at the cost of not setting up subscriptions and not sending create/update events bzr revid: xmo@openerp.com-20140512100400-d1axjam2d0i2y0tf
2014-03-25[FIX] IE9 - Move the placeholder in base_import from view to js, to use the ↵Kersten Jeremy
mechanism of select2 and not the jquery.placeholder. Else, jq.placeholder override the select2 value, because the style option is in reality an input in dom. bzr revid: jke@openerp.com-20140325173205-n2q0dw1kynlkint7
2013-11-28[FIX]base_import: if the error message was an except_orm or an access denied ↵Denis Ledoux
error, the error message was not displayed, only a red div without anything in it. bzr revid: dle@openerp.com-20131128163613-e20nbr3yqvhvx4bv
2013-10-31[FIX]base_import: context was not considered while importing. Thus, default ↵Denis Ledoux
value (for instance) was not set, and that leaded to inconsistencies (Like importing supplier invoices was actually creating customer invoices lp bug: https://launchpad.net/bugs/1086424 fixed bzr revid: dle@openerp.com-20131031135605-ffj3tid9prw2mv8z
2013-02-04[FIX] base_import: list possible separators in a combo box for easier ↵Xavier Morel
handling of tab-separated files inserting a tab character in a text field is often difficult, as it's also used to switch between activable nodes bzr revid: xmo@openerp.com-20130204135701-yta16mkvw2pmh6hs
2013-02-04[FIX] base_import: don't crash UI when an unexpected exception is raised ↵Xavier Morel
during the import process treat exceptions as 'normal' failures, convert to a regular 'error' message bzr revid: xmo@openerp.com-20130204125214-gy0l6qlt9obkb81x
2012-11-07[MERGE] trunkFabien Meghazi
bzr revid: fme@openerp.com-20121107091958-f3rqu7nc585umjwq
2012-11-06[FIX] base_import: only allow reloading the current file if there *is* a ↵Xavier Morel
current file loaded bzr revid: xmo@openerp.com-20121106084353-npwkbkg6r0wkwdrg
2012-11-05[MERGE] trunkFabien Meghazi
bzr revid: fme@openerp.com-20121105201222-ws94bdyo8l9rqjjq
2012-11-05[IMP] Client actions now takes the action as argument. Use action.params for ↵Fabien Meghazi
options. bzr revid: fme@openerp.com-20121105130130-dwkn8124zc6yq933
2012-10-31[IMP] jQuery deferred API changes refactoring. Changed 'then's in ↵Fabien Meghazi
'done'/'fail' and 'pipe's in 'then' bzr revid: fme@openerp.com-20121031103148-r1slfpl2kcnajjd3
2012-10-22[FIX] methods renamed in web client but not fixed in addonsXavier Morel
bzr revid: xmo@openerp.com-20121022100800-yft9a5itqgb2ohhy
2012-10-17[IMP] WebClient api change. ActionManager#do_action() now takes an optional ↵Fabien Meghazi
'options' dict as second argument bzr revid: fme@openerp.com-20121017145639-xyyg9askp6xtlg6r
2012-10-12[CHG] don't scroll to the info messages after a validation or a failed importXavier Morel
as asked by fp bzr revid: xmo@openerp.com-20121012140317-3m6nh1zb7ib1om09
2012-10-10[ADD] reload file button next to the file input, as webkit browsers and MSIE ↵Xavier Morel
don't trigger change when a file input is re-set to thee same file Using other events (e.g. 'click') is not kosher as the event is triggered long before the file is picked, the alternative is to use the File API and regularly check the file in the input to see if it's been altered (by storing a crc) and re-pushing it if the hash is different. Of course this has other issues (risks catching the file mid-edition...) A third alternative is, once a file has been uploaded, to clear and re-insert the corresponding file input. This means the file input will *always* be empty bzr revid: xmo@openerp.com-20121010101836-qtqmcc5n5zblgmcp
2012-10-04[IMP] pass restore callback to import actionXavier Morel
so that the listview can reload itself after coming back from an import (successful or not) and show the results of the import. bzr revid: xmo@openerp.com-20121004133840-a2uy4s5qhpqqvp8h
2012-10-04[IMP] base_import: provide an encoding pickerXavier Morel
bzr revid: xmo@openerp.com-20121004115024-m77q5c95i12q3qkm
2012-10-04[FIX] base_import: should be possible to re-validate a file after a failed ↵Xavier Morel
import or validation bzr revid: xmo@openerp.com-20121004083231-qyl8l58wyhb7g2c3
2012-10-03[IMP] relational field 'more values' dialog list featuresXavier Morel
force display of pager and search view, make list non-selectable bzr revid: xmo@openerp.com-20121003152444-phnn9sc9nqo1ecpn
2012-10-03[IMP] formalize state transitions via an actual fsmXavier Morel
bzr revid: xmo@openerp.com-20121003145048-wdoo712j551jow3t
2012-10-03[IMP] highlight toggling between validation and import buttonsXavier Morel
bzr revid: xmo@openerp.com-20121003121619-e6nbd78mfa5owycp
2012-10-03[IMP] make import into a full-scene client actionXavier Morel
* Correctly handle back (via history_back) * Disable buttons when no file has been loaded yet * Highlight import when a validation has yield no message bzr revid: xmo@openerp.com-20121003121137-xo7lu5m5y0s7gyo1
2012-10-01[IMP] base_import: better warnings when the file parsing has very likely failedXavier Morel
bzr revid: xmo@openerp.com-20121001142227-v1iypgjgfcq4pgo7
2012-10-01[ADD] base_import: info message when everything looks ok after a validationXavier Morel
bzr revid: xmo@openerp.com-20121001140622-v63opfo97mmxf3sr
2012-10-01[IMP] base_import: typo in field name for row number offsetXavier Morel
bzr revid: xmo@openerp.com-20121001135217-0ao29ldft17d52ur
2012-10-01[IMP] Invert order of buttons in import dialog, add 'or cancel' linkXavier Morel
bzr revid: xmo@openerp.com-20121001105235-0d954cxt9y80q89w
2012-09-27[FIX] correctly transform 'get all possible values' action links to display ↵Xavier Morel
list views as list views bzr revid: xmo@openerp.com-20120927094950-pwlgv2kt2a0jz8ji
2012-09-27[ADD] unstyled and incomplete handling of @moreinfoXavier Morel
action triggering is still missing bzr revid: xmo@openerp.com-20120927074845-pb3osgymmtddglc0
2012-09-26[IMP] warning and error reporting during importXavier Morel
bzr revid: xmo@openerp.com-20120926165052-7eq4ne62h63zbqqm
2012-09-26[IMP] errors display, dryrun management (add button)Xavier Morel
bzr revid: xmo@openerp.com-20120926135013-rkbvxluu6tqz9a1l
2012-09-11[IMP] re-introduce Import button/link when base_import is installedXavier Morel
bzr revid: xmo@openerp.com-20120911063849-xqw380wglzxviojf
2012-09-10[IMP] base_import: lexicographically sort fields in field-matching UIXavier Morel
bzr revid: xmo@openerp.com-20120910072032-wbgafg3z45z4l29a
2012-09-06[FIX] field-selection UI in import table: replace jquery-autocomplete by select2Xavier Morel
* jQuery autocomplete requires complex hacks to work out and look select-ish * select2 is more straightforward to use for people expecting <select> as it's styled similarly to a (non-standard) select * select2 includes built-in support for groups, no need to hack it via interspersed fake options * select2 provides a nice [x] button to remove the current choice without having to e.g. manually remove the content of the input Why select2 instead of Chosen? Because Chosen isn't really setup to work from array data, it wants selects serialized in the DOM, and while the webkit bug I'd identified previously (see web client revid:xmo@openerp.com-20110922085812-3u1esk6czraskm01) seems fixed in the very latest webkits, it's still present in e.g. Safari 5.1 which I'm using. So there. And chosen's APIDoc is almost as bad as OpenERP's. bzr revid: xmo@openerp.com-20120906103516-h94e6hd76w41bmyx
2012-09-03[FIX] comment out validation dryrun import: not for phase 1Xavier Morel
bzr revid: xmo@openerp.com-20120903142248-v5oti2gltew9f674
2012-09-03[IMP] add validation call after each field matching (slooooooowwwwww)Xavier Morel
bzr revid: xmo@openerp.com-20120903142110-0mziyxhcku22gbm8