Commit Graph
132330 Commits
Author SHA1 Message Date
Thibault Delavallée dc89f58467 [IMP] mail, rating, portal_rating: improve message and rating views
Purpose of this commit is to add some missing fields in message view, notably
is_internal newly added flag and its ratings. Rating form view is also
updated to display is_internal flag, and form view is a bit reorganized.

Task ID 2071556
PR #38692
2019-12-02 15:18:45 +00:00
Thibault Delavallée 7fae045d48 [MOV] website_rating: now move translations to portal_rating
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal

SPECIFICATIONS

Now that website_rating is now portal_rating, let us update translations
files accordingly.

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:45 +00:00
Thibault Delavallée 9e0677882d [MOV] website_rating: move to portal_rating
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal

SPECIFICATIONS

Now that publish feature is replaced by internal directly in mail and portal
rating portal inclusion can be done safely in a portal_ratign module instead
of website_rating. It allows to remove the dependency and give the rating
feature of customer chatter directly in portal applications.

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:45 +00:00
Thibault Delavallée 82f56ffddf [IMP] mail: simplify parent and parent internal computation in routing
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In this commit we use the is_internal flag to correctly propagate it from
mail gateway and clean some parent check. In this commit some code is cleaned.
No functional change should occur with this commit.

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:44 +00:00
Thibault Delavallée 5649fc88e8 [REF] {website_}mail: move and replace published field of mail.message to is_internal
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

Website mail defines a website_published field allowing to publish / unpublish
comments on the frontend of some modules. This field has several drawbacks :

  * it is used only for front-end people (portal, public) and has no real
    effect in chatter / classic discussions;
  * it is used only in some advanced front-end module and is not available
    in portal by default;
  * its naming is not really correct as it is not linked to fields coming
    from the website_published mixin and its behavior is not really
    the same;
  * its use is a bit duplicated with internal flag coming from subtype
    allowing to hide messages related to an internal subtype;
  * there are overrides of standard mail.message methods just to handle
    this flag;

In this commit we change that field by an is_internal flag directly on
mail.message model itself. It tells if share people (customers, share users)
are allowed to read the message. This field can be given through posting
API or set manually using widgets. It is also used in access rights custom
methods and managed like the internal flag of subtypes.

Mailgateway was already using an internal flag for internal note replies. It
is renamed to is_internal and propagated as it is now a standard field. It
also eases code understanding.

Portal is updated to allow managing the flag directly. It means customer portal
now natively allows to moderate customer comments without any need of website
modules.

Rating is updated accordingly. An is_internal field is added, replacing the
related on website published.

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:44 +00:00
Thibault Delavallée 46b9a97b56 [MOV] {website_}mail: move description field of mail.message directly in mail
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFCIATIONS

Move description from website_mail directly to mail. Anyway it is a
non stored computed field and therefore having it available directly
in mail does not cost anything.

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:44 +00:00
Thibault Delavallée e2b33f460d [REF] mail, various: rename subtype parameter of message_post to subtype_xmlid
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:44 +00:00
Thibault Delavallée 06f169a0ee [FIX] mail: give default void list instead of None when checking user groups for notification
Some override of ``_notify_classify_recipients`` may not check that groups
is None and expect a (maybe void) list.

Task ID 2071556
PR #38692
2019-12-02 15:18:44 +00:00
Julien Castiaux 98374bb0cd [FIX] website_slides: external tour used old code
Fine tunning of 07f70e3c1

closes odoo/odoo#41194

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-02 15:05:48 +00:00
Florimond Husquinet (fhu) 30cd679b81 [IMP] sms: allow to send SMS to oneself
Currently discuss post (through mail or sms) does not allow the author
to be notified of its content, as

  * he posted it and is therefore already updated;
  * it could create email loops;

However with SMS one could easily try to send SMS to himself using the
sms composer that is different from the mail composer. In that case
just use the ``mail_notify_author`` context key allowing to bypass the
"no author notification" rule.

