summaryrefslogtreecommitdiff
path: root/addons/web/views/webclient_templates.xml
AgeCommit message (Collapse)Author
2019-04-12[MOV/IMP] web, mail: update attachment widget and moved the common scss code ↵jpr-odoo
from mail to web with this commit, we have updated the attachment widget view same as like chatter attachment view moved the common scss code from mail to web for many2many_binary widget, which is used for attachment and update test case according to the widget Task ID: 1930087
2019-04-05[FIX] web: corrected the order of icons in systrayVincent Schippefilt
Since the merge of JQuery 3, the building of systray icons is non deterministic. After this fix, the menus are loaded correctly in order. Task-ID: 1960741 closes odoo/odoo#32382 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-04-02[IMP] web,base: put buttons in list group headersMartin Geubelle
It is now possible to put buttons in the list view group headers. When the view is grouped by a many2one field, those buttons appear next to the header title when the group is opened. The buttons are specified in the views in a <groupby> tag in the list arch, with the following structure: <groupby name="groupedField"> <!-- must be a many2one --> <button type="object" name="my_method" string="Button1"/> </groupby> It is also possible to add `field`, inside the `groupby` which can be used for modifiers. These fields thus belong on the many2one comodel, like: <groupby name="partner_id"> <field name="name"/> <!-- name of partner_id --> <button type="object" name="my_method" string="Button1" attrs="{'invisible': [('name', '=', 'Georges')]}"/> </groupby> These extra fields are fetched in batch when grouping on the field. Part of task 1915702
2019-04-01[IMP] web: remove nvd3 libraryMathieu Duckerts-Antoine
It has been decided to use Chart.js instead of nvd3 to render charts. Now that nvd3 is no more in use, we remove it. Task ID: 1946138
2019-04-01[IMP] web: use Chart.js in graph viewMathieu Duckerts-Antoine
It has been decided to use Chart.js instead of nvd3 to render charts. In this commit the graph view has been largely rewritten to benefit from the options offered by Chart.js. Task ID: 1946138
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-14[MERGE] forward port branch saas-12.1 up to ff1bca32f3aChristophe Simonis
2019-03-14[MERGE] forward port branch 12.0 up to a26496b6e79Christophe Simonis
2019-03-12[FIX] web: do not use t-if inside assetsMartin Trigaux
This makes the assets to be recomputed everytime somebody with a different language load the page. closes odoo/odoo#31782 Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-03-06[IMP] web: don't swallow errors in async handlersAaron Bohy
This commit adds a 'guardedCatch' function to the Promise API. This function has to be used when we don't want to swallow real errors (crashes), like 'catch' does (i.e. basically all the time in Odoo). When the promise has been rejected because of a real error, the rejected Promises chain bubbles up to the top and triggers the 'unhandledrejection' event (triggered on all browsers thanks to the unhandled-rejection-polyfill lib). We then add a listener on that event to display real errors with the CrashManager. 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-06[ADD] web: unhandled-rejection-polyfill libAaron Bohy
2019-03-06[REF] web: update qunit to v2.9.1David Monjoie
The new version of qunit better reports failures of promises then the previous version.
2019-03-06[ADD] web: es6-promise polyfill libAaron Bohy
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-13[IMP] web: add kanban searchPanelAaron Bohy
This rev. defines a searchPanel widget used in Kanban views to refine search according to specific dimensions. This wigdet is displayed as a sidebar to the left of the kanban view. Part of task 1892462 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: Raphael Collet <rco@odoo.com>
2019-02-08[REF] web: extract calendar mobile stylingRomain Estievenart
Extract mobile calendar styling into dedicated SCSS file. Task ID: 1891955
2019-02-26[REF] website, web, *: move part of website into webqsm-odoo
* im_livechat, survey, website_forum When website is installed, the JavaScript code has access to utilities to define improved widgets which are automatically attached to existing DOM elements on page load. Those mechanics are more and more needed in portal which does not depend on website (as it is website which depends on portal). This commit moves part of website JS to web, so that it can be used by all 'frontend' apps whose only common dependency is web (portal, survey, auth_signup, ...). This PR also questioned several other similar issues which will be handled later like: - website should maybe not depends on portal but only on http_routing - part of portal should be moved to http_routing and http_routing should be renamed (especially for frontend layouts, etc) so that apps like survey can reuse some common code Part of https://github.com/odoo/odoo/pull/29442 task-1932066
2019-02-26[MOV] web, *: simple moves of JS files to 'public' folderqsm-odoo
* web_editor, website, survey, im_livechat Part of https://github.com/odoo/odoo/pull/29442 task-1932066
2019-02-05[IMP] web: add JS-related lib files for ace editorAndrea Ulliana
In task handled in https://github.com/odoo/odoo/pull/29999, we will need support for javascript files in ace editor. This commit adds the related lib files. See https://ace.c9.io/#extending-highlighters: https://github.com/ajaxorg/ace/tree/master/lib/ace/mode 1. https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/doc_comment_highlight_rules.js 2. https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/javascript_highlight_rules.js 3. https://github.com/ajaxorg/ace/blob/master/lib/ace/mode/javascript.js task-1919350
2018-12-07[REF] point_of_sale,web: move backbone to posGéry Debongnie
This rev. moves the backbone library from web to pos, as one of its two usecases (the search view) has just been removed. From now on, it is only used in the pos. Part of task 1893568
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-07[IMP] web: add MVC FactoryGéry Debongnie
This rev. adds a factory class to generate MVC components, to properly standardize the way MVC components should behave (in the odoo way). The most popular MVC of the webclient concerns views (Model, Controller, Renderer, for each view type). However, we wanted to generalize the notion of MVC (and extract it from the views), as we will use it in a future commit for the ControlPanel. Part of task 1893568 Co-authored-by: Aaron Bohy <aab@odoo.com>
2018-12-05[MERGE] forward port branch 12.0 up to 053bb45706fChristophe Simonis
2018-12-04[FIX] survey: fix various issues in customer view about datetimepickerRobot Odoo
Survey has troubles displaying correctly the datetime picker widget especially when more than one has to be instanciated. This merge fixes several issues related to the datetime widget when displaying the survey in customer (front-end like) view. See sub-commits for more details about each change. This merge is related to task ID 1912194. closes odoo/odoo#28966
2018-11-23[FIX] survey : Fix datetimepicker single id issue.David Beguin
In survey template, the datetimepicker was created with always the same id. So if two date fields were present on the same page, it created a multidemensional vortex that broke an alternative reality, resulting in not being able to fill in both date fields and other crapy stuffs. Also, the sass file needed to work with tempusdominus library were not loaded with the js file that comes with it. Resulting in an hugly calendar (if it could be called calendar) widget. As survey does not load backend nor frontend assets, it's necessary to have both files (js and sass files) in common assets. Task ID : 1911291 Closes PR #28966
2018-11-20[IMP] web: tests: backport of new helpersAaron Bohy
This rev. is a partial backport of abf32b8b, so that the newly introduced helpers are already available in 12.0. closes odoo/odoo#28827
2018-11-29[MERGE] forward port branch 12.0 up to 82a1e1dcc33Christophe Simonis
2018-11-26[REF] web, *: review the assets helpers organizationqsm-odoo
* survey, website_slides While not changing their name or their amount, this commit reorganizes the assets helpers to: Avoid all file duplicates in different helpers ---------------------------------------------- Before, we had to put some files in different helpers, like our bootstrap mixin overrides which were in the _assets_utils template and in the _assets_bootstrap template. Enforce the use of an helper when using bootstrap ------------------------------------------------- Bootstrap functions, variables and mixins are now out of the _assets_bootstrap template, which now only contains bootstrap css rules and our bootstrap fixes and extensions. Allow using the correct bootstrap utils in all assets ----------------------------------------------------- In some assets (especially editor ones), we may want to use bootstrap variables even though bootstrap is not included in those. This worked before but using *default* bootstrap variables. Now, our overrides can be properly included if necessary. Note: this commit may also be a first step to allow for backend bootstrap and frontend bootstrap to co-exist. closes odoo/odoo#28204
2018-11-26[ADD] web:tests: test utils for drag/drop filesAlexandre Kühn
This commit adds test helper functions to drag and drop files: - `createFile`: create a file that can be used for drag and drop in tests. - `dragoverFile`: to drag a file created from `createFile` over a DOM element. - `dropFile`: to drop a file created from `createFile` on a DOM element. These utility functions are available from `testUtils.file`. Example of usage: ```js var testUtils = require('web.test_utils'); testUtils.file.createFile({ name: 'text.txt', content: 'hello, world', contentType: 'text/plain', }).then(function (file) { testUtils.file.dragoverFile($el, file); testUtils.file.dropFile($el, file); }); ```
2018-11-20[IMP] web: testUtils: ensure backward compatibilityAaron Bohy
Rev. 7c3d5dc0 recently added new helpers to use in the tests, and moved some existing helpers to testUtils sub groups (like .dom or .mock). This rev. adds a compatibility layer to ease forwardports. closes odoo/odoo#28824
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-19[REF] web: properly name relational fields test filesAaron Bohy
2019-01-29[ADD] web: server-side-rendered qweb templates as viewsXavier Morel
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
2019-01-17[IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' fieldChristophe Matthieu
* Creating a new structure by transforming all the plugins in the library using the odoo inheritance system. Plugins are easier to implement with the AbstractPlugin to add Odoo behaviors. * From now on, the methods of the library (in this case Summernote) can no longer be called by other modules or files. Only the wysiwyg widgets can access it, to simplify the updating process. The wysiwyg object serves as an interface. * Depending on the options the snippets will be loaded or not, the editor will be in an iframe or not... all of this is transparent from the outside. * Regarding iframes, all controllers related to editing have been removed: the new API no longer needs them. This speeds up loading, eases testing and removes complexity for the same features. PUBLIC FEATURES There are several public methods on the Wysiwyg class: * Wysiwyg.prepare (WidgetParent): returns a deferred resolved when the library (xml, lazy, assets...) is loaded. * Wysiwyg.getRange (DOM): returns the range (selection in the dom) * Wysiwyg.setRange (startNode, startOffset, endNode, endOffset): creates a range (selection in the dom) * Wysiwyg.setRangeFromNode (DOM, options) that creates a range from an element (option available to select all, start or end) A jQuery selector was added: :o_editable, which indicates whether the current element is editable. That is, if it is contained in a tag with the attribute 'contentEditable = "true"' or in a tag with the class o_editable. Several methods are also present: * focusIn: makes a focus and places the cursor at the beginning of the element * focusInEnd: makes a focus and places the cursor at the end of the element * selectContent: makes a focus and selects the content HTML FIELD The HTML field can receive different options: * style-inline: {boolean} transforms a class into an inline style when saving and vice versa when reading. * no-attachment: {boolean} prevents the use of attachments (in media dialog) * cssEdit: {xml_id} to use a template containing the css to loaded in an iframe when editing * cssReadonly: {xml_id} to use a template containing the css to load into an iframe when viewing in readonly * snippets: {xml_id} snippets template (can be used with or without cssEdit) * wrapper: {template} qweb static template (containing a tag: id = "wrapper") that will include the content during editing (removed on save) MASS MAILING A widget was created for mass mailing. There are now two fields: body_html and body_arch. body_arch contains the code with the class without conversion into inline style, useful when editing and one with the inline style that is visible in readonly mode and sent by email. Advantage: no spreading errors, able to update css/theme, able to do more changes when converting to inline style so that a maximum of mail clients have an impeccable rendering. Co-authored-by: Antoine Guenet <age@odoo.com>
2019-01-09[FIX] web: adapt BS import and assets to BS updateqsm-odoo
2018-11-12[REF] web: split relational fields tests into multiple filesVincent Schippefilt
The file relation_fields_tests.js was a huge 12K lines files for which some editors have a hard time managing. We have split it in 4 files to be more managable and removed remove unused data and import. closes odoo/odoo#28561
2018-11-06[MERGE] forward port branch 12.0 up to dd70c684268Christophe Simonis
2018-10-29[MOV] web, base_import: mobile tests should be in mobile suiteAdrien Dieudonne
This fix some inconsistent error on runbot. In mobile, some views* depend on 'jquery.touchSwipe' library which is lazy loaded. As a result, the views become asynchronous... It's why this library is already loaded before running tests in the mobile test suite. So we can continue to use synchronous views whether in mobile tests or not. But some mobile tests weren't in mobile suite... In desktop, 'jquery.touchSwipe' is lazy loaded and the first test will load it for others. It's why the first one has to be asynchronous: https://github.com/odoo/odoo/commit/da7b59045d246c159f93bc75e3f19c6b1221d31c The inconsistency comes from the fact that all tests are sequential but we can't garantee the execution order. So, if the test mentionned is not the first executed one, an error will occur because the view is not asynchronous. Now, all mobile tests are moved in mobile suite to be sure that 'jquery.touchSwipe' is loaded. We also set the default value for size_class because we want a coherent environment. It is very rare to find mobile devices with more than 474px wide. *: form_view, kanban_view, res_config_settings closes odoo/odoo#28195
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-22[MERGE] forward port branch 12.0 up to b81c2bce846Christophe Simonis
2018-10-19[IMP] web: remove es5 shimVincent Schippefilt
The library es5 shim was usefull for older browsers that do not implement completely the es5 specifications, like IE9. As we do not support browsers older than IE11, that fully supports all the features of es5, the library has become useless. Removing this library will remove a little bit of noise in the callstack when debugging. closes odoo/odoo#27877
2018-11-23[FIX] web: benchmarks: add missing test_utilsAaron Bohy
Without those, the benchmarks suite can't run. closes odoo/odoo#28996
2018-11-23[IMP] web: backport of new assertsAaron Bohy
This rev. is a complement to the partial backport 49e78f46 of abf32b8. In addition to the helpers, we also backport the asserts (like isVisible, containsOnce...). closes odoo/odoo#28994
2018-10-11[FIX] web: clear all BS4 alertsqsm-odoo
Commit https://github.com/odoo/odoo/commit/8caf84f70ada259f041b424d37686845604d182a was not handling the case where there was an invisible DOM element between the button box and the alert component. Let us clear all alerts. This commit also introduces a way to properly fix/extend bootstrap in future fixes/updates (some of our rules may already be moved in that file once it is forward-ported to master). closes odoo/odoo#27662
2018-10-02[ADD] web:tests: user menu basic testsAlexandre Kühn
2018-10-01[FIX] web: add shortcuts menuitem supportRomainLibert
Since https://github.com/odoo/odoo/commit/19eacf7d23c9413de4430a3422b5ed74b37ef242, it was possible to click on a "Shortcuts" menu item in community which triggered a call to _onMenuShortcuts whose implementation was only defined in enteprise As the keyboard shortcuts are available both in community and enterprise, we should support this menu item
2018-09-28[ADD] web: ability to become superuser (uid=1)Xavier Morel
* requires that current user has group_system * only visible in debug mode (?debug) * available at login or via debug menu * special systray color in superuser sessions Closes #27254
2018-09-20[IMP] web: add a fix on underscore to support cancellableThrottleVincent Schippefilt
2018-09-18[MERGE] forward port branch saas-11.4 up to a1b384d66beChristophe Simonis