Commit Graph
1532 Commits
Author SHA1 Message Date
jem-odoo 3d607880e6 [FIX] portal: posting message without token
This commit e84779749b factorize the check of
special access to post a message using a token mecanism, but it breaks the
case without token. Indeed, on some models, it is allow to post a message
on a document when having a certain access. This is handle with the
`_mail_post_access` attribute on model inheriting mail.thread.
Using this mecanism, a user that can read (or write) the document can also
post a message. This is used in the eShop to review product and in blog to
comment blogpost.

This commit restore posting a message without token. the normal access rights
will be applied by message post and raise if the user can not post message,
taking `_mail_post_access` into account.
The balance is now restored in the universe.

Task-1902304
2019-02-15 10:42:40 +00:00
jbm-odoo 4960453db9 [IMP] web Add widget signature on binary field
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-14 12:59:10 +00:00
qsm-odoo 52b27c4c6b [IMP] website, *: allow to control the header font-size
* portal

The user can now choose the font-size of its header menu items through
the customize dialog.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:39:16 +00:00
qsm-odoo 905d18e044 [IMP] website, *: add new logo sizing option
* portal, web

This commit introduces the first of many-to-come non-color website user
values: the logo height. Now, the user can choose it in the customize
dialog.

PR https://github.com/odoo/odoo/pull/29624
task-1904244
2019-02-08 14:38:31 +00:00
jem-odoo 794ebb0aaf [FIX] portal: cast type to consteq signed token
To post a comment with a signed token, we compare tokens with the pid.
The token is signed with the pid, which is an integer. When checking
access, we compare the token with a pid as char. Obviously, the comparison
failed, and posting the message is refused, as the 2 'pid' does not
share the same type.
This commit cast the recieved 'pid' into an integer before checking
special access.

closes odoo/odoo#30906
2019-02-07 08:49:53 +00:00
jem-odoo e84779749b [IMP] website_slide: allow to edit comment
When a portal user post a message to review a channel, we
want to allow him to edit its own comment and rating.
This commit modifies the special check access method in
portal to extract the security check and reuse it to
allow user to update its comment on slide.channel only.
We decided to reuse existing widget (new rating popup
composer) to do the message modification.

Task-1902304
2019-02-06 09:55:13 +00:00
jem-odoo 17ac041bfa [REF] portal: posting message with signed token
Before this commit, it was possible to post a message on a document
the user has no access, thanks to a token. In addition to this token,
if a hash (signed token with a partner id), the author_id of the message
was forced.
This commit change a little bit that logic by distinguish 2 cases:
1/ Token only: anyone with the token can post a message on the document. If
  the user is not logged (public with token), the author_id will be the
  customer of the document (or the public user). This case is moslty used
  for business document, through the portal or with the "share link" for
  instance.
2/ Signed token: user has no write access to the document, but can post a
  message on it. The user have to be logged, as the token is signed with its
  identifier. The goal here is to avoid leaking the access token's document
  to all visitors. This case is mostly used for public content, such as blog
  posts, slides, ...

The token case was already existing. The second is now working with this
commit. To do so, it was required to
- move `_sign_token` from the portal mixin to mail.thread.
- transfering 'pid' and 'hash' parameters from the controller to template
to js widgets.

This commit also change the `_message_post_helper` signature by making
the 3 first parameters required, as to post a message you need at lease
res_model, res_id and the message body. The optional argurments and kwargs
are here to check the bypassing access rights mecanism.

Task-1902304
2019-02-06 09:55:13 +00:00
jem-odoo 4cb228d823 [IMP] portal,website_rating: new popup composer to submit rating
Rating document available on a website will become more common, but
we want to do it with different UI widget. This commit introduces a
new "popup rating composer": the idea is the rating average is
displayed with stars, and when clicking on it, a popup with the
composer appears. The user can so submit its review.

To do so, we factorize the Portal Composer into a dedicated widget
(instead of natively inside Portal Chatter).

Task-1902304
2019-02-06 09:55:13 +00:00
Christophe Simonis 4400cce820 [MERGE] forward port branch saas-12.1 up to 4524ad06a8 2019-02-04 13:27:22 +01:00
Sébastien Theys ff368fdbd5 [IMP] portal,sale: toggle sign button depending on signature state
Before this commit, it was possible for the user to click on the Sign button
even when the signature area was empty, which would lead to an error message.
Now we disable the button when the area is empty.