Task ID 2091685
PR #40650

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-02 15:34:14 +00:00
Debauche Stéphane 88145eb645 [FIX] im_livechat: fix the ajax loading on external website
Bug
===
The file "public_root.js" try to load "/web/webclient/locale/en_US" with ajax.loadJS
we do not have the address to the Odoo server, so we try to load the file locally
but this file might not exist on the website which is using the widget

Fix
===
Overwrite ``ajax.loadJS`` and ignore ajax loading
(also printing a warning message in the JS console)

Task #2081146

closes odoo/odoo#41177

X-original-commit: 50f8508ca8569acc538a2af6a3c1162d39f834cd
Signed-off-by: std-odoo <std-odoo@users.noreply.github.com>
2019-11-04 15:02:50 +00:00
Hetal Dhanak 67951fe074 [FIX] mrp, purchase_requisition: prevent stage altering
Previously, when grouped by state, user was able to drag
and drop kanban boxes to alter the state of an unbuild, a
purchase requistion or work order. However the state should
be readlonly and could only be modify via public methods on
those objects. Those methods do additional required stuff than
just modifying the state.

task-2087309

closes odoo/odoo#40759

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-12-02 14:32:04 +00:00
lejeune quentin 270fa57d64 [FIX] point_of_sale: Rename posbox.img to iotbox.img
Renames the file created by the build,
from "posbox.img" to "iotbox.img"

closes odoo/odoo#41190

X-original-commit: 3abe39e785d28d1e0b1a18eb9b98c1d341e5a116
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-12-02 11:15:00 +00:00
lejeune quentin 5986481c69 [FIX] point_of_sale: Fix kpartx mapping
Kpartx did not erase the mapping correctly
Now we delete the mapping directly in "/dev/loopx"

X-original-commit: a33482ed703d162e79493b05a01e9724912b0385
2019-12-02 11:12:38 +00:00
lejeune quentin e943e80526 [FIX] point_of_sale: Fix locale variable for the IoT Box
We change the locale variable from en_GB to en_US.
But we need to re-generate variables.

X-original-commit: 0c5b5078872263a160fac56a1c326620c5e1d765
2019-11-29 16:09:20 +00:00
William Henrotin 53252ed7bc [FIX] mrp_workorder: suggest total quantity by lot
Use case:
Plan a production of 10 units on 2 workorders. Produce 4 units of lot1.
Record the production and produce the 6 next ones with the same lot1. On
the second workorder, the suggested quantity is 4 and not 10.

This issue is due to the fact that we fill the next workorder quantity
only at the first production batch and we don't check that the same lot
can be used again.

This commit call the mathod to update the quantity on the next workorder
if the first lot is produced again.

closes odoo/odoo#41189

Opw: 2127665
X-original-commit: e15fc6ac994edabc8907c13295c883cff9320d10
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-29 15:23:26 +00:00
Romeo Fragomeli 9cee8c36f9 [FIX] web: restore mobile responsive viewport in mobile test suite
After commit odoo/enterprise@8a38a60b1f
mobile tests didn't run correctly because of missing viewport META in HEAD.

This commit add the missing META. This META must be before all
JavaScript file to ensure that JavaScript also know that we work in
a viewport.

Note that "runbot" run tests in a chromium headless with a size screen
reduced and so it worked without this fix.

closes odoo/odoo#41183

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-12-02 13:43:28 +00:00
mcm-odoo fea8d452b2 [FIX] im_livechat: allow manager to read all sessions
Managers could see only their sessions like other operators.
Now they can see all the sessions so they can check and help the operators.

task-2048498

closes odoo/odoo#41175

X-original-commit: 6ae791335a1986aa4cc72f7ed9aadd471c1774c5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-22 14:27:10 +00:00
Yenthe666 3cf3c2dbd4 [FIX] account: remove duplicated field
The field user_id was created twice in the model with the same values and options, only a different help message. This removes the duplicated one.

