Commit Graph
8 Commits
Author SHA1 Message Date
Jeremy Kersten 8a1cb4758d [FIX] web_editor: avoid useless 404 during test
removeSrcAttribute should avoid these rpc, but for some
unknown reasons, on firefox it works but not with chrome.

Because the purpose of the test is to check the url and
not the content, that works to use an existing route.

Courtesy of @kangol for the fix
2018-02-01 14:13:32 +01:00
Alexandre Kühn 6632822d14 [FIX] web_editor: html field commitchanges fully loaded
Fix over this one: https://github.com/odoo/odoo/commit/cae188514fa8b0a7c785a630ac4aff677b2071fa

The intent was to disable buttons in form views until html fields are fully loaded,
but it was not disabling the buttons for the following reasons:

   1. It is looking for buttons in the DOM, although they
      are not already attached into the body at this moment.
   2. It was disabling the buttons only at widget start(),
      so only once after "Empty Cache and Hard Reload".

We propose a better solution than disabling the buttons in the control panel:
when we click on "Save", the html field ensures that it is fully loaded while commiting the changes.
2017-12-18 11:27:11 +01:00
Aaron Bohy deba788b4c [FIX] web_editor: html_frame: saving in readonly
A form view record may be saved even if the record is displayed in
readonly (e.g. when a button in the form view is clicked). When
this happened, if there were an html field with html_frame widget
in the form, it crashed (e.g. in Email Marketing > Mass Mailings >
open one > click on Test Mailing).
2017-08-10 13:56:22 +02:00
Darshan Kalola 7ada921e67 [FIX] web_editor: make html widget translatable
The translate feature of widgets html and html_frame had been
broken by the new views refactoring. This commit restores it for
the html widget, and removes it completely for html_frame as it
wasn't working correctly before the new views anyway (moreover,
it had already been disabled for mass_mailing: de403dc1ab).

This commit also ensures that the changes are correctly saved for
the html_frame widget. Note that this widget still needs to be
converted to our new coding guidelines.
2017-06-28 12:41:35 +02:00
Géry Debongnie cad943d035 [FIX] web_editor: prevent crash with FieldTextHtmlSimple
If the method commitChange from the widget FieldTextHtmlSimple was
called in mode=readonly, a traceback was displayed.  This is not very
common, because most save operations are done in mode=edit, but it can
happen in readonly mode: when the user clicks on an action button, then
the form view is saved, if necessary.

To reproduce this bug, just open a form view for res.users, and click on
the Change Password button.
2017-05-29 12:12:44 +02:00
Aaron Bohy ec988d4121 [FIX] web(_editor): field widget html
The field widget html wasn't implemented yet in the new views. A
very basic implementation was done in addon web. It only handled
the readonly mode so that the field were displayed in studio.

This commit removes this basic implementation from web, and re-
introduced the old one, converted, in addon web_editor.
2017-04-13 14:31:24 +02:00
Aaron Bohy 2d2e9c93c3 [FIX] web_editor: various fixes and new tests
- use 'nodeOptions' instead of 'options' in FieldTextHTML as
  'options' doesn't exist, it has been renamed into nodeOptions
  in AbstractField.
- mock iframe route in test to prevent the test framework from
  displaying an error (unimplemented route), and so the test from
  being red.
- test that the url given in the node options is correctly used.
- remove useless and broken code introduced by last rebase.
2017-04-11 19:44:38 +02:00
Géry Debongnie 905e01921f [REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.

Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm
2017-04-11 19:44:38 +02:00