Related to enterprise PR: https://github.com/odoo/enterprise/pull/3535

PR: #30653
2019-02-01 12:10:13 +00:00
Christophe Simonis f927c68ddb [MERGE] forward port branch 12.0 up to cb8fefa899 2019-01-31 16:59:58 +01:00
Odoo Translation Bot fe36bff420 [I18N] Update translation terms from Transifex 2019-01-27 01:37:55 +01:00
Martin Trigaux 15e2857cf3 [FIX] portal: match title and purpose
Was saying previous while it was actually next

closes odoo/odoo#30543
2019-01-25 10:18:13 +00:00
qsm-odoo d7acfdae2b [FIX] portal: restore BS3 clearing system for main frontend containers
BS3 used to add ::before and ::after elements on all containers so that
margins and floats are cleared inside containers. As lots of current
odoo layouts may rely on this for some alignments, this is restored (at
least for a while) here only for main containers of the frontend.

In master, we should use proper layouts to avoid the need of this.

task-1889238

closes odoo/odoo#30510
2019-01-24 11:30:30 +00:00
Odoo Translation Bot 127fdea764 [I18N] Update translation terms from Transifex 2019-01-21 17:38:09 +01:00
Martin Trigaux 1e224d244c [I18N] export 12.0 source terms
Mostly following changes at 7f8631a913

closes odoo/odoo#30072
2019-01-15 15:15:34 +00:00
Romain Derie fd80cf9e53 [FIX] portal: dont override list-group-item BS4 active color (white)
Before this commit, BS4 color for active list-group-item (white) would always
be overriden by our portal custom css to the BS4 color for inactive one.

Part of #29884
2019-01-08 12:50:24 +00:00
Odoo Translation Bot 652cecffde [I18N] Update translation terms from Transifex 2019-01-06 01:32:05 +01:00
Nicolas Martinelli 231c466abf [FIX] portal: multi-company logo
When using:
```
t-field="res_company.logo" t-options="{'widget': 'image'}"
```
the widget generates a `/web/content/` URL, which ultimately checks the
access rights in method `binary_content`. This means that if the user
doesn't have the `read` access rights on `res_company`, the logo won't
be displayed.

We use the `/logo.png` route instead since it bypasses the access
rights.

opw-1913665
2018-12-19 14:18:13 +00:00
Martin Trigaux bfe1e20d6b [I18N] export saas-12.1 source terms
To reflect fixes at ec2263080a and cd4080839f

closes odoo/odoo#30253
2019-01-16 10:35:49 +00:00
Christophe Simonis 8aa8548d8a [MERGE] forward port branch 12.0 up to 3e4138deaa
closes odoo/odoo#30045
2019-01-09 15:56:53 +00:00
Odoo Translation Bot 91382f691d [I18N] Update translation terms from Transifex 2018-12-30 01:30:16 +01:00
Sébastien Theys f1c196e609 [FIX] portal: change width of portal modal to match backend
Some features are common to portal and backend, such as the sign modal in
enterprise.

This commit uniformize the width of the modal to make it more consistent between
the two by default. Of course themes can still customize this behavior.

closes odoo/odoo#29521
2018-12-24 15:03:29 +00:00
Christophe Simonis f351dd8cab [MERGE] forward port branch 12.0 up to 047e2b28de 2018-12-12 11:38:25 +01:00
qsm-odoo 1144235d06 [FIX] website_forum, *: remove underline on icon buttons hovering
* portal

In our default theme, when hovering links (or .btn-link elements), the
text is underlined. This effect is however not desired for links which
contain only an icon, especially in the forum.
This commit removes that underline effect for all icon buttons in the
frontend (at least by default, this is a theme choice). Icon buttons are
defined as link or .btn-link elements which directly use the "fa" class
on them.

This commit also solves the flag button of the forum which did not have
any effect because of bad bootstrap use.