closes odoo/odoo#40542

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-11-20 08:35:26 +00:00
Xavier Morel 56e47c51ed [REV] core: logger configuration part of 6044782aef
Configuring the non-root logger based on --log-level had the
side-effect (unclear whether it was intended or not as none of the
relevant commits really documented the idea) that log-level could
override log handlers being set on the root logger e.g. if
`log_handler = :INFO` is set in the config file, `--log-level=warn` on
the CLI will override it.

This could be replicated by swapping `pseudo_config` and `logconfig`,
*however* it would also make the sub-loggers override
differently (currently on an exact logger match log-handler overrides
log-level).

The ideal fix would likely be to sequence log-level from the
configuration file, log-handler from the configuration file, log-level
from the CLI and log-handler from the CLI. However that doesn't really
work with the current structure.

closes odoo/odoo#41180

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-12-02 12:38:49 +00:00
Nicolas Martinelli f662855701 [FIX] stock: duplicated lines
When printing the 'Picking Operations' report in case of a receipt,
lines are duplicated.

This is because we need to print the `move_line_nosuggest_ids` as
displayed in the view.

opw-2125049

closes odoo/odoo#41168

X-original-commit: eed3171f2f057223c3fbedd95ce6bcde2124f46c
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-12-02 09:10:25 +00:00
ryv-odoo 47ff160b42 [REF] mail: improve and refactor mail template preview
PURPOSE

Improve mail template preview wizard by improve its views and displaying
more rendered fields. It helps users knowing what will be sent to customers.

SPECIFICATIONS

Rename template model to mail_template_preview to better match the mail
template namespace.

Remove _inherit on mail.template and instead choose fields to compute
and display. Indeed lot of fields are unnecessary or badly computed.
Instead just add fields on the wizard that depends on mail template
and will be computed based on mail_template_id field of wizard.

Improve error management.

LINKS

Task 2085912
PR #38708

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-02 10:51:02 +00:00
ryv-odoo 2b4e172c6f [IMP] mail: improve displayed error when template rendering crashes
Currently when rendering a template crashes, error is not easy to
understand as it is hidden in a generic message. Purpose of this commit is to
improve this message to indicate why the template fails to build (only the
first error encountered).

Task 2085912
PR #38708
2019-12-02 10:22:12 +00:00
Debauche Stéphane a23fe117bf [IMP] im_livechat: improve and add demo data
Purpose of this commit is to improve livechat demo mode by adding conversations
spanning on several months and with ratings and different operators. That way
we have beautiful data to show in demo mode.

Task ID 2075287
PR #37355

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-02 10:59:55 +00:00
Florimond Husquinet (fhu) 0a46e086c0 [IMP] website_slide: improve the ways to search through courses
PURPOSE

Purpose of this commit is to improve search capabilities of eLearning
frontend application. Searching tags and content should be easier to
do, update and notice.

SPECIFICATIONS

Before this commit
- There is no visual indication to what are the selected filters.
- The user can only select one tag in each dropdown box.
- When the user selects a tag on one course card, this tag replaces all other
filters.
- When the user enters custom search terms, it replaces all other filters.
- When searching a documentation, a stacktrace appears.

After this commit
- Selected tags appear as little tag boxes under the search bar.
- The custom search terms appear as one tag box.
- It's possible to remove a search tag by clicking on the cross present in each
little box.
- It's possible to select multiple tags in each dropdown box.
- Tags in course cards work the same as tags in dropdown boxes, and add
themselves to the list of filters.
- To generate the list of courses to display, a logical OR is operated between
tags of the same group, and a logical AND is operated between groups of tags.
- A logical AND is operated between the custom search terms and other filters.
- A logical AND is operated between the "My courses" options and other filters.
- Bug when searching a documentation is fixed.

LINKS

Task ID: 2080617
PR #39259

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-02 10:18:36 +00:00
Nans Lefebvre 5ea09c2ed8 [FIX] base: translate error messages at failed import
Forward-port of ffee5bdbd12b0080349da515d01981943355d0cd;
because of 1a315e87b05fcbdefcb3db6d8d4837f6cc3e835c by the same author,
only the following are left:
- we need to translate the untranslated message
- give the temporary cursor a name different from cursor or cr
  so that _'s _get_cr method does not get the closed cursor

