summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/fields/basic_fields_tests.js
AgeCommit message (Collapse)Author
2019-06-17[MERGE] forward port branch saas-12.3 up to 48a9f5a6335Christophe Simonis
2019-06-14[MERGE] forward port branch saas-12.2 up to 498b4b4350dChristophe Simonis
2019-06-11[MERGE] forward port branch 12.0 up to 7ef4ba03c4fChristophe Simonis
2019-06-06[MERGE] forward port branch saas-12.3 up to 409679866b2Christophe Simonis
2019-06-03[MERGE] forward port branch saas-12.2 up to 995aa1685eeChristophe Simonis
2019-06-07[MERGE] forward port branch saas-11.3 up to a2582c4252aChristophe Simonis
2019-06-07[MERGE] forward port branch 11.0 up to bdc62d80314Christophe Simonis
2019-06-03[FIX] web: binary fields correctly resetsJulien Mougenot
When uploading a file to a binary file, then clicking on the "clear" button, then reuploading the same file... Before this commit: The actual input of the field was only changed on user input. This means that the "clear" action didn't reset the actual value of the input, and the browser's default behaviour when getting the same path twice is not to change anything. In the use case, you couldn't upload the same file until you uploaded another one. After this commit: The "clear" action now also clears the value, allowing reuploading the same file over again. closes odoo/odoo#33843 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.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-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-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-05-27[IMP] web: correct typoSwapnesh Shah
closes odoo/odoo#33070 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-22[FIX] web: pdf file not previewedParth Choksi
The pdf_viewer widget fails to load file and hence shows error. This is due to the wrong controller called(wrong URI passed), while loading a file using pdfjs. For files other than images, /web/content controller should be called since since odoo/odoo#31811. This is similar to the enterprise fix 793c76298a2b301a2 task-1932190 closes odoo/odoo#33354 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-05-13[MERGE] forward port branch saas-12.3 up to 60e71302a38Christophe Simonis
2019-04-30[IMP] web: close dropdowns on scrollJulien Mougenot
Dropdown from many2xxx and datepicker widgets now close on scroll to allow access of background information when scrolling. Related to task #1929483 closes odoo/odoo#32836 Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-11[MERGE] forward port branch saas-12.1 up to 2b3296bbf8bChristophe Simonis
2019-03-08[MERGE] forward port branch 12.0 up to c023d0784f2Christophe Simonis
2019-03-06[FIX] web: hide CopyClipboard widget button when pointlessMartin Geubelle
The widget has been moved in rev. odoo/odoo@15f3bbe but was not very generic. In particular, there was a traceback when clicking on the button if the field had no value (the button was displayed for readonly fields in create mode). The button is now only appended in readonly mode (a `button` inside an `input` or a `textarea` is not very DOM friendly) if the field has a value. Task 1941996 closes odoo/odoo#31635 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-01[REF] reimplement journal dashboard widget with Chart.jsGéry Debongnie
This commit is one part of the task 'removing nvd3'. We use now Chart.js to draw charts. Task ID: 1946138
2019-03-22[FIX] *: pass context in kwargs in rpc callsRaphael Collet
2019-03-25[MERGE] forward port branch saas-12.2 up to 230ad8c381eChristophe Simonis
closes odoo/odoo#32088 Signed-off-by: Christophe Simonis <chs@odoo.com>
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-01-31[MERGE] forward port branch 12.0 up to cb8fefa8999Christophe Simonis
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
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-28[MERGE] forward port branch 11.0 up to bb6f6c57f97Christophe Simonis
2018-11-29[MERGE] forward port branch saas-11.3 up to c0eef427111Christophe Simonis
2018-12-05[IMP] web: state_selection widget readonly if field readonlyPierre Masereel
The current implementation of the state_selection widget always makes it editable even if the field is readonly. We improved this behavior by removing the handle of click on the widget when the field is readonly, but keeping it even if the view is not in edit mode, because it used for example in project to change state even when view is not editable. closes odoo/odoo#29218
2018-11-29[MERGE] forward port branch 12.0 up to 82a1e1dcc33Christophe Simonis
2018-11-23[MERGE] forward port branch 12.0 up to b3052b690faChristophe Simonis
2018-11-19[FIX] web: dateField datepicker don't propagate field optionsLucas Perais (lpe)
In a form view (account.invoice), have a date field as: <field name="date" options="{\'datepicker\': {\'warn_future\': true}}"/> Open a record with the field set to a value Click Edit, click save Click create Before this commit, the value of the field of the new record took the one of the previous record On account invoices, it resulted on having the popup "The record has been modified etc...." And it was not possible to create an invoice from another one this was because we passed the same reference object for the datepicker After this commit, there is no popup as the field do not take a value from the framework OPW 1906085 closes odoo/odoo#28759
2018-11-19[REF] *: update js test suite to use helpersGéry Debongnie
This rev. introduces robust helpers to use in the JS tests suite to interact with DOM and components, and starts using them (almost) everywhere. All the helpers are exposed though testUtils.js. There are 2 kinds of helpers: 1. Assertions ------------- * assert.containsNone, containsN, containsOnce check that the DOM (or a specific part of the DOM) contains a `selector`. It generates a correct error message automatically. ex: assert.strictEqual(form.$('.o_form_editable'), 1, "msg"); -> assert.containsOnce(form, '.o_form_editable'); * assert.isVisible, isNotVisible check that the DOM has an element visible or not. They also check that the element is actually in the DOM (before most tests didn't verify this). * assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific properties of a DOM element, and also validate that it is applied on a single existing DOM element (before most tests didn't verify this). ex: assert.notOk(form.$('button').hasClass('btn-primary')); -> assert.doesNotHaveClass(form.$('button'), 'btn-primary'); 2. Utilities ------------ The goal of the utilities is to centralize the definition of many standard components and interactions, ensuring that when we refactor the JS framework, we do not need to change all the tests. Existing mock utilities (addMockEnvironment, intercept, path, patchDate, unpatch and fieldsViewGet) are moved to 'testUtils.mock.*'. Existing DOM utilities are moved to 'testUtils.dom.*'. New dom utilities are created for opendDatePicker, click, clickFirst and clickLast. Helper `click` verifies that there is exactly 1 element visible in the DOM you click on, `clickFirst` and `clickLast` verify that there are more than one element on the DOM. ex: form.$('button').click(); -> testUtils.dom.click(form.$('button')); New Form utilities: (testUtils.form.*) clickEdit, clickSave, clickCreate, clickDiscard, all clicks on the control panel buttons of the form. `reload` reloads the form data. New modal, graph, kanban and pivot utils (testUtils.pivot.*, testUtils.kanban.*, etc.). New fields utils: (testUtils.fields.*) * editInput, editSelect: allow to change the value of a field, using a selector to identify it. They validate that the input exists and trigger the change event automatically. * editAndTrigger: allow to modify a field and trigger specific events after the value change * many2one (testUtils.fields.many2one.*) clickOpenDropdown, clickHighlightedItem, clickItem, searchAndClickItem: use a field name instead of a selector and do all the complex mechanism to open, filter and highlight many2one fields. Joint work with aab, dam, ged, mge, svs and vsc.
2018-11-14[FIX] web: restore/remove skipped testsGéry Debongnie
Some tests were skipped these last months. This is a slippery slope. The best time to reactivate them is the moment they were skipped, the next best time to reactivate them is now. So, this is what this commit does. Three kinds of tests were skipped: - 3 password tests - 2 kanban progress bar tests - one keyboard navigation test Password tests -------------- When the auth_password_policy addon was introduced, two tests in web/ were skipped, because they would fail when the auth_password_policy addon is installed. Since then, a commit was done to change the way the password field works (commit 5bbbd25edf129912ed7cdccd1005ab61bfaf2124). With this commit, the password field is no longer an 'include', but a new field widget. This means that the skipped tests no longer fails. Kanban progress bar tests: -------------------------- In saas 11.2, the 'archive all' feature was removed, but it was readded in saas 11.4. The tests had to be slightly adapted to make sure they use the proper css selectors. Keyboard navigation test: ------------------------- It is now a functional decision not to allow moving from one cell to the next by using left/right arrow, so this test is no longer valid. closes odoo/odoo#28685
2019-01-08[IMP] web: use `showSearchInput` in model field selectorMartin Geubelle
The option `showSearchInput`, which is used on the model field selector to display a search input that filters the displayed fields, is not set by default. This includes the model field selector instantiated in the `domain` field widget. closes odoo/odoo#29986
2018-11-27[FIX] web: progressbar updates on field resetLucas Perais (lpe)
Have a form record with a progress bar Modify the max_value of the progress, as well as the current_value bar through an onchange Before this commit, the new max_value was not taken into account After this commit, it is. closes odoo/odoo#29056
2018-10-25[MERGE] forward port branch 11.0 up to 84500c27b1cChristophe Simonis
2018-10-22[FIX] web: trim tooltip text before comparisonChristophe Simonis
The error is triggered at least on Chrome 69 on macOS.
2018-10-17[FIX] web: JournalDashboardGraph widgets appear at kanban views updatesMathieu Duckerts-Antoine
closes odoo/odoo#27892
2018-11-02[MERGE] forward port branch saas-11.4 up to f6ca72b3ce9Christophe Simonis
2018-10-29[MERGE] forward port branch saas-11.3 up to 6136f0c02e5Christophe Simonis
2018-10-22[MERGE] forward port branch saas-11.4 up to 3c108977c1eChristophe Simonis
2018-10-17[MERGE] forward port branch saas-11.3 up to 0de06a41326Christophe Simonis
2018-10-11[MERGE] forward port branch 11.0 up to 717f4583949Christophe Simonis
2018-10-10[FIX] web,mrp: move test to adequate moduleChristophe Simonis
2018-10-11[FIX] web: restore broken datepicker input behaviorMartin Geubelle
In Firefox, the input behavior and visual representation (navigation, caret placement, value selection, etc.) was broken when using a datepicker (easily reproductible on date and datetime widgets). This was due to the `focus` event being stopped on the input, which doesn't seem to be correctly supported by Firefox. The deleted code was supposed to toggle the picker when the field was clicked (see odoo/odoo@89093a1) (toggle on click and disable focus) but the lib correctly supports on focus without extra code. This also fixes the fact that the datepicker was not open on focus (only on clicked). In some tests where the field was the first in the form view, it is now correctly autofocused. Forward-port: not useful from 12.0 because the code has changed with BS4 and this has already been applied in odoo/odoo@6692919 and odoo/odoo@c63630d. Closes #23438 closes odoo/odoo#27657
2018-10-10[MERGE] forward port branch 11.0 up to a69f117bbf5Christophe Simonis
2018-10-09[FIX] web: fetch dependency fields in x2manyLucas Perais (lpe)
Image field widget need the __last_update field alongside them for caching purposes, though that field should never be present explicitly in the views Before this commit, the dependencies of field widgets were not merged into the model's fields definition, creating a traceback when adding an image field widget into a x2many list After this commit, there is no traceback and the image field works properly closes #27545