closes odoo/odoo#29434
2018-12-11 14:31:42 +00:00
Nicolas Martinelli bc38850c96 [FIX] portal: missing translation
closes odoo/odoo#29413
2018-12-11 10:21:22 +00:00
Odoo Translation Bot 47aae6faba [I18N] Update translation terms from Transifex 2018-12-23 01:29:13 +01:00
Odoo Translation Bot ec4ee14c89 [I18N] Update translation terms from Transifex 2018-12-09 01:16:26 +01:00
Odoo Translation Bot 3ce5c8bebd [I18N] Update translation terms from Transifex 2018-12-16 01:18:51 +01:00
Odoo Translation Bot 1208ac6ce3 [I18N] Update translation terms from Transifex 2018-12-02 01:25:05 +01:00
qsm-odoo 02dcef80c9 [FIX] portal, *: stop breaking behaviors on dblclick
* payment, website_sale

This commit solves the problem described in the issues mentioned below
by using the new system introduced by the parent commit.

That new system is even more integrated with website "animations" but
the mentioned issues' features are not yet converted to use those (this
will be a master task to make "Website Widget" be defined in portal to
use all of those integrated features). This commit however converts an
already protected behavior of website_sale using that "animation"
integration.

Closes https://github.com/odoo/odoo/issues/27976
Closes https://github.com/odoo/odoo/issues/28704
2018-11-28 16:11:24 +00:00
qsm-odoo a8fec3b5cd [IMP] portal, website: change the default website body bg
Use a very very very light gray as body background color for
the website so that default white cards have some contrast with the
body. Also adapt the portal system to use the portal colors when the
body bg color is equal to that very very very light gray (while it was
compared to $white before).

closes odoo/odoo#29318
2018-12-06 14:18:36 +00:00
Christophe Simonis e1f9499d26 [MERGE] forward port branch 12.0 up to 053bb45706 2018-12-05 18:46:15 +01:00
Christophe Simonis ce4cc24621 [MERGE] forward port branch 12.0 up to 82a1e1dcc3 2018-11-29 20:06:16 +01:00
Christophe Simonis 7a0243ec15 [MERGE] forward port branch 12.0 up to b3052b690f 2018-11-23 12:11:32 +01:00
Toufik Ben Jaa 69c2b0a7d1 [FIX] portal: force cache clearing at access_token generation
- The value returned by the method `_portal_ensure_token` is False due
  to a cache issue.

  The value is generated written using the `sudo` environment while in
  the current user environment the cached value is `False`.
  After generating the value, the cache is not cleared, thus letting the
  method return `False`

closes odoo/odoo#28836
2018-11-20 11:49:17 +00:00
Odoo Translation Bot b60f9bb739 [I18N] Update translation terms from Transifex 2018-11-18 01:28:38 +01:00
Geoffroy Larue e9879e63b4 [IMP] portal: improve design
Small changes to the customer portal : form input reorderings,
relabelling, removal of the draft quotation warning.
2018-11-16 09:33:06 +00:00
Sébastien Theys 130af96dc1 [IMP] portal,sale: improve signature widget and move it to portal
Purpose
=======

The goal is to avoid duplicate code between portal and sign (enterprise), and
also to allow the user to use the signature mode 'auto' and 'load' in portal
(before this commit only 'draw' was available in portal).

The sales order signature (currently the only portal signature) has been changed
to use this new code.

This signature widget has been improved:

Improved style:
 - better structure and use of BS classes
 - removed most of custom CSS
 - made it more responsive

Changed code to follow guidelines, added JSDoc.

Technically
===========

New widget NameAndSignature common to portal and sign (enterprise).

Reworked existing portal signature form to use new widget.

Related to enterprise PR https://github.com/odoo/enterprise/pull/3266

task-1894903

closes odoo/odoo#29453
2019-01-28 09:48:32 +00:00
Christophe Simonis cf52a04979 [MERGE] forward port branch saas-12.1 up to d3b8422c9c
closes odoo/odoo#30614
2019-01-28 13:58:11 +00:00
qha-odoo 5b563549fa [IMP] website_event, *: refactor website events layouts
* base, portal, website, website_event_sale, website_event_track

- The previous event registration form was not clear on mobile

