summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/widgets
AgeCommit message (Collapse)Author
2019-09-04[MERGE] forward port branch 12.0 up to 638eac9baeaChristophe Simonis
2019-08-30[MERGE] forward port branch 12.0 up to 52f6e38cea8Christophe Simonis
2019-08-29[MERGE] forward port branch saas-11.3 up to ede253f1b2eChristophe Simonis
2019-08-29[MERGE] forward port branch 11.0 up to d61873ac4a3Christophe Simonis
2019-09-03[FIX] web: datepicker: crash on invalid dateHarpritsinh Sisodiya
There is an open issue on the tempusdominus lib: https://github.com/tempusdominus/bootstrap-4/issues/223 It occurs when there is a valid value in a date(time) field, and the user unsets it by setting an invalid one. This rev. fixes the issue in Odoo by preventing to reach the buggy piece of code in the lib. In a few words, when the user sets an invalid date, we reset the previous valid date (which is what the lib tries to do anyway). Task 2057009 closes odoo/odoo#36211 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Aaron Bohy <aab@odoo.com>
2019-08-27[FIX] web: searchbar: focus first itemJulien Mougenot
Doesn't focus hovered option in the searchbar Before this commit: When typing in the searchbar while having the cursor right under it, the selected option was automatically the one hovered by the cursor. Now, the default option is the first one (typically name search) and the cursor hovering only takes effect when moved for the first time. Task 2058656 closes odoo/odoo#36099 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-08-09[FIX] web: add support for TRUE_LEAF and FALSE_LEAF in ModelFieldSelectorJinal Patel
before this commit, domain selector widget does not support TRUE_LEAF and FALSE_LEAF i.e. [(1, '=', 1)] and [(0, '=', 1)] respectively, the reason is the chain part of the domain i.e. field name has value 1/0 and we don't have field name like 1 and 0 in domain and hence ModelFieldSelector don't accept it after this commit, domain selector can handle this special two domains which is [(1, '=', 1)] and [(0, '=', 1)], add support for chain with 1/0 in ModelFieldSelector task- 1998145 closes odoo/odoo#35603 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-06-21[MERGE] forward port branch saas-12.2 up to 8747d72f1efChristophe Simonis
2019-06-21[MERGE] forward port branch 12.0 up to 0e72b983c35Christophe Simonis
2019-06-19[FIX] web: pie chart structure not modified by favoritesMathieu Duckerts-Antoine
A pie chart widget aims to instantiate a graph view in mode 'pie', with a measure and a single groupby specified via some attributes. It turns out that if a pie chart is instantiated in a context in which the keys 'graph_mode', 'graph_measure', and 'graph_groupbys' are present, that keys prevail over the pie chart specification. This can produce a line chart for instance. This fix corrects that situation. A test has been added in a corresponding commit in enterprise (historically, the pie chart widgets are tested in dashboard views). closes odoo/odoo#34234 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-03[MERGE] forward port branch saas-12.2 up to 995aa1685eeChristophe Simonis
2019-05-20[FIX] web: date_picker: avoid duplicate function declarationAdrien Dieudonne
Due to forward port, _onKeydown was declared twice. This commit should fix an issue in mobile with Android 4.4 where it's not allowed to have two functions with the same name. Original Commit: a3d98dae68b97 closes odoo/odoo#33495 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-05-06[MERGE] forward port branch saas-12.2 up to 78b3b650b0dChristophe Simonis
2019-04-18[FIX] web: remove traceback when attaching a documentRomainLibert
The closure overrides the arguments, which makes it impossible to recover the attachment_ids hence sending null python code which then breaks. closes odoo/odoo#32810 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-04-12[FIX] web: do not open datepicker on focusAaron Bohy
Before this rev., the datepicker was opened when a date(time) field was focused (e.g. with keyboard navigation). We don't want this behavior anymore, and we want the datepicker to open only when the user clicks in the input. This rev. makes this change. Moreover, this allowed to refined the keyboard navigation (ESC) in editable list views: when a datepicker is opened, and the user presses ESC, we close the datepicker, but we keep the row in edition, whereas before this rev., the row was switched to readonly. closes odoo/odoo#32408 Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-04-12[FIX] web: crash in editable lists with date fieldAaron Bohy
Assume an editable list view with a date(time) widget, click to edit a line, focus the date field (the datepicker opens), press ESC: there is a crash in the lib, and the datepicker remains open forever. This fix is twofold: - we added a check in the lib to prevent it from crashing (it is easily reproducible: it crashes when an opened datepicker is removed from the DOM). - we added an event handler of ESC keydown event to hide the datepicker before the field is removed from the DOM.
2019-05-17[MERGE] forward port branch saas-12.1 up to d785adba6c0Christophe Simonis
2019-05-17[MERGE] forward port branch 12.0 up to c545783b95bChristophe Simonis
2019-04-26[MERGE] forward port branch 12.0 up to c9913152ecbDenis Ledoux
2019-05-16[FIX] web: Invalid Date warningGoffin Simon
Fine tuning of 5ef86ef6c874ab4dc78402493d05b2460c69e7f6 Steps to reproduce: Set a custom language settings for date by switching the %m and %d. Create a sales order Current behavior: Invalid date error boxes was raised two times fixes #33408 opw:1998971 closes odoo/odoo#33415 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-05-15[FIX] web: Error on invalid date format on date field inputGoffin Simon
Steps to reproduce the bug: - Go to any field Date - Enter wrong date Bug: A traceback was raised. Now a warning is raised and the wrong value is removed. opw:1974747 closes odoo/odoo#33362 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-23[FIX] web: crash in editable lists with date fieldAaron Bohy
Backport of 7bc53ac30e. Assume an editable list view with a date(time) widget, click to edit a line, focus the date field (the datepicker opens), press ESC: there is a crash in the lib, and the datepicker remains open forever. This fix is twofold: - we added a check in the lib to prevent it from crashing (it is easily reproducible: it crashes when an opened datepicker is removed from the DOM). - we added an event handler of ESC keydown event to hide the datepicker before the field is removed from the DOM. closes odoo/odoo#32647 Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-05-02[MERGE] forward port branch saas-12.1 up to b11930047f6Denis Ledoux
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-02-27[FIX] web: correctly handle (no result) selection in searchMartin Geubelle
In the recent control panel refactoring, selecting '(no result)' (when using the autocomplete on a many2one for example) was no correctly handled and was leading to a traceback. It is now correctly handled and the search bar is correctly re-rendered. Task 1936745 closes odoo/odoo#31438
2019-03-13[MERGE] forward port branch saas-12.2 up to c9f832d9f03Christophe Simonis
closes odoo/odoo#31790 Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-06[REF] web: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-02-18[FIX] *: various docstring formatting issuesXavier Morel
Would yield block quotes instead of code blocks or lists or whatnot.
2019-02-14[IMP] web Add widget signature on binary fieldjbm-odoo
Add a new widget for binary fields. It open a dialog box and the user can sign manually, or an signature can be draw automatically or he can upload a picture of his signature. Move fonts, controller, scss,templates about signature from portal to web to avoid redundance closes odoo/odoo#30222
2019-02-11[MERGE] forward port branch saas-12.1 up to 93d736e905eChristophe Simonis
2019-02-25[IMP] web: graph view legend and tooltips improvementsJuhil Somaiya
This commit ameliorates the tooltips and the legend of the graph view in its different modes (bar, line, and pie). Related task id: 1917940 Co-authored-by: Mohammed Shekha <msh@openerp.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> closes odoo/odoo#29747
2019-02-20[REF] web: small refactoring for export wizardKishan Gajjar
- add missing docstrings - correctly order functions - move functions in correct sections - follow JS guidelines closes #31261
2019-02-04[FIX] web: allow user to move cursor in search barGéry Debongnie
With the control panel refactoring, the auto_complete widget was set on a different target, which caused issues with the search bar: the event handlers for the search bar were triggered before the handlers for the auto_complete widget. With this commit, we make sure they are handled in the proper order. Also, a small piece of code that was supposed to check the position of the cursor was lost. closes odoo/odoo#30795
2019-02-06[IMP] web: Set a timeout on rainbow man destructionAaron Bohy
Avoid traceback when the click that triggered the rainbow man is the click that closes it. Example: The last step of a tour. closes odoo/odoo#29969
2019-01-31[MERGE] forward port branch 12.0 up to cb8fefa8999Christophe Simonis
2019-01-31[FIX] web: do not select disabled elementMartin Trigaux
If xlwt is not installed on the server, the option is disabled. However, the first element was checked, even if it is disabled. Trying to export record without xlwt was causing a traceback. Introduced at b60de0db41b where xls is now the first choice closes odoo/odoo#30724
2019-01-30[FIX] web: reload view when pressing enter in search barGéry Debongnie
Before the control panel refactoring, whenever a user pressed ENTER in the search bar (with no text), the current view was reloaded. This untested behaviour was changed (not on purpose) with that refactoring: instead of reloading, the search view add a useless filter in the list of facets. We restore the previous behaviour in this commit. closes odoo/odoo#30503
2019-02-04[MERGE] forward port branch saas-12.1 up to 4524ad06a8aChristophe Simonis
2019-01-30[FIX] web: datepicker fallbacks to default english localeJulien (juc) Castiaux
When using the datepicker with norwegian locales, the dates are correctly formatted using the norwegian locale but the name of the months are shown in english. This cause a date validation error and thus it is not possible to change the date. tempusdominus.js uses moment.js to deal with dates, it sometimes copies/creates some and set their option according to the ones given at instantiation time and fallbacks on default options for that are not set. opw-1922437 closes odoo/odoo#30276
2019-01-17[MERGE] forward port branch 11.0 up to 19558129f0eChristophe Simonis
2019-01-16[FIX] web: can reopen ModelField selector widgetChristophe Matthieu
Before this fix, in studio when the user select the field then focus out then focus in and selected a child field, an exception is triggered because the last page is visible but the data are removed. backport of 12.0's 9eef25ae0a opw-1928453 closes #30277
2019-01-03[FIX] web: attach document fix click on firefoxNicolas Lempereur
As of saas-11.3 there is a "Attach document" widget that is meant to more easily add attachment. But on firefox the click event is coming from the button, where on other browsers it was possibly from a child element. So the code expecting the child element did not work on firefox. opw-1920842 closes #29903
2019-01-09[FIX] web: make pie chart title translatableNicolas Martinelli
The Pie Chart title is not translatable, since a string defined in a `t-att-` cannot be translated. We use the attribute `title` instead. Tests are adapted in https://github.com/odoo/enterprise/pull/3379 opw-1908220 closes odoo/odoo#29991
2019-01-04[MERGE] forward port branch saas-11.3 up to 27a084eb814Christophe Simonis
2018-12-22[FIX] web: Add missing aria attributes in menusLuis González
Some aria attributes were missing on menus, and are required to ensure a good compatibility with keyboard users and screen readers. To solve the above, the following attributes are included: - `aria-expanded`: this should be present in all dropdown menus. This is set on elements with class `dropdown-toggle` and `o_closed_menu`. - `role`: used to improve given information about what elements are for. It is added in the following cases: 1. Non-button elements that have the class `dropdown-menu` are set to `role="button"`. 2. Menu items that have the class `dropdown-item` are set to `role="menuitem"`. 3. Menu separators that have the class `dropdown-divider` are set to `role="separator"`. This is a continuation of baa1c515c592 closes odoo/odoo#29719
2019-01-14[MERGE] forward port branch 12.0 up to 6a0675d36ddChristophe Simonis
2019-01-09[MERGE] forward port branch 12.0 up to 3e4138deaa2Christophe Simonis
closes odoo/odoo#30045
2018-12-07[REF] web: move ControlPanel inside controllers/actionsGéry Debongnie
This branch introduces a large-scale reorganization of the component tree generated by the web client. The short version is that now, the control panel is a child of the view controller and no longer a sibling. Graphically (and simplified), we go from this: webClient / | \ ... ... actionManager / \ controlPanel viewController / \ to this: webClient / | \ ... ... actionManager | viewController / | \ ControlPanelController / \ CPRenderer CPModel The motivation is that this work moves the code where it should be. Before this commit, it was kind of weird to have code in the controllers to render buttons outside of their root node (in renderButtons). Also, the action manager had to take care of coordinating search view states between view transitions. So, this work simplifies the code. It also makes it easier to extend. We see day after day that Odoo needs to take care of more complex UI needs, and in many cases, these needs were quite difficult to implement (we prefer spaghettis in our plates, not in our code). The changes in this branch should open the way to implement these features. For example, - it will now be easy to add the possibility of views (for example, the search view or a new ControlPanel view) to add custom buttons (of type action or object) in the control panel. - Another need will be to serialize/ restore the state of the search view across action boundaries (needed by the dashboard). - Another example is the possibility for views to customize easily the presence/absence of sub menus (filters/groupbys/favorites/ time range/...) - Another need is an easier way for views/client action to customize their control panel. This commit also contains a large rewrite of the search view (so it is more inline with our architecture and easier to maintain). Part of task 1893568 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com>
2018-11-29[MERGE] forward port branch 12.0 up to 82a1e1dcc33Christophe Simonis
2019-01-28[MERGE] forward port branch saas-12.1 up to d3b8422c9c4Christophe Simonis
closes odoo/odoo#30614