closes odoo/odoo#41140

X-original-commit: 926873031d479ec96ca122fe8c3a481b31f2a32b
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-11-29 13:21:18 +00:00
Romeo Fragomeli ecc028c0e8 [IMP] mail: use _notify_get_action_link and not inline string
Note that this also add data-oe-model and data-oe-id in XML.
This allow us to avoid to load these links as external URL when
a user receive it in inbox instead of external mail client.
See file addons/mail/static/src/js/thread_widget.js -> _onClickRedirect

Task ID: 1895451

closes odoo/odoo#39958

Related: odoo/enterprise#6414
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-12-02 09:10:34 +00:00
qmo-odoo a82fd08813 [FIX] website_slides: Fix traceback when creating content in mobile
This commit fixes the traceback that happens when we try to create
a question from the survey form in mobile mode.

The problem was due to the context not being propagated
to the "add record" button that appears in mobile mode.
Therefore, as we use that context in our widget, it crashes.

The solution to this is to just use the normal tree view behavior
instead of our override when we are in a mobile environment.

LINKS

closes odoo/odoo#41143

Taskid: 2071342
Pr: #40694
X-original-commit: 0dc7d956c59dfbece1f05e475c227affd51ce435
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-11-29 16:00:05 +00:00
qmo-odoo 74854ebf2c [FIX] survey: Fix traceback when creating a question in mobile
This commit fixes the traceback that happens when we try to create
a question from the survey form in mobile mode.

The problem was due to the context not being propagated
to the "add record" button that appears in mobile mode.
Therefore, as we use that context in our widget, it crashes.

The solution to this is to just use the normal tree view behaviour
instead of our override when we are in a mobile environment.

LINKS

Taskid: 2071342
Pr: #40694
X-original-commit: b394a67ccd527b4ff88f0b59083fd3b59cf97681
2019-11-29 15:59:26 +00:00
Xavier Morel ba7afeb5bc [REM] sale_timesheet: dynamic domains
closes odoo/odoo#40947

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-12-02 08:46:03 +00:00
Odoo's Mergebot 73e3ad9159 [MERGE] mail: clean mail.mail creation flows and make this model more private
From now on mail.mail is considered as a technical model. Indeed people should
not really manually craft mails by hand. Instead various functional flows
should either send mails, either craft mails based on some user input.

We therefore make mail restricted to admin users. Flows creating mail.mail
are updated to use sudo, and ensure it was done in a context that makes
sense to delegate this power to the user.

Some cleaning is performed prior to that change of ACLs, done in separate
commits. This cleaning includes

  * ease the use of mail.thread tool method _message_compute_author by
    cleaning its api (return tuple instead of dict);
  * give a way to access to company email and catchall with formatting.
    Those will be used in various automated emails. Indeed currently several
    templates use either ``company_id.partner_id.email``, ``company_id.email``
    or even don't provide fallback values;
  * improve mail creation calls, notably author and email from default
    computation. Purpose is to correctly compute author_id and email_from
    in mail_message and mail_mail as they depends from each other. Moreover
    it is a good idea in various flows to specify email and author when giving
    creation values to avoid default computation that is not always guaranteed
    to be accurate notably when involving super user;
  * improve author / email_from synchronization in default values in mail
    composer;
  * clean some calls to mail.template send_mail();

Task ID 1853147
PR #32243

Related: odoo/enterprise#4001
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-12-02 11:12:56 +01:00
Romain Derie 9b3de32478 [FIX] http_routing, website: fix frontend lang in http dispatcher
This commit fixes 2 issues, both coming from a misbehavior in
`get_nearest_lang()`:
1. Anyone could reach the website in a lang available in backend but not in
   frontend. Eg, french is activated but not a website lang, going to `/fr`
   would show the page in french.
2. As a logged in user coming from backend in a lang not available in frontend
   (has request.lang set to that lang), the website would show a 500 error page
   since it would not filter out the current request lang.

