Before this commit, we use the defaultOptions and the options passed in
parameter of the `_setOptions` method, but we could have any unupdated
options in the `this.options`.
This commit creates a new object with the defaultOptions and the options
containing in `this.options` before update this object with `options`
given in parameter to have the new `this.options`.
task-2633229
closes#77156
X-original-commit: 5d1a36bdd530d4037d4f29dc607907d79d18dcc6
Purpose
=======
Review the UX of the 2-factor authentication flow in order to make it more clear
and easy to use.
Specifications
==============
This commit applies multiple rewording of instructions, button, etc. Tests have
been adapted accordingly.
It also adds an 'invite to use two-factor authentication' flow that will
send an email to the selected used to redirect them their account security
settings.
- If portal is not installed yet, the user is redirected to his account security
settings in backend.
- If portal is installed, the user is redirected to /my/profile if them are
portal user. Otherwise, the redirection is still done at backend side.
As the backend view of auth_totp wizard is used at frontend side, copyclipboard
widget has to be rebuilt at frontend side (click event, style etc..).
As API key section is now displayed only on debug mode, test urls have been
adapted accordingly.
Task-2487630
Part-of: odoo/odoo#71142
Before this commit, when the user changes the task, the chatter is not
updated so we keep the messages of the previous task. Same thing when
the portal user wants to create a new task.
This commit updates the chatter to allow to fetch the messages when the
user changes the task and also disables the chatter when the user is
creating a new task.
task-2379518
closes#73341
Before this commit, if the portal user is a follower of the project he
can use the chatter of new tasks in the project sharing feature since
the follower of the project is automatically the follower of new tasks.
But if he is not a follower of the task (for instance, old task in the
project) then we have to check if the
access token is the one of the shared project to give the access to
the chatter.
This commit checks the `access_token` of the project when we are in the
project sharing form view to allow the portal user to use the chatter.
task-2379518
closes#73341
Co-authored: Yannick Tivisse (yti) <yti@odoo.com>
Replace t-raw by t-out when outputting the chatter message.
Mark message body as safe during preprocessing: messages from the
portal chatter are automatically escaped when
posted (`/mail/chatter_post` assumes the message body is plaintext,
and escapes it before formatting it based on newlines, maybe one day
it'll accept markdown) while messages from the backend chatter are
"HTML-light" and should be sanitized.
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.
Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient
Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.
closesodoo/odoo#69819
Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The container size of a text block snippet (and every snippet without
rows) was not correct when an image was displayed with right or left
alignment.
The css property clear was added at the end of the containers so that
floating elements from the section do not float over the next section.
task-2469516
closesodoo/odoo#71438
X-original-commit: fb556ed09c7ed00afbed33b6029b1315a113575a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, for default colors, the text-muted class color was
set as !important from the portal and could not be overriden by the
website, leading to inconsistent display between the website and the
portal for the copyright.
As a fix for stable, we do not change the text-muted color from the
portal when using default colors.
task-2468472
closesodoo/odoo#71300
X-original-commit: d2e934631d4de02a7933434a1252dab994fed4b7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: portal, portal_rating, product, sale, sale_product_configurator,
website, website_sale_comparison, website_sale_product_configurator,
website_sale_stock, website_sale_wishlist, point_of_sale
Redesign of the product page + various UX improvements.
task-2009483
Part of #66736
Steps:
- Install Invoicing and load French
- Go to Invoicing
- Click an invoice due in the future
- Click Preview
- Switch the preview to French by modifying the URL like this: example.com/my/invoices/6 -> example.com/fr_FR/my/invoices/6
Bug:
"Due in %d days" is still displayed in English. The rest of the page is in French.
Explanation:
This is due to two things:
1. `mail` and `portal` are both installed and we cannot have more than one `code` translation of a source [1]. Since `mail` is loaded before, alphabetically, `portal` doesn't add the duplicated translations with its own module name. When loading a web page, only the modules returned by `_get_translation_frontend_modules_domain()` are sent to the frontend. `mail` is not one of them and the duplicated translations are not sent. Since sending all the `mail` translations is overkill, this commit is modifying the format string. This won't change the text outcome, but will make the new sources unique and make the backend send these translations to the frontend.
2. Translations in `portal_sidebar.js` are queried before the translation DB [2] is made. This results in an empty array and `_t()` returns the source. `session.is_bound` will wait until the app is fully loaded before querying.
[1] https://github.com/odoo/odoo/blob/ad2d96db8ad3e1fd7af2edda218fc34c0c1d259a/odoo/addons/base/models/ir_translation.py#L290
[2] https://github.com/odoo/odoo/blob/0de069b8ca9fb005ba5b076984f5677de25889ee/addons/web/static/src/js/core/translation.js#L51
opw:2421501
closesodoo/odoo#64263
X-original-commit: 118d79192cf0fc923a121745c78e6dd0da563df0
Signed-off-by: backspac <backspac@users.noreply.github.com>
1) in this commit, improved portal chatter for messaging. when the user sends a
message, the new message is updated in history without reloading page.
instead of submitting a form which reloads page to send message we added rpc call
to send message.
2) rating on courses is implemented by extending portal chatter, applied changes in
website_slides to do reviews without reloading page
3) refactoring: cleaned or removed code
eg. removed form and some input fields as data is not submitted as form anymore,
introduced some methods to avoid duplication of code
task-2054662
Closes https://github.com/odoo/odoo/pull/47746closesodoo/odoo#47746
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Co-authored-by: ktr-odoo <ktr@odoo.com>
Co-authored-by: Siddarth Gajjar <sga@odoo.com>
Before this commit selecting the same attachment was not detected, which
was a problem when the attachment had been mistakenly removed
After this commit when the same attachment is selected several times in
a row it still triggers the upload and gets attached
https://github.com/odoo/odoo/issues/42364closesodoo/odoo#62278
X-original-commit: e9b1bca1d48afff8313d106266b02793cf77ab79
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Currently, when attachment small icon was displayed on portal it
is broken and repeated on background more than once like: task
attachment icon.
So in this commit do not repeat the icon when icon is small on portal
attachment.
closesodoo/odoo#61907
Taskid: 2337684
X-original-commit: 24304608d2eee0ca136ac024b18e19d0d8d0e12f
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit align vertically the copyright text and the inline
language switcher items. This commit also add a padding on
list-inline-item in the language selector. Because before this commit,
there was no space between lines if the list was to be displayed on
multiple lines.
Part of #59581
task-2312878
closesodoo/odoo#60527
X-original-commit: a8c4ca8a942d94557db5b95f42344fee71faf6e2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Some of the TOTP-related forms contained an attempt at making a centered
modal pop-up, using a bootstrap `card` that would also serve to
emphasize that the interaction was sensitive and security-related.
Some of the "footer buttons" were moved inside the form to make it
more obvious that they were part of the interaction flow.
However some of this caused breakages of responsiveness and did not yield
a really satisfactory result anyway.
This commit switches back to using regular non-centered forms. It looks
quite ugly because the content is better suited for a narrow modal, but
it means less surprises in terms of layout and less responsiveness
issues.
closesodoo/odoo#58541closesodoo/odoo#58544
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
*: web, web_editor, portal, account, website_blog, website_forum
This is probably not ideal to move the scrolling behavior out of the
html element but this will be needed for the editor to not have a double
scrollbar on the right. This is actually also useful for the scrollbar
to appear under the purple odoo menu instead of its right.
This commit, if to be reverted in the future, however contains many
improvements to make the transition easier that should be kept: jQuery
and Odoo functions to be able to scrollTo a specific element, get the
top scrollable element, check if an element is scrollable, etc. Also,
some magic was done: if some code tries to scroll to a specific scroll
position via jQuery's scrollTop or animate functions on the html/body
element, those will still work as intended (obviously, using the new
utils to do that is however recommended).
This commit also reviews our scroll behaviors to make them more robust
and share the code.
Part of https://github.com/odoo/odoo/pull/57975
task-2344227
X-original-commit: 4e7be69825163c0a0ff41c882a196fc7f3158fb3
There's absolutely no need to load it on every page of the website. It
probably doesn't even need to be cached on the JS side given it's used
in all of 3 actions of the portal user's security page.
Reported by jke.
Also remove leftover console.log call while at it.
closesodoo/odoo#57636
X-original-commit: 00c1c9a7258cf53f1a40938e3a928151b188de64
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Before this commit, the time to compute all counters was making the rendering
of the portal page slow.
Now the count is done in rpc after the loading of the page.
Now you can decide which part you want to show on the portal, and only compute
for these one.
It is not because you have purchase installed for your internal process, that
it means that your supplier use your portal and it avoid the computation for
all end users.
We parallelize the counters in arbitrary 3 rpcs.
closesodoo/odoo#55999
Related: odoo/enterprise#12456
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
* allows portal users to update their password
* and manage their API keys
* any anything technical / security related we may need to add in the
future
Also bridge module for the password meter (auth password policy).
Values filled in "Assigned To" m2o were differing:
- if I "CREATE" task with "group by" then m2o is filled with
internal-users + portal-users
- if I "CREATE: task without group by then it filled with internal
users only.
In Project also same case.
To have a more coherent behaviour, we decided to put only internal
users in both cases.
Task ID #2229592
Community PR #54776closesodoo/odoo#55820
X-original-commit: 8269c1958843002246c589cdd593417dec44f024
Related: odoo/enterprise#12376
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
On a chatter portal, when the user is using access token to display
record and is not connected, the message will be posted as the record
partner_id.
But then the preview of avatar in the composer is wrong: you see a
broken image (because you don't have access to "public user" partner
avatar) and when you post it anyway you see the avatar of the record
partner and not public user.
In this commit, if we are seeing the record with token and are logged
out as public user, we will not show the avatar in composer.
(note: before 13.0, the "public user" partner avatar was working)
opw-2276498
closes#54720closesodoo/odoo#54782
X-original-commit: 97473f6a25336e8994730e7722cffb6fd0dbc6d7
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
*odoo_referral,portal
Currently, it is not possible to have one line notification,
when you are not passing the title parameter as an option when
generating the notification,then it will display the blank div
with the default button icon only. so it is not possible to have
one-line notifications since the title is mandatory.
So the purpose of the task is to make the title optional, allowing
for more minimalistic notification.
Also removed some unnecessary titles from the notification and
some stying change.
This commit also increase the autoclose delay of non sticky
notifications, from 2.5s to 4s.
task : 2264749
closesodoo/odoo#52229
Related: odoo/enterprise#10981
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Dhruv Patel <dhp@odoo.com>
In this commit- we have improved responsiveness of description when it's too long
in projects and tasks inside the portal.
task-2124829
Closes#48402
Related: odoo/enterprise#9497
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
*: portal
Adding a choice of several header behaviors (fixed, fade out with
scroll, etc.). Review the way those animations works in mobile/desktop
and now perform them without duplicating the header DOM element.
Also allow to hide of adapt the size of the logo when the page is
scrolled.
Part of https://github.com/odoo/odoo/pull/38950
task-2087641
Co-authored-by: qsm-odoo <qsm@odoo.com>
Reduce margin from o_portal_chatter_message_title (from 0.5 to 0.2rem)
Remove margin from the last line of the comment.
When you write a comment (not from demo data), each line become a paragraph
(which one have big bottom margin). After the comment you have a button
'comment' that is so far, that you don't know if you comment the previous
message, or the next one.
The css selector is precise, because you can have another p in the reply with
the class 'o_portal_chatter_puslished_date' that we don't want to impact.
(In case of none real comment with p inside, it become the last one)
Only the padding under the last p could be considered (fp & sbu) as bugged,
so we fixes it in css. Other pixel touch, required an update to got it.
task-2206171
closesodoo/odoo#46456
X-original-commit: 92ae84c132f3fb2dcf5364fd0e0e58edb04e894d
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Steps to reproduce:
- install sales
- install a language with rtl support
- set the installed language as preffered language for current user
- preview any sale order/quotation on the portal
Previous behavior:
the portal is not showed right to left
Current behavior:
rtl is working a intended
opw-2167151
closesodoo/odoo#43737
X-original-commit: 2855ac7a5b859e76bde39da2f584aed3ff7ec163
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit moves the flex rules of #wrapwrap div to web so it can be used in
survey.
This is needed to make the survey footer stick to the bottom of the screen
even if main has not enough content to fill the page.
This commit prepares survey redesign.
Task ID: '2150291'
PR #43237
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
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
Reproduce this bug
- Log in as portal user
The top right address detail is over the icon.
Cause
The others fields are using a `span` who have a style who push them
right.
This commits add the `span` style for the div.
Fine-tuning of 9e302765
OPW-2092345
closesodoo/odoo#40225
X-original-commit: af0fd50b14f32032f0870812dd615ac988183174
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
There are too many image sizes. Since they are stored resized this takes time to
generate when saving a new image, it's more rows on the attachment table, more
files on the disk, ...
64px is close enough to 128px that it can be removed without a big impact on
download size.
It will even reduce download and number of requests when both images are
displayed because now only one has to be downloaded and then benefit from cache.
The difference between the two is typically around 1.5kB which is negligible
these days, especially when the request overhead is around 0.5kB already, not
even taking into account other factors such as latency.
If a 64px image must absolutely be returned, it is still possible to pass the
size parameters to the image route. But the current guideline is to handle
resizing in the views when necessary.
Views
=====
- remove width and height attributes when existing CSS rules are overriding them
(eg. `.oe_kanban_avatar` in the right context)
- add CSS rules instead of width and height attributes when possible
- use `object-fit: cover;` where width and height are forced to avoid distortion
of non-square images
- for products, use `object-fit: contain;` instead, keep ratio but without crop
- add new CSS rules where the expected size was max 64px*64px before due to the
image size itself
- remove `img-fluid` where using size classes to avoid conflicting rules
task-2060865
closesodoo/odoo#36147
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
PURPOSE
Allow to manage attachments when updating a frontend review.
SPECIFICATIONS
Currently when posting a review in eLearning or eCommerce one can attach
files to its review thanks for portal composer. Rating popup composer allow
to update its comment and rating. However this edit mode has two limitations.
It does not display attachments previously added and does not allow to add
attachments.
This commit fixes that by
* giving attachment values to the composer, allowing its display by the
composer display at startup;
* allowing to give new attachments and properly handle them in slides
route;
Uploaded and validated attachments cannot be removed by users. Indeed
message with attachments has probably already be sent to people and removing
attachments would lead to information loss.
LINKS
Task 2066600 (manage attachments)
Task 2058595 (eLearning v13 testing)
PURPOSE
Allow to manage attachments when updating a frontend review.
SPECIFICATIONS
Popup composer used notably in website_rating (eLearning, eCommerce) is not
instantiated inside a frontend chatter. It does not get all available CSS rules
as those are all set inside o_portal_chatter.
In this commit we move some CSS rules to allow using them in composer or chatter
independently of how they are instantiated.
LINKS
Task 2066600 (manage attachments)
Task 2058595 (eLearning v13 testing)
PURPOSE
Allow to manage attachments when updating a frontend review.
SPECIFICATIONS
As those widgets grow it is better to have them in separate files in order to
better understand code organization. Future commits will improve composer
behavior, notably in attachments management.
LINKS
Task 2066600 (manage attachments)
Task 2058595 (eLearning v13 testing)