Commit Graph
84 Commits
Author SHA1 Message Date
Nicolas Lempereur cbb8799b6f [FIX] web_editor, mass_mailing: summernote oversight and video
* some oversight when updating summernote with d33086c,
* fix style when replacing image with video
2015-10-02 12:24:05 +02:00
Xavier Morel cea29e0c01 [ADD] client-side CSRF support
* add CSRF token as core.csrf_token
* add CSRF tokens to client-generated and/or JS-submitted forms
* remove broken "compatibility" mode of web.ajax.post

  /cc @dmo-odoo I've no idea how that was supposed to work, from looking
  things up all modern browsers seem to support FormData, and old IEs
  which don't don't support fallbacks either and would require
  submitting an actual form as fallback so...
2015-10-01 01:36:50 +02:00
Christophe Simonis 7636b510a2 [ADD] *: CSRF protection in forms and routes
* make CSRF protection the default on all non-SAFE methods
  note: there currently is no way to call a CSRF-protected endpoint
  without a form-encoded entity-body as that's the only place we get the
  CSRF token from.
* simple CSRF token generation: just use the HMAC'd session id, no
  generating a new random token per session then HMAC it
* use constant-time equal function to avoid timing attacks
* assert that a database secret is configured before hashing/validating
  the CSRF token
* opt-out database manager from CSRF: The super-admin password serves
  the purpose of a CSRF token in the database manager screens.
  There is no request database to obtain the
  secret and generate a CSRF token.
2015-10-01 01:36:50 +02:00
Nicolas Lempereur 7c67091a96 [FIX] web_editor: correct typo translation simple html widget
fixes #8698
2015-09-30 17:21:51 +02:00
Nicolas Lempereur 56aa103a43 [FIX] web_editor: useless margin for air editor in translation 2015-09-30 11:27:00 +02:00
Nicolas Lempereur 142a3e4176 [IMP] web_editor: rename and delete summernote files 2015-09-29 14:47:37 +02:00
Nicolas Lempereur d33086c03f [IMP] web_editor: update summernote up to 2015-08-31
update summernote library up to revision:
 https://github.com/summernote/summernote/commit/a0f26e300

see https://github.com/summernote/summernote/ for history

closes #8704
2015-09-29 14:47:24 +02:00
Martin Trigaux e0eaaee2db [I18N] add l10n_sa and pos_cache terms + reexport
One last export before v9!
2015-09-29 14:40:59 +02:00
Christophe Matthieu d459359e87 [IMP] web_editor: Convert font-awsome into picture before convert class into style to remove unnecessary style attributes 2015-09-28 15:23:35 +02:00
Christophe Matthieu bdf58adb46 [FIX] web_editor: send mail to outlook and keep image size
Office Outlook doesn't take into account the [style] attribute, and it
doesn't manage width/height in percent value.

This commit set width/heigth attribute in pixels and also always set the
width/height in style attribute (keeping them in the original unit and
setting them to auto if not present).
2015-09-28 15:23:35 +02:00
Christophe Matthieu 6ebcc06152 [FIX] web_editor: remove 'lang' from the context to save master website xml 2015-09-28 15:23:35 +02:00
Christophe Matthieu 8c9cf9eb38 [FIX] web_editor: can upload a product image with the editor and save it (without 'out of range error' because new web controller /web/image/). 2015-09-28 15:23:35 +02:00
Christophe Matthieu 9e428ae849 [FIX] web_editor: media trigger content_changed when change the media 2015-09-28 15:23:35 +02:00
Leonardo Rochael Almeida 60af7cac02 [IMP] replace simplejson with stdlib json
The stdlib version of the json library is more recent than the 3.5.3
version we are pinning in `requirements.txt`

There is no reason to use it.

Closes #6940
2015-09-28 10:53:32 +02:00
Leonardo Rochael Almeida 06b3026bcd [IMP] unittest2 > unittest
The `unittest2` package is simply a backport of `unittest` from the
Standard Library of Python 2.7 to previous versions.

There is no reason to use it any longer.

Closes #6941
2015-09-28 10:37:27 +02:00
Christophe Matthieu 4ba0232bf8 [FIX] web_editor: apply o_dirty class on change
Before: if a user blur a editable area without editing, the editor is removed and all bind are remove.
The 'content_changed' bind are removed and the 'o_dirty' class is never apply.
2015-09-25 16:06:21 +02:00
Christophe Matthieu 743f26a796 [FIX] web_editor: display editable area placeholder 2015-09-25 16:06:21 +02:00
Christophe Matthieu b9d9e44582 [FIX] web_editor: use parser from dateutil for datatime qweb field value 2015-09-25 16:06:21 +02:00
Nicolas Lempereur eed63c793a Revert "[IMP] web_editor: update summernote up to 2015-08-31"
Revert till several issues are solved.
2015-09-25 10:53:08 +02:00
Nicolas Lempereur 144b4f8098 [FIX] website: range lost in phantomjs 2015-09-25 08:30:23 +02:00
Nicolas Lempereur a3d355ada7 [WIP] web_editor: rename and delete old summernote files 2015-09-25 08:30:17 +02:00
Nicolas Lempereur 7747e0751f [IMP] web_editor: update summernote up to 2015-08-31
update summernote library up to revision:
 https://github.com/summernote/summernote/commit/a0f26e300

see https://github.com/summernote/summernote/ for history