Both these issues are fixed here by ensuring langs are filtered out if they do
not belong to the frontend (website langs).

Step to reproduce (bug 1):
  - Install french in backend lang (not on website)
  - Visit `127.0.0.X/fr_FR`, the frontend will be displayed in french even if
    it not a lang available in frontend.

Step to reproduce (bug 2):
  - Install french on frontend and remove english from frontend
  - Navigate to the backend /web
  - Navigate to frontend, it will crash

Fixes #40572 and fixes #40078

closes odoo/odoo#41146

X-original-commit: 4bfba037fbbf34c178abd532f7bf52b94ae40b27
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-12-02 08:31:26 +00:00
Thibault Delavallée 69ccabb212 [FIX] mail: restrict access to mail.mail model
From now on mail.mail is considered as a technical model. Indeed people should
not really manually craft mails by hand. Instead various functional flows
should either send mails, either craft mails based on some user input.

We therefore make mail restricted to admin users. Flows creating mail.mail
are updated to use sudo, and ensure it was done in a context that makes
sense to delegate this power to the user.

Task ID 1853147
PR #32243
2019-11-29 13:35:14 +00:00
Thibault Delavallée 1838191eec [REF] mail, various: improve mail creation calls, notably author and email from default computation
Purpose of this commit is to correctly compute author_id and email_from
in mail_message and mail_mail as they depends from each other. Moreover it
is a good idea in various flows to specify email and author when giving
creation values to avoid default computation that is not always guaranteed to
be accurate notably when involving super user.

Mail message creation could lead to desynchronized values between author
and email_from. This is improved with this commit by correctly inheriting
from default_get and computing both of them at the same time instead of having
two default values. Indeed they depend on each other.

Same thing is done for mail composer. Mail Thread offers a tool method to
find email_from / author_id based on having one of those values or current
user and it is called whenever necessary.

Some calls to mail template send_mail are also cleaned.

Task ID 1853147
PR #32243
2019-11-29 13:35:14 +00:00
Thibault Delavallée b9a22d2f24 [IMP] mail: add computed fields for company emails
Purpose of this commit is to give a way to access to company email and catchall
with formatting. Those will be used in various automated emails. Indeed
currently several templates use either ``company_id.partner_id.email``,
``company_id.email``, or even don't provide fallback values.

With this commit from a company record people will be able to use

  * a correctly formatted catchall: ``"My Company Name"
    <catchall_alias@catchall_domain>``
  * an email_formatted field like partner email_formatted that is either its
    partner-related email_formatted value, or formatted catchall if its partner
    is not correctly configured;

Various calls to mail creation are updated accordingly.

Task ID 1853147
PR #32243
2019-11-29 13:35:14 +00:00
Thibault Delavallée 351b0ca6f4 [IMP] mail: improve returned values of _message_compute_author
Purpose of this commit is to ease the use of mail.thread tool method
_message_compute_author. Instead of returning a dict with two values and
having to unpack them, directly return a tuple with both author and
email_from values. All calls and return management are the same in mail.
Let us simplify code.

Task ID 1853147
PR #32243
2019-11-29 13:35:14 +00:00
odoohouse 05606ded0d [ADD] l10n_dk: introducing Denmark localization
added CoA, taxes, fiscal positions and related stuff

closes odoo/odoo#41064

Task: 40224
X-original-commit: 11280c0c601fd29ed875bc4c63e02852ba75ae17
Signed-off-by: Josse Colpaert <jco@openerp.com>
2019-11-28 13:39:09 +00:00
Nicolas Martinelli 785a426479 [FIX] project_timesheet_holidays: create company
- Install project_timesheet_holidays
- Create a company with any user (except the SUPERUSER)

An AccessError is risen.

This is because the new project is created in the new company, but the
user is not in this company. The record rule `project_comp_rule`
prevents the constraint to be evaluated.

`sudo` seems the only solution here...

opw-2146153

closes odoo/odoo#41144