- Review some layouts to match the new design general idea, using cards
  (see forum refactoring of https://github.com/odoo/odoo/pull/29235)

- Use correct bootstrap components (like a menu instead of a breadcrumb
  on event pages)

- Review options to be able to disable the left / right column and
  choose the exact options you want to appear in them

task-1858034

closes odoo/odoo#30559
2019-01-25 14:30:55 +00:00
qsm-odoo 0be8a1e43e [FIX] portal: remove useless dependency to 'web_editor.ready'
Following the new editor's merge at https://github.com/odoo/odoo/pull/29775,
the 'web_editor.ready' module was moved to website without caring about
where it was used.

Fortunately the only non-website app which uses it is portal in a module
which in fact does not need it.
It would probably make more sense if it was in portal though (see
https://github.com/odoo/odoo/pull/30409) but as an upcoming PR is about
to fix those problems (https://github.com/odoo/odoo/pull/29442), this
can stay in website for now.

closes odoo/odoo#30473
2019-01-24 09:51:00 +00:00
Christophe Matthieu 6521cf4f66 [FIX] *: review 'frontend' pages init (web_editor.base)
* auth_password_policy_signup, auth_signup, website, portal, survey,
  web_unsplash, website

Following the new editor's merge at https://github.com/odoo/odoo/pull/29775
web_editor.base has been moved to website while it was still used by
frontend pages which do not depend on website (especially portal).

This commit moves web_editor.base to portal while waiting for
https://github.com/odoo/odoo/pull/29442. It also removes the unnecessary
dependencies to it in non-portal pages (in survey for example).
2019-01-22 17:55:00 +00:00
Christophe MatthieuandAntoine Guenet f296992317 [IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' field
* 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-17 08:40:21 +00:00
Christophe Simonis d7c5bc02cc [MERGE] forward port branch saas-12.1 up to 8aa8548d8a 2019-01-09 19:59:27 +01:00
Andrea Ulliana 59cc261448 [IMP] website, *: allow creating anchor links
* portal, web_editor

Anchor Link:
- Some visual improvements of the link dialog.
- New 'Page Anchor' field.
    - System by default: top and bottom.
    - Shows existing anchors.

Creation of the anchor:
- New option 'Anchor Name' to be able to create an anchor.

task-1913458

closes odoo/odoo#29150
2019-01-09 16:16:01 +00:00
qsm-odoo 52ec536cef [REF] *: make stronger bootstrap assets
* portal, theme_bootswatch, web, web_editor, website

With less2sass and bs3tobs4 tasks, the assets structure was reviewed to
handle the specificities of both framework and to prepare for our next
odoo tasks. In particular, the assets_helpers and bootstrap overrides
were basically split into 4 parts: utils, primary variables, secondary
variables and bootstrap variables.
(see https://github.com/odoo/odoo/commit/6e4db7d13a926845bf82f5b035afede42d6d5a89)

Using the !default system for the bootstrap variables parts seems now
a good improvement. This is part of what this commit does: adding the
default flag for all bootstrap variables overrides and inverting the
order of the files in the _assets_backend_helpers and
_assets_frontend_helpers templates. This allows to avoid code like this:

portal:
```
$body-bg: white;
```

website:
```
@​if $var != null {
    $body-bg: $var;
}
```

This code makes the body white with portal or equal to $var with website
if $var has a value. The same behavior in the new file order is achieved
with:

website:
```
$body-bg: $var !default;
```

portal:
```
$body-bg: white !default;
```

This order is now also followed for the _assets_secondary_variables
templates (there are only a few).

This commit also make better assets hierarchy by making website inherit
from portal assets (instead of web) and portal inherit from web_editor
assets (instead of web) (thus relying on strong dependencies instead of
installation order which is not always right for migrated databases).

closes odoo/odoo#29757
2018-12-26 17:25:23 +00:00
RomainLibert a03faab03f [IMP] event, website_event: Make ics file generation available in event
Ics file generation should be possible even when only event is
installed as it is a basic feature of events.

Moreover we need to be able to generate such files in order to replace
the old outlook api used in the event templates, api which is not
supported anymore.

We decided to use ics files because it is supported by most calendar
schedulers hence working with outlook.

Linked to task #1853063

closes odoo/odoo#28477
2018-12-17 11:46:48 +00:00
Odoo Translation Bot dcc077afc5 [I18N] Update translation terms from Transifex 2018-11-11 01:26:46 +01:00
Odoo Translation Bot 790bd62f14 [I18N] Update translation terms from Transifex 2018-11-04 01:27:12 +01:00