summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/framework
AgeCommit message (Collapse)Author
2016-07-05[FIX] web: parsing of date with abbreviated month/dayDenis Ledoux
When using the abbreviated month in the language date format (`%b`), e.g. `%d %b %Y` in some languages, the parsing of the date from this format to the database format (YYYY-mm-dd) failed because of a dot `.` added from time to time to the end of the abbreviated name e.g., in French, `5 juil. 2016` This is a bug of `moment.js` < 2.13.0, handling badly this dot. This is solved from `moment.js` 2.13.0, thanks to the below revision moment/moment@41fdb58572546740c3a840ebd36fbe9e1bcdc9cb moment/moment#3078 Unfortunately, we cannot update this library to its latest release in stable release of Odoo (e.g. 9.0), as this is seen as an unstable change (if some API changes occured in the given library) Instead, if the parsing of the date fails with the strict mode (meaning the date must respect the format exactly), we perform a second pass without the strict mode, so this dot will be ignored, and the date can be correctly parsed. The issue can be reproduced by loading the French language, and setting `%d %b %Y` as date format, and then performing an advanced search on a date field. The value of the date in the advanced search will be empty without this revision (for the months having more than 4 chars, other than `mars`, `mai`, `juin`, `aout`). Fixes #11854 opw-682534
2016-07-04[FIX] web: dialog close with a reasonDenis Ledoux
In the below revision: c0db6aec56d383d173fa56b1a2dec2e42495911b The dialog close `reason` was introduced to not reload the current form if the dialog has been closed for a reason (e.g. a window action was returned by the server). This is to prevent the record reload, which: - Is useless, as another action has been launched and the user therefore redirected elsewhere - Can fail, in the case the initial action deleted the current record (e.g. when merging a lead in an opportunity, the lead is removed, and therefore this is not possible to reload it). opw-680180
2016-06-27[FIX] js: translations and string substitutionsMartin Trigaux
_('foo '+bar) does not work as `bar` is a variable with undefinied content during translation export (and variable content during evaluation) so a match will not be found. Also trailing spaces are stripped during synchronisation with transifex. The proper syntax would be _.str.sprintf(_t("foo %s"), bar) but to avoid breaking existing translations (need to reexport .pot) use the syntax _("foo ") + " " + bar that is more stable friendly. The 'No value found for the field...' string is not possible to be fixed without breaking the translations should be split at least twice. Write it the propre way directly.
2016-05-10[FIX] web: search input of dateNicolas Martinelli
When the user searches for date (or a datetime) in the search bar, the suggested date can become completely wrong. For example, in the French localization where the date format is DD/MM/YYYY, the system will search for the date MM/DD/YYYY. This is even worse when the date is not fully written: DD/MM could be converted to MM/DD/0000, which doesn't make any sense. This is related to the moment issue https://github.com/moment/moment/issues/1407. The fix is to make sure that the input date has a correct format thanks to `parse_value`. The latter converts the date into a fixed format. Fixes #11876 opw-676604
2016-04-20[FIX] web: fix dataset to avoid race conditionsGéry Debongnie
The read_slice method in dataset is problematic, because it alters the dataset ids. So, if 2 consecutive read_slice are started, but the first one ends after the second one, we don't have the correct ids in the dataset. This commit just make sure that previous read_slice do not alter the ids of the next read_slice.
2016-04-19[FIX] web: fix iOS file downloadingJoren Van Onder
e8a00bc50da435d3859118ca127d20a2eb9a0cab moved the get_file function from web.session to web.ajax. The issue is that get_file uses session.url() for iOS devices. Also, in order to prevent an infinite spinner options.complete() is called before actually opening up the new window. Although this resolves the issue it still requires the user to configure Safari to allow pop-ups, otherwise they are silently ignored. opw-672882
2016-04-04[FIX] web: some float fields silently ignores their changesGéry Debongnie
We have an interesting problem when editing all custom float fields and all fields with no explicit digit attributes: the propertiesmixin tries to check if the number was changed, according to their declared precision. But for these specific fields, it does not find a digit attribute, and defaults to 2. Then, it makes sure that the changes are ignored if the new value is too close to the old value (with 2 digits precision) For example, if the user sets the value to 1.234, then save, then change it to 1.235, then save, the form view will display 1.234 and totally ignore the change. Not that handling the digit precision is done in the propertiesmixin and in the field float widget. Also, they do different things, and in some case, may not be the same. All this logic should be moved to the fieldfloat widget.
2016-03-16[FIX] web: len & non zero implementation for wrapping list/dictDenis Ledoux
The implementation of `__len__` & `__nonzero__` were not defined for the py types `wrapping_dict` and `wrapping_list`. For instance, this prevented an empty list to be considered as `False` in domains evaluated by the web client. e.g., in the automatic partner merge wizard, the domain ``` [('id', 'in', partner_ids and partner_ids[0] and partner_ids[0][2] or False)] ``` is used. When the `partner_ids` list was empty (meaning the "partners to merge" list was empty in the wizard), it wasn't considered as `False`, and it therefore attempted to get `partner_ids[0]`, which resulted to a crash, as the list was empty. opw-672095 Closes #11343 Courtesy of Xavier Morel (xmo@odoo.com)
2016-03-14[FIX] web: dataset alter_ids method must use optionsChristophe Matthieu
x2m send_commands add options for all command to avoid onchange trigger for internal change.
2016-03-14[FIX] web: various small issues in form view onchange/one2manyChristophe Matthieu
- Issue: Edit sale.order form view, add new line, change product who have taxes and click quickly on save (with slow network) => error message. Because some deferreds are lost. - reduce number of reads and onchange for x2m widgets - remove before_save method and use commit_value (the issue was that if the before_save and the change trigger an onchange, the onchange deferred is not checked before saving the content.
2016-02-23[FIX] web: Dialog closingqsm-odoo
The Dialog class destroys the modal (and so removes it from the DOM) when the dialog closes but leaves the modal-open class on the body element if there are still other modal(s) in the DOM. The problem is that (maily on the frontend side) there may be others modal(s) in the DOM (not handled by the Dialog class) but which are not shown to the user, and in that case the modal-open class should be removed.
2016-02-17[FIX] web: prevent focus issue with autoresizeGéry Debongnie
The copied textarea used in autoresize was a valid target for focus when using the tab key. This is a major issue in editable list views, because when the user leaves a textarea, the list view jumps up, with no visible focused field.
2016-02-01[FIX] mail,web: don't block chat windows when blocking uiAaron Bohy
One will still be able to chat in chat windows during long RPCs...
2016-01-18[FIX] web: fix autosize small bugsGéry Debongnie
- better width handling - disable css vertical resize - correctly copy css classes to the 'shadow' textarea
2016-01-14[FIX] web: utils: backport of swap() for enterprise compatibilityAaron Bohy
2016-01-11[FIX] web: reimplement autosize for fun (and some bugfixing)Géry Debongnie
autosize does not work correctly (it moves the screen in all directions sometimes when the user press enter in the bottom of the screen in some browser), So, we decided to have our own version, because of course, we can do it better. A few horrible hacks later, I proudly present you "autoresize" (it was almost named "odooresize" but common sense prevailed). As added benefits, it plays better with our web client, so when you open a dialog in a modal for example, the autosize fields should have the correct height automagically (or should I say 'odoomagically')
2015-12-01[FIX] web, openerp: debug mode now works without refererJeremy Kersten
In some cases the Referer HTTP header may be missing or stripped by a proxy, browser extension or anti-virus. This breaks debug mode because it was solely relying on the Referer header. Introducing an explicit X-Debug-Mode header for RPC calls allows for an alternative method that works even when the Referer is missing. This won't work in all cases, e.g. for direct $.ajax calls, for example. Closes #9824
2015-11-25[MERGE] forward port of branch saas-6 up to dade7e3Christophe Simonis
2015-11-25[FIX] web: local var parent typoNicolas Lempereur
fixes #8516 note: was already solved in enterprise with 7ab5075
2015-11-23[FIX] web: method `BufferedDataSet._update_cache` must purge `changes` from ↵Raphael Collet
useless changes
2015-10-29[FIX] web: can remove record in many2many kanban viewChristophe Matthieu
Wrong underscore method called. Issue: go on customer form view, remove a contacts in the many2many kanban view and save. The record is not unlink.
2015-10-26[FIX] web: proper update of the datasetNicolas Martinelli
The method evict_record calls _update_cache with an empty dictionary, which will not replace any cached value. Therefore, the cache is never cleaned. opw-652393
2015-10-02[FIX] web: backport module web.config for enterprise compatibilityAaron Bohy
Addon mail needs to know if we are using a touch device to set or not the focus on the chat composer. However, this information was not available in the community webclient.
2015-10-01[FIX] web: use _.clone to avoid change of 'default_value'Christophe Matthieu
2015-10-01[FIX] bus: disable longpolling in test modeGéry Debongnie
In test mode, only one cursor is available, and longpolling will take it, and not give it back before 60s, causing a phantomjs timeout. This commit simply return an error when the server is in test mode. Sadly, I had to patch the web client to prevent logging the error in this case, because that's the way phantomjs detect if there is a problem.
2015-10-01[ADD] client-side CSRF supportXavier Morel
* add CSRF token as core.csrf_token * add CSRF tokens to client-generated and/or JS-submitted forms * remove broken "compatibility" mode of web.ajax.post /cc @dmo-odoo I've no idea how that was supposed to work, from looking things up all modern browsers seem to support FormData, and old IEs which don't don't support fallbacks either and would require submitting an actual form as fallback so...
2015-09-24[FIX] web: clone values in read_ids (avoid external changes)Christophe Matthieu
Some widgets like list editable use and change values dictionary. When the write is called, the values in the cache is equal to the changes send => field no dirty => no change triggered.
2015-09-14[IMP] web: improve Widget.proxy's error reportingXavier Morel
Provide a more informative error message than "undefined is not a function" when a method passed by name to the events object is missing on the widget.
2015-09-01[FIX] im_livechat : fix session binding. Required to bind session on server ↵Jérome Maes
url from livechat to male it work outside odoo server. In website_livechat, the web.session js namespace is redifined, and i'm still not sure this is a good idea
2015-09-01[ADD] web: backport of function getPosition()Aaron Bohy
to compute the offset of a DOM element
2015-09-01[IMP] web: dialog: wait for button's onclick handler to closeAaron Bohy
When a button in the modal's footer has an onclick handler and closes the modal, the action of closing the modal should wait for the potential deferred returned by the handler. For instance, if an handler performs an asynchronous call and, when resolved, triggers a notification, the notification doesn't reach the webclient if the modal is already closed because the widgets hierarchy is broken.
2015-08-28[FIX] web: BufferedDataSet must update the cache when reset_ids is calledChristophe Matthieu
2015-08-28[IMP] web: add attribute searchview_hidden to views.Martin Geubelle
This attribute can be used when the view needs a searchview but wants it to be hidden.
2015-08-27[REF] web: data.js: refactoring of BufferedDataSet (less code and speed up)Christophe Matthieu
2015-08-26[ADD] website_form: generic form controllerDavid Monjoie
Contains a new ajax post function that comes from mdo's original code and that I was not able to get rid of.
2015-08-21[IMP] web: use css to display attachment mimetypeChristophe Matthieu
Widgets and website display images or display the type with icon like pdf, doc...
2015-08-21[IMP] web: increase tooltip delay timerGéry Debongnie
from 500 to 1000, as requested by fp
2015-08-19[FIX] web: many2one try to read a creating record but the cache doesn't yet ↵Christophe Matthieu
contain the record
2015-08-17[FIX] web: need to initialize values into the cacheChristophe Matthieu
2015-08-16[FIX] ajax.js: stringify error for debugging helpChristophe Simonis
2015-08-14[FIX] web: make the web client process the new output format of `onchange`Raphael Collet
The dataset implementation has been improved to handle the result of a `read` on ids that are already modified in the dataset: the lists `to_create` and `to_write` are updated properly.
2015-08-07[REF] web(_*): views: view_switcher iconAaron Bohy
Add a key icon in the view's prototype corresponding to the font-awesome icon to display in the view switcher.
2015-07-30[REF] web: move barcode_events to module barcodesArthur Maniet
If the module barcodes is installed, a BarcodeEvents singleton is automatically instanciated. It listens to keypresses and, when a sequence of keys represents a barcode, it broadcasts a 'barcode_scanned' event on core.bus containing the barcode string.
2015-07-29[FIX] web,mail: widgets: replace $el.toggle() by do_toggle()Aaron Bohy
Since rev. 16eb36ff, do_show() and do_hide() on widgets toggle the classname o_hidden on which the rule 'display: none' is defined, instead of calling jQuery's show() and hide(). The method do_toggle(), sharing the same logic, has been introduced in rev. 74c5f772. From now on, every widgets should call do_toggle() instead of $el.toggle() as it will have undesiderable effects (they should call do_show() and do_hide() instead of $el.show() and $el.hide() as well, this as been done in 16eb36ff). This rev. replaces all calls to $el.toggle() by do_toggle(). It also adds an optional argument to do_toggle() to force hidding or showing the widget.
2015-07-29[IMP] web: alert/confirm dialogs default titlesqsm-odoo
Add "Alert" and "Confirmation" as default titles for alert and confirm dialogs
2015-07-27[IMP] Add Dialog.alert featureqsm-odoo
This allows to open a simple message dialog with potential action when the unique "ok" button is clicked
2015-07-23[ADD] web: framework: do_toggle on widgetSimon Lejeune
2015-07-23[IMP] web: New notification systemqsm-odoo
Backport of the Notification system
2015-07-22[MERGE] forward port of branch saas-6 up to 63e92cbChristophe Simonis
2015-07-17[IMP] web: use a classname to show/hide widgetsAaron Bohy
The problem of $el.show()/hide() is that calling show() on a jQuery element on which there is no display rule in the stylesheet automatically sets 'display: block'. However, when a jQuery element is not yet in the DOM, the rules defined on it are not yet applied, meaning that calling show() will set its display to block (in inline style), even if there is different a css rule (e.g. 'dislay: flex'). As the inline style takes the priority over the stylesheet, the correct display won't be applied, even when the widget will be appended in the DOM, resulting in a possibly broken layout.