closes #8704
2015-09-25 08:29:16 +02:00
Damien Bouvy 84b471cfa1 [IMP] web_editor: usability: allow saving even when nothing was changed when editing in the frontend 2015-09-24 11:50:25 +02:00
Christophe Matthieu 21c88933f7 [FIX] web_editor & website: don't display edit placeholder if the node have class oe_no_empty or oe_not_editable 2015-09-24 09:36:41 +02:00
Christophe Matthieu 27d1ce0454 [FIX] web_editor: transparency of modal backdrop instead of black brackground 2015-09-24 09:36:41 +02:00
Christophe Simonis cb0987889c [FIX] account_cancel,web_editor: small issues introduced during previous forward-port 2015-09-23 15:39:09 +02:00
Christophe Simonis 57168a9e90 [MERGE] forward port of branch saas-6 up to a669433 2015-09-23 14:34:26 +02:00
Christophe Matthieu e4866f830e [FIX] mass_mailing: remove the wrong scrollbar in html field
Add "web_editor_inside_iframe" id in web_editor iframe template to apply css style only when the field is in html field.
Remove "content" css media query in iframe editor to remove scrollbar.
2015-09-21 13:45:36 +02:00
Christophe Matthieu a41f915493 [FIX] web_editor: iframe of html widget must be checked before render value
If the iframe is destroyed, detached, hide (eg: click on a record, return into the list view and click on an other record), the render_value method try to resize the iframe but jQery raise an exception because contentWindow doesn't exist.
2015-09-21 13:45:36 +02:00
Martin Trigaux 2e8996ce0b [I18N] add missing translations
Fetching was stopped at sale, because reasons
2015-09-15 09:30:37 +02:00
qsm-odoo 9632f897ad [IMP] web_editor: change font-family to webclient default 2015-09-11 11:38:07 +02:00
Nicolas Lempereur 7a5e5adb56 [FIX] website_mail: special case for css splitting
The css of a mail is inlined as best as possible for the mail sending.

Previously, if there was a selector like .ch[onclick="ga(this,event)"]
the simple splitting would split in the middle and get one erroneous
selector (which then would trigger an error).

With his commit, rules containing " or ' are ignored.

opw-643548

note: forward port of 6316bce
2015-09-08 13:29:23 +02:00
Martin Trigaux 613286b0e8 [I18N] export application terms of all modules
Now that most refactoring has been merged

It is better to have red a great work of another culture in translation than never to have read it at all.
― Henry Gratton Doyle
2015-09-07 17:21:58 +02:00
Nicolas Lempereur bc8e91b2aa [FIX] web_editor: update .o_form_field_empty when loaded 2015-09-04 14:45:14 +02:00
Nicolas Lempereur a134c88d00 [FIX] web_editor: do paste after removing selection 2015-09-04 11:54:05 +02:00
Christophe Matthieu 38d7e563aa [IMP] base: add public field on attachment 2015-09-03 19:31:01 +02:00
Nicolas Lempereur c32ea33632 [FIX] web_editor, translate: xml translate encoding
lxml.HTMLParser detect the content encoding by itself if not specified.

in the issue leading to this fix, content in a mail with u'\xa4'
( ) was transformed intto u'\xc2\xa4' ( ) since HTMLParser
selected the wrong encoding (latin-1 instead of utf-8 for example).

this commit specify the known encoding and revert 3d00c210f which was
another attempt at this issue.
2015-09-03 10:21:20 +02:00
Christophe Matthieu 0f6b97a6da [FIX] web_editor: clean_for_save is not called for custom snippets because all() not contains all html matched tags 2015-09-01 15:18:07 +02:00
Christophe Matthieu 447dd53de5 [FIX] web_editor: wrong typo in fontIconsDialog widget 2015-09-01 09:42:33 +02:00
Christophe Matthieu 4b5b6b5f6e [FIX] web_editor: drop near select children of editable nodes 2015-09-01 09:23:24 +02:00
Christophe Matthieu 3d00c210f9 [FIX] web_editor: html widget: escape value before save. 2015-09-01 09:23:24 +02:00
Christophe Simonis 044c0625ad [MERGE] forward port of branch saas-6 up to 7faf72c 2015-08-31 19:57:20 +02:00
Christophe Simonis 10a417c63d [FIX] web_editor: don't loose selection when deleting an image 2015-08-31 17:23:16 +02:00
Christophe Simonis a9abf18125 [FIX] web_editor: sould not delete de tag container when select all text inside (although there are several selected child nodes)
This is forward-port of 96b33cdbce that
was stuck in limbo in forward-ports...
2015-08-28 19:16:03 +02:00
Christophe Simonis 2f28daa26c [FIX] web_editor: do not escape saved html.
Forward-port of 8c77c711ee.
This change has been forgot during last forward-port
(edeceba7df)
2015-08-28 17:39:23 +02:00
Christophe Simonis edeceba7df [MERGE] forward port of branch saas-6 up to 7a768a4
Due to `sale` rewrite (94716a3f14),
the commit 503820acb6 has been partially
ignored (in sale.order.line) and will be rewritten later using new-api.
2015-08-28 15:07:16 +02:00
David Monjoie b322536aa6 [FIX] web_editor: fixed typos introduced by 88c0ce0
It seems this.BuildingBlock was changed to this.buildingBlock
by 8c559044a5. Care should be
taken when forward porting code using this.BuildingBlock.
2015-08-26 16:01:19 +02:00
Christophe Matthieu 8eb8a982f9 [FIX] web_editor: clean_for_save all dirty options
Clean for save was only called on o_dirty nodes but o_dirty is added only on o_editable nodes.
Could use a simple jQuery selector '.o_dirty, .o_dirty *' but need to improve speed for user experience.
2015-08-26 16:01:18 +02:00
Martin Trigaux 6c51a80aa4 [I18N] export application terms of all modules 2015-08-25 12:01:38 +02:00
Christophe Simonis 88c0ce0692 [MERGE] forward port of branch saas-6 up to e16d495 2015-08-24 18:19:19 +02:00