summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/form
AgeCommit message (Collapse)Author
2019-04-02[IMP] web,board: enable pagination in grouped listsAaron Bohy
With this rev., when there are a lot of groups in a grouped list view, groups are displayed under several pages, whereas they were all displayed in the same page before. This is especially interesting with the new 'expand' attribute, to ensure that we don't read records for a large number of groups. By default, the groups limit is set to 80 (like records), and to 10 is the 'expand' attribute is set to true. This limit can be overriden with the 'groups_limit' attribute. Part of task 1915702
2019-04-02[IMP] web: list: editable grouped list viewsRavi Gadhia
This rev. enables the editable feature in grouped list views. Part of task 1915702 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com>
2019-04-01[FIX] web: on_attach_callback of form renderer widgetsMathieu Duckerts-Antoine
Before this commit, the 'on_attach_callback' method of a subwidget of the form renderer would not be called when the renderer renders itself but is already in the dom. This can cause problems when a subwidget has to know if it is in the dom for its own rendering. This commit fixes that situation.
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-21[MERGE] forward port branch saas-12.1 up to 6878c9f3424Christophe Simonis
2019-03-19[MERGE] forward port branch 12.0 up to 82c4393fd02Christophe Simonis
2019-03-18[MERGE] forward port branch saas-11.3 up to 4e39328a76aChristophe Simonis
2019-03-18[MERGE] forward port branch 11.0 up to 7e33b547714Christophe Simonis
2019-03-14[MERGE] forward port branch 12.0 up to a26496b6e79Christophe Simonis
2019-03-14[MERGE] forward port branch saas-11.3 up to f5ab04ce509Christophe Simonis
2019-03-14[MERGE] forward port branch saas-12.1 up to ff1bca32f3aChristophe Simonis
2019-03-13[MERGE] forward port branch 11.0 up to c23d1186e7bChristophe Simonis
2019-03-08[IMP] web: allow to override the number of buttonbox buttonsFlorent de Labarre
See odoo/odoo#31546 closes odoo/odoo#31698 Signed-off-by: Géry Debongnie (ged) <ged@openerp.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-03-12[FIX] web: reload form after failing saveSuraj Shukla
Let's assume a form view with a clickable statusbar, in readonly. When the user clicks on a status, the change is saved directly. When the save fails (e.g. access rights), the statusbar widget is in an inconsistent state and must be reloaded. This rev. reloads the whole record and re-render the form when this happens. Related to Issue: #1915391 closes #29519 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com> Co-authored-by: Mohammed Shekha <msh@openerp.com>
2019-02-08[IMP] web: Remove CTA should be hidden on creationRomain Estievenart
- Hide the "Remove" button on the create modal's footer. - Update title when click on "Save & new" button Task ID: 1924887 closes odoo/odoo#30209
2019-01-31[MERGE] forward port branch 12.0 up to cb8fefa8999Christophe Simonis
2019-01-30[FIX] web: form's tabs should be scrollable on mobilePierre Paridans
On mobile, swiping right/left switches to next/previous record. This feature prevents the horizontal scroll of the form notebook's tabs by overtaking the swipe gesture on those elements. This issue had different consequences depending on the platform: - on iOS: the tabs cannot be scrolled at all. - on Android: the tabs can only be scrolled by using a two-fingers gesture This commit restore the horizontal scroll on the tabs but also keep the swipe-gesture to navigate records. opw-1929267 closes odoo/odoo#30658
2019-02-04[MERGE] forward port branch saas-12.1 up to 4524ad06a8aChristophe Simonis
2019-01-24[FIX] web: translation issue fixedTejas Shahu
Before this commit: Editing a translatable field -> clicking on a translation warning -> come back through breadcrumb do not preserve translation warning. After this commit: Editing a translatable field -> clicking on a translation warning -> come back through breadcrumb preserves translation warning. Technical note: alertFields is now an object and an attribute of the form renderer that stores translation alerts per record. The translation alerts created for a given record are maintained unless they are closed manually or the renderer is destroyed. Issue-ID: 1877480 Co-authored-by: Mohammed Shekha <msh@openerp.com> closes odoo/odoo#29377
2019-01-25[MERGE] forward port branch saas-11.3 up to 387d5cff90bChristophe Simonis
closes odoo/odoo#30566
2019-01-09[MERGE] forward port branch 12.0 up to 3e4138deaa2Christophe Simonis
closes odoo/odoo#30045
2018-12-11[FIX] web: display action menu in form/list viewGéry Debongnie
The recent refactoring of the control panel moved the sidebar management from the action manager to the view itself. However, the sidebar parameter was forgotten, which resulted in the fact that it was no longer created. This fix was a little tricky, because the sidebar needs to be instantiated in some tests, but not in most of them (in particular, the document application changes its behaviour, which is annoying). closes odoo/odoo#29389
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-12-03[FIX] web: Load form subviews without previous '*_view_ref' in contextlul-odoo
On a form view of model A, if a many2one field (model B) has a [tree|form]_view_ref in the context (to display a custom 'Search More...' tree view dialog for example), when clicking on this field to display the model B form view, the context key *_view_ref is passed when loading subviews (model C) making them crash because the view ref corresponds to the model B. After this commit, '*_view_ref' keys in the context are dropped when loading subviews closes odoo/odoo#29022
2018-11-20[IMP] web: propagate "on_attach_callback" to all widgets in form renderergde-odoo
Co-authored-by: twa-odoo <twa@odoo.com> closes odoo/odoo#27711
2018-11-16[MERGE] forward port branch 12.0 up to bc744a1da46Christophe Simonis
2018-11-14[FIX] web: restore formview mode when coming back (breadcrumbs)Géry Debongnie
Before this commit, when the user is in a form view (edit mode) and click on a stat button, a new action is added to the action stack. When the user then comes back to the form view by clicking on the breadcrumb, it is supposed to be in readonly mode. Before this commit, this was not the case. This bug comes from the action manager refactoring, which removed the view manager. With this commit, we add a new action lifecycle method which is called when the action is restored. Note that this commit implicitely changes the semantic of actions with 'target=inline'. As far as I can tell, this only applies to the settings form view, which can easily be fixed by overriding the restore hook. closes odoo/odoo#28663
2019-01-25[IMP] web: Deactivate swipe between form view in mobilePierre Paridans
The swipe between the form view is taking too long to load, and the pager is a more clean option to switch between form view. Moreover, the swipe on tabs is not clear anymore. - Deactivate swipe between form view - Swipe should only be available on tabs when tabs are too long to fit in one screen. Was originally introduced by https://github.com/odoo/odoo/commit/f4ee61f950dc1eeb7b3653ca96ea72721512b5e5 Related task: 1924764 closes odoo/odoo#30413
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-23[REF] web: small refactoring pass on some web componentsAaron Bohy
(mainly views and ActionManager) - add missing docstrings - fix typos - correctly order functions and imports - put functions in correct sections - stop using 'event' as argument of handlers - don't call handlers directly - remove trailing spaces/tabs - move module created in stable version to its own file - follow js guidelines in general closes odoo/odoo#28024
2018-10-11[FIX] web: close m2o (in o2m) dialog with ESCAPEAaron Bohy
Let's assume a one2many editable list containing a many2one field (e.g. in a sales order, the product_id m2o in order_line o2m), and the scenario where the user clicks on 'Create and Edit' in the o2m, and then presses ESCAPE in the opened dialog. Before this rev., it crashed because the 'navigation_move' (cancel) event wasn't stop propagated by the form renderer (the one of the dialog), and thus bubbled up to the list editable renderer, which asked its basic model to discard a record it didn't know. Note: same fix as in 8445baa (done in saas-11.3), but with a simpler test. Task 1878254
2018-10-09[FIX]web: do not crash when dismissing a modal with escapeMohammed Shekha
stopPropagation of navigation_move event for where direction=cancel, currently if navigation_move event throws error when user press escape in dialog where dialog is opened from editable list record Scenario: Install website_sale -> Open Product form(variant enable) -> open variant tab -> open Attribute m2o form popup and press Escape on dialog Result: Error Expected: It should close dialog and keep editable list view record open, btw m2o field should also be focused when dialog is closed but that's another issue, will be fixed in another ongoing task Related to Issue: #1873919 Co-authored-by: Vincent Schippefilt <vsc@odoo.com> Co-authored-by: Mohammed Shekha <msh@odoo.com>
2018-09-25[FIX] web: improve automatic creation of new lines in x2many in formsVincent Schippefilt
This commit fixes a few issues with the previous implementation of the automatic addition of new lines in x2many inside forms 1. Before this commit, when there is a change of mode in a formview `edit` -> `readonly` -> `edit`, there may be some cases that mistakenly and automatically opens a modal. This case occurs in a form view with a x2many field whose 1st inner focusable element opens a modal (e.g. "Add an item"). In `edit` mode: 1. Open this modal from the x2many 2. Close the modal 3. Change mode to `readonly` 4. Change mode to `edit` > the same modal is automatically open. This is due to the tracking of the last activated field that persists after a change of mode. Since the last activated field in the 1st `edit` is the x2many, it is granted the focus at the beginning of the 2nd `edit`, which automatically opens the modal. This commit fixes the issue by resetting the tracking of the last activated field when there is a change of mode. As a result, at the beginning of the 2nd `edit`, the focus should always be on the 1st field. 2. Before this commit, if the focus was moved out of the form (to a modal for instance) then back, the form would re-activate the last field, which is the x2many and would re-add a new line. This behavior is not correct and now going back from a modal to a form does not add a new line. Co-authored-by: Alexandre Kühn <aku@odoo.com>
2018-08-20[IMP] web: mobile: add swipe support in form viewsVandan Shah
This rev. allows to navigate, in mobile, through records in form views by swiping. We also moved mobile-specific tests involving a form view to the mobile test suite, since those tests became async because of the lazy loading of the swipe lib (in the mobile suite, that lib is already loaded). Related to task #34727 Co-authored-by: Mohammed Shekha <msh@openerp.com>
2018-08-17[IMP] web,various: Add 'Remove' button to view dialogs opened from x2m fieldsDharmraj Jhala
Currently, to remove link of x2m field from any record, sometimes there's no way. For example, if we are on mobile and open any Quotation, it's linked quotation lines are automatically converted in kanban, and there is no way to delete a line from that quotation. However, in some of the manually designed kanban, there is special 'x' for removing / unlinking x2m record, for example, Contacts of Partner. This commit makes the behavior more consistent. During edition (mobile and desktop), if a view dialog is opened on click of x2m field, it will have one 'Remove' button (based on user rights) on right side of dialog footer, allowing users to delete / unlink the record. Moreover, in mobile, the modal is opened fullscreen, with sticky header and footer. Related Task# : 31641 Closes PR #15857 Co-authored-by: Mohammed Shekha <msh@openerp.com>
2018-08-08[IMP] web: Added help option in stat buttons.Deep Patel
2018-07-30[FIX] web: BS4, form sheet should clear floating elementsqsm-odoo
Before most were cleared by .tab-content elements, which is not the case anymore with BS4.
2018-07-27[REF] web, *: BS4, use custom BS4 checkbox everywhereqsm-odoo
Before this commit, Odoo used checkboxes in three different ways: - A simple <input type="checkbox"/>, mainly in the frontend. The style is browser dependant. - Same as above but with the BS3, checkbox structure. The style is still the same, but the alignement is supposed to be better (which is not always the case). - The Odoo official structure: ``` <div class="o_checkbox"> <input type="checkbox"/> <span/> </div> ``` which allows to have a cross-browser checkbox style and correct alignements. The goal after this commit is to only use the BS4 *custom* checkbox structure to achieve the same goal as our official structure (and remove that one): ``` <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" id="customCheck1"> <label class="custom-control-label" for="customCheck1">...</label> </div> ``` /!\ Labels are now required (use a zero-width space if necessary)
2018-07-27[REF] *: BS4, review the 'nav' and 'navbar' componentsqsm-odoo
Now the nav structure is more declarative: the 'nav-item' and 'nav-link' classes have to be put on related nav item and links. Also, the 'active' class has to be put on links instead of items. Same as for the navbar component: - The navbar structure was simplified and meant to be more declarative. - The navbar colors are also now handled by a different set of classes. The 'nav-stacked' class was removed and replaced by flex utilities. The set of classes for colors and nav styles also changed.
2018-07-27[REF] *: BS4, adapt dropdowns and caretsqsm-odoo
- The dropdown structure was simplified, allowing to get rid of the 3-levels structure induced by <ul/> elements and dropdowns can now contain anything. The class 'dropdown-item' is now mandatory for each dropdown clickable element. The class 'dropdown-item-text' can be used to add same padding and style but without making the element have a clickable look. - Dividers now use the class 'dropdown-divider' - The way dropdowns are opened and hidden also changed (before the 'open' class was added on the `.dropdown-menu` parent, now the 'show' class is added on both the `.dropdown-menu` parent and the `.dropdown-menu` itself). - JS-wise, no click event handlers can be put on `.dropdown-toggle` elements anymore (instead, use handlers for dropdown events). - Carets are automatically put on `.dropdown-toggle` elements, so this commit replaces the `.caret` elements with this. This feature was possible to disable but would prevent us from adding a caret with scss. Also, this simplifies the DOM. The 'o-no-caret' class was also introduced to allow using the 'dropdown-toggle' class on non-caret elements. - Also adapt the scss to use $caret-width instead of $caret-width-base
2018-07-27[REF] *: BS4, rename btn-default to btn-secondaryqsm-odoo
BS4 "btn-default" class was replaced with "btn-secondary", which makes more sense.
2018-07-27[REF] web, *: BS4, update JS media queriesqsm-odoo
* website_quote, website_sale
2018-07-27[REF] web, *: BS4, adapt use of tooltip/popover.jsqsm-odoo
2018-06-28[MERGE] forward port branch saas-11.3 up to 3cdcbce93cbChristophe Simonis
2018-06-27[MERGE] forward port branch saas-11.2 up to 12ddec3a767Christophe Simonis
2018-06-25[FIX] web: disable Save buttonNicolas Martinelli
When hitting the 'Save' button, buttons should be properly disabled until the record is reloaded. opw-1859027
2018-06-21[FIX] web: onchange in non inline one2many listAaron Bohy
Let's assume a one2many list with two fields A and B, and an onchange on A that sets B. Before this rev., on new records, the onchange was only triggered if the one2many list was defined inline. Rev. 13c885195 was an attempt to fix the onchange issue in x2manys with non inline views, but it only worked on existing records. This rev. fixes the problem for both cases (existing and new records), and thus reverts the fix of 13c885195. The idea of this fix is to make both cases behave similarly, w.r.t. fields and viewFields stuff in the fieldsView. In the inline case (like in the main view case), fields and viewFields are the same. In the non inline case, viewFields contained more information than fields. As fields is used everywhere in BasicModel (and viewFields is basically ignored), the fix is to set fields to viewFields.
2018-06-21[FIX] web: onchange in non inline one2many listAaron Bohy
Let's assume a one2many list with two fields A and B, and an onchange on A that sets B. Before this rev., on new records, the onchange was only triggered if the one2many list was defined inline. Rev. 13c885195 was an attempt to fix the onchange issue in x2manys with non inline views, but it only worked on existing records. This rev. fixes the problem for both cases (existing and new records), and thus reverts the fix of 13c885195. The idea of this fix is to make both cases behave similarly, w.r.t. fields and viewFields stuff in the fieldsView. In the inline case (like in the main view case), fields and viewFields are the same. In the non inline case, viewFields contained more information than fields. As fields is used everywhere in BasicModel (and viewFields is basically ignored), the fix is to set fields to viewFields.