X-original-commit: a7d24cabafe1a9c71f9dbdb7cf3f129006250951
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-29 14:29:58 +00:00
Odoo's Mergebot f7fb388330 [MERGE] web_editor, *: new widgets system for editor left panel
This is a first step towards more complex behaviors in the left panel
and more possibilities with standard XML options. The main goal is to
use widgets for internal option components (checkbox, button, input,
colorpicker, ...) as a way to receive a value for an option method
(selectClass, selectStyle, ...) while the two parts of this system were
both handled by the option before.

For example, now, a developer can say: "I want a colorpicker to style
the border-color of this elements" or "I want the combination of two
inputs to be set as a data-example of this element" without writing
any JS.

See sub-commits for details.

In preparation of task-2122935

closes odoo/odoo#40282

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-12-01 19:03:21 +01:00
qsm-odoo 10a467e3e1 [FIX] web_editor: resolve conflict between tests and options mutex
In a normal flux, this happen when an option is hovered and left:

1) Hover event -> the widget goes in 'preview' state and notifies a
                  preview to the option

2) The preview is received by the option and, after an internal mutex
   resolution, the option enables its methods with the widget values.

3) Leave event -> same as (1), except leaving 'preview' state

4) same as (2), except receiving a 'reset'

Everything is fine and correctly managed... except if a JS code triggers
both hover and leave events in the same execution... and this is what
tests are doing. In this case, as (2) executes after an internal mutex
resolution, the points (2) and (3) were inverted, so the widget left the
'preview' state before (2) got the widget values.

Maybe the test system has to be improved, but this commit solves the
problem for this case explicitely.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 16:00:06 +00:00
qsm-odoo 3be9ae5672 [IMP] web_editor, *: automatically update snippet option UI on focus
* website, website_blog, website_sale

Some snippet option already needed to implement this by themself and now
that they use custom widget, this is even more needed. The long-term
goal is that developers should not have to override the onFocus method
or the updateUI method but only the _computeWidgetState method.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
qsm-odoo fdac73e99d [IMP] web_editor, *: add new user value colorpicker widget
* web, mass_mailing, website

Introduced a new sub-widget for snippet options: we-colorpicker. This
allows to retrieve a color value (either a normalized css color or a
theme color name) to be used for a snippet option method.

This commit replaces the old 'colorpicker' snippet option whose behavior
is now simply achieved by defining an xml option using a we-colorpicker
widget in combination with the 'selectStyle' standard method.

This commit also adds the possibility to control the border-color of
elements alongside their border-width. Again, just a we-colorpicker
widget in combination with the 'selectStyle' standard method.

Note: this commit reviewed what the colorpalette palette widget
notifies. This is not a cssColor and a 'isClass' flag to say if it is
a css class or not. The colorpalette always returns a color string which
can be the name of a color like 'alpha'. This is up to the caller to
check if the color string is a css color or not with isCSSColor. In the
case it is not, the related code can read the actual color by reading
the related css variable.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
qsm-odoo 216cf93b4d [REF] web, web_editor, *: review normalization of colors
* website

Review colorpicker methods to always allow to use normalized colors.
Also factorize some code in the color palette widget.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
qsm-odoo 702a0cd5c5 [REF] website: fix linter errors in snippets.options.js file
Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
qsm-odoo b38253f400 [REF] web_editor, *: use widgets for left panel components
Before this commit, the rendering of inner content of the left panel
options was handled through _buildXXXElement methods in the options
widgets. Now they are handled through sub-widgets which also handle
the user events.

Each sub-widget is notified with the string value it should hold
according to the snippet option target and methods. Each sub-widget
notifies a string value following user interactions, which snippet
options can use to adapt their target through their option methods.

The current sub-widgets introduced by this commit are (others will
follow):

1) we-button
2) we-checkbox
3) we-input
4) we-select (typically containing multiple we-button widgets)
5) we-multi (typically containing multiple we-input widget)

Following this commit only 3 standard option methods remain, which can
be used with any meaningful widget:

1) selectClass

-> Same as before + handle the old 'toggleClass' method when used with
   a checkbox-like widget.

2) selectStyle

-> Same as old setStyle, introduced recently (simply renamed)

3) selectDataAttribute

-> Handle both old selectDataAttribute and setDataAttribute, introduced
   recently

The parameters these methods received are now:
- previewMode: same as before
- widgetValue: the string value the widget currently holds
- params: additional parameters (mainly dataset of the related xml)
    + params.possibleValues (all the possible values for the method,
      meaninful for a select or a checkbox)
    + params.defaultValue (the value that the widget would give if it
      even holds no value)

When defining a method in XML, the given value is the default value.
e.g. data-select-style="34px" data-css-property="margin-top"
-> if set on any widget, allows to retrieve a value from the user to
   customize the margin-top, the default value being 34px.
   -> if used with a we-input, allow to retrieve any value and an empty
      value will be equal to 34px
   -> if used on a checkbox, allow to toggle between no value and 34px.
   -> ...

Hopefully, detailed documentation about all of this will follow. Code
documentation should already be helpful.

Last note: the _updateUI method (replacing the old _setActive) is now
async (so does all the functions calling it). In particular, the _select
method is now async.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
qsm-odoo 75ab52af9c [REF] web_editor, *: make options in charge of their rendering
* website, website_sale

Also make the "isTopOption" method a property.

This is done in preparation of better code for coupling sub-widgets used
to retrieve user value (button, input, colorpicker, ...) to actual
change in the edited DOM through snippet options methods.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 14:07:07 +00:00
qsm-odoo 0dd1f4595b [IMP] web_editor: add new way to edit data-* on a target
Now, the editor UI can suggest options the same way as select-class but
for editing a data attribute.

Note: the public widgets are now refreshed on data attribute changes
through the select-data-attribute and set-data-attribute methods.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 14:07:07 +00:00
Adrien Dieudonne 2392454011 [IMP] mail: Unsychronize chat windows between mobile and desktop
Currently when you open, for example, 5 chat windows on the desktop,
each of those windows will be opened on mobile as well.
The big issue with that is that I have to shut down all windows before
starting to work on the application.

To make things simple, you have to explicitly open chat window to
make it appears on mobile. Synchronization is blocked in both direction.
We don't update the chat window state on the server and we no longer
consider notifications (bus) about it.

Tests were added in enterprise.

Task ID: 1891952

closes odoo/odoo#41052

Related: odoo/enterprise#6943
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-11-30 15:33:31 +00:00
Jeremy Kersten 39c7579277 [FIX] ir_http: support redirect pitcure for theme
Missing / wrong indented code during rewrite of binary controller:
https://github.com/odoo/odoo/commit/7d85ab1#diff-1407a8ce197a04eefaefa26c127a4418L343-L348

In case you have:

    <record id="s_cover_default_image" model="theme.ir.attachment">
        <field name="key">website.s_cover_default_image</field>
        <field name="url">/web/image/theme_treehouse.bg_img_15</field>
    </record>

theme_treehouse.bg_img_15 will be not found in /web addons.
So we need a 301 redirect too.

opw-live

How to reproduce:
odoo.com/trial > Website > Install theme Clean
Drop first snippet > background is 404

closes odoo/odoo#40605

X-original-commit: b8ce93e4eb397e1b7a0e1d408d61d2f283223fb9
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-25 09:02:18 +00:00
Jeremy Kersten dc77f67cad [FIX] website: match get/post in is_multilang_url
Old heuristic is not more True:
Force to check method to POST. Odoo uses methods : ['POST'] and ['GET', 'POST']

We have some controller that only allow 'GET' method, so we need to check GET
also when we try to know if an url is multilang or not.

This commit fix case where a controller '/test' only allow GET and you were in
another language that the default, in this case, the rendered url in qweb was
/get instead of /<lang>/get.

Closes #37223

closes odoo/odoo#40519

X-original-commit: c7650106f8588083be12812600a6c94ba703fd6f
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-11-26 14:35:46 +00:00