The method refresh() is a duplicate of method invalidate_cache() and is
deprecated since version 8.0, but without any warning. Add this warning
to be able to completely remove it in the next major version.
Part-of: odoo/odoo#79563
Within portal, subscriptions/sales orders presented in list view have their URL
containing the access_token as a GET param. However, when clicking on a
subscription and using the pager to navigate between records, the access_token
is not present in the URL. In order to keep consistency between the links and
views, this PR adds the access_token as a GET param in the pager as well.
task-2512070
closesodoo/odoo#76673
Related: odoo/upgrade#2752
Related: odoo/enterprise#20357
Signed-off-by: Arnaud Joset <arj@odoo.com>
Steps to follow
- Share a project task
-> The invitation message is duplicated
Cause of the issue
`partners` can be empty
-> `not partners` is then falsy
Solution
Check the default parameter with `is None`
opw-2698724
closesodoo/odoo#80476
X-original-commit: 9514e76e21fe346ea3aee0458ad170b24f09d67e
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
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
Adds multi record support to `_show_report`.
Limited to records within the same company to stay as close as possible
to the default behaviour.
Closes: odoo/odoo#75269
See: odoo/enterprise#20334
Task ID: 2611006
Purpose
=======
Clean up messages related to email verification.
Specification
=============
Rephrase messages, add confirmation of email sent and let user change
email.
Do not show "Validation Email sent" if the current user changed their
email address.
PR: https://github.com/odoo/odoo/pull/77617
Task-2647065
closesodoo/odoo#77617
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment
By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).
There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).
We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.
To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.
This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
(for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
in order to see only one at once
- a floating select input to switch visibility of a particular logical
branching
Task-27033
X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
Before this patch, if you wrote newlines or more than a single whitespace character while sharing any document, in the note, those'd get collapsed in the final email.
@Tecnativa TT31901
closesodoo/odoo#76624
X-original-commit: 6914371e95afff565fa6880f3ff9cf410b357750
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Jairo Llopis <jairo.llopis@tecnativa.com>
This commit will improve the wording and the layout of the invitation
email sent to the users getting access to the portal. The signup link of
the email will now be a button that emphasizes the call-to-action.
We will also provide in the email another link that will allow the user
to access the login page. This commit will also improve the wording of a
placeholder in the portal backend.
task-2573334
closesodoo/odoo#74210
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Generic UX improvements for the portal
SPECIFICATIONS
For projects list view,
- clicking on the project should open the list view of tasks with groupby stage
- the number of tasks should not be clickable
For tasks list view,
- display the fa-star of the priority field on the left of the name of the task
- add the following fields on the right of the name:
user_id, time spent, kanban_state
- for the kanban_state,
only display the colored dot and indicate the name of the state on hover
- for the time spent:
indicate the nb of hours recorded / nb of planned hours(or days(as per unit))
(if the nb of planned hours = 0, only display the nb of hours recorded)
For tasks search view,
- add a group by priority and status and reorder accordingly
- add a quick search on status and priority and reorder accordingly
- add a sort by priority, assigned to and status and reorder accordingly
For task form view,
- display the fa-star icon of the priority field on the left of the name of task
- add the kanban state in the top right corner
the kanban_state field should be editable by portal users
increase nb of items displayed in the list view to 80 items per page(generic)
Task-2613330
closesodoo/odoo#74996
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
Purpose
=======
Purpose of this commit is to add a new group for the mail template designer.
Goal is to make roles clearer: managers edit templates, users use them. This
commit allow some designers / managers to make email template and to let
others users use those email templates.
Specifications
==============
When this feature is enabled in the Settings page, a new group is required to
modify email templates in a composer like wizard or to make dynamic content.
This allows to separate managers editing / composing templates from standard
users that use them.
If the current does not have this group, the email body will be in readonly
mode if he selected an email template. That way we force him to use the email
template that the manager made.
Technical
=========
New Group
---------
Only users in this group will be able to create / write email template or
to write Jinja code in the mail composer (including other fields like subject
in mailing).
By default, all internal users have this group. Mass mailing users also have
this group as writing mailings is about the same management level as writing
templates.
Mail Composer Mixin
-------------------
In comment mode, the template is rendered and then saved on the body field
so non-"Mail Template Editor" users can load email templates.
But in mass mode, the body of the template is saved and then rendered and
many things change the body (HTML sanitizer, web editor move inline CSS
properties, add / remove spaces...). So in this case, we can not know if
the user changed the body or not. That is why we put the body field in
readonly mode so, it is not modified by the web editor.
Jinja code detection
--------------------
To detect dynamic Jinja content, we compile the template, and we browse the
AST. If we do not have a single "Template Data" node, we assume that the
template is dynamic.
When we detect the template as static, we do not render it. That way we
avoid unnecessary rendering.
Code cleaning
-------------
Move Jinja import into tools so that it is outside of mail framework code.
Task-2187263
closesodoo/odoo#75840
Related: odoo/enterprise#20547
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
This reverts commit fc7778f8c512202dc3361d6b87be8c28b299c3c8 because of
a change in the spec.
The access mode are removed and replaced by this access mode for portal
user:
- read: the user goes to the classic portal view
- edit: the user is added as collaborator of the shared project and can
access to project sharing views.
To do this, the portal share is inherited by the project share wizard.
This new wizard can be open to share in readonly and open to share in
edit mode via 2 buttons in the form view of the shared project.
A new stat button is added to form view of project to see the
collaborators of this project. That is, the ones can access to the
project sharing views. The project manager will can remove or also add
new collaborators via the views in this stat button.
task-2379518
closes#73341
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>
As mail grows and will continue to grow, ordering views and having right
files is important to understand module organization and content.
Split main.py controller file into two files, one for mail related controllers
(redirections) and one for discuss.
Rename files according to guidelines for wizards and views.
No functional change comes with this commit. This is only code move.
Task-2631873
PR odoo/odoo#75571
We should avoid autofollow as all recipeints are added as follower. When using
templates this could lead to a lot of unwanted subscription especially in batch
operation like share wizard.
Better subscribe those new people manually.
Task-2612911
PR odoo/odoo#60792
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this commit is to avoid forcing mail_post_autofollow to True when
it is set to False. It eases inheritance and custom behavior.
Task-2612911
PR odoo/odoo#60792
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Define `data-hotkey` on most used action buttons.
For the modals, the following keys are dedicated for "special"
actions:
- Alt+G: add
- Alt+V: save
- Alt+Z: cancel
closesodoo/odoo#73275
Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@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.
This branch adds request.redirect on all requests.
In case of a front end request, we do an url_for to the location.
We removed redirect_with_hash that was only for retro compatibility
local_redirect has been renamed to redirect_query, and param keep_hash has been
removed and moved.
Default code for redirect is 303 now instead of 302.
Now redirect and redirect_query make local redirect by default, you need to
pass local=False to make external redirect.
All werkeug.utils.redirect has been replaced by request.redirect.
Http.redirect now use an http.Response type, and it become easy to add an
override like 'set_cookies' e.g.
Dispatch of a website.page return an http.response too, so we first need to
check if it is a cached version before to check if it is an Odoo Response.
Migrate your code:
http.redirect -> request.redirect(location, code, local)
http.local_redirect -> request.redirect_query(location, query, code, local)
http.redirect_with_hash -> request.redirect
Courtesy of odony for help and review ;)
closesodoo/odoo#72599
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
The company is needed in the context to get the paper format for
instance because of `get_paperformat`
X-original-commit: a1526eb4e5b1eb7cada603d7fcee7bb77c64bbac
Before this commit there were few cases in which
is_html_empty method was not working as our expectation.
In cases such as "<p class=""><br/></p>", "<p id=""><br/></p>"
and many other cases.
In this commit we improves regex of is_html_empty method.
Mow from this commit all kind of attributes will be consider
in this method.
In this commit we also have added is_html_empty in mail template, portal
values and in report values also for rendering templates.
Task id: 2499504
X-original-commit: fd0a05f2955b9f7e9ae7233afebfd6240c9244dd
The profiling tools can be useful to profile a test of some execution
point but this is not convenient to identify a problem on a running
instance.
With this commit, an option available in the debug menu allows to add a
flag on the user sessions to enable profiling of all requests. Each
request will be saved in a different 'ir.profile' entry, but will be
grouped under the same session.
The profiling can be activated on all sessions, even for a public user,
but only if profiling is enabled on the database globally.
This commits also adds a speedscope view to visualize saved results in
the web client.
closesodoo/odoo#66590
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
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>
Slightly improve the overall UI of Odoo with a more modern feel by updating the
current 'loading' icons that look quite old school.
Use fa-circle-o-notch instead of old style fa-spinner
task-2346142
closesodoo/odoo#59454
Related: odoo/enterprise#13908
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Bug
===
1. Login as Demo user (no admin access right)
2. Grant the portal access to a partner
3. Revoke the access
An access error is raised.
Task 2501250
closesodoo/odoo#70554
X-original-commit: bc7f8733561992e3b240f34c0cbd17a0cb76d3cd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
* QWeb bodies should be markup-safe so `0` should always be
markup-safe.
* `head` is qweb-rendered so the same.
* The `json` pseudo-module in qweb templates is `json.scriptsafe`,
which should be markup-safe.
Mail holds a "Pay Now" notification template holding notably customized
links to portal for records like sale orders or invoices. It allow to
give a more personalized button than a plain simple "View document" link.
Currently frontend / backend links are not always correctly computed in this
template. This commit fixes that behavior.
Task ID-2513724
COM PR #69607
ENT PR odoo/enterprise#17849closesodoo/odoo#69714closesodoo/odoo#69744closesodoo/odoo#69774
X-original-commit: c417ea6243cb968d17f5db0919ec8cd034f4cb5f
Related: odoo/enterprise#17889
Related: odoo/enterprise#17902
Related: odoo/enterprise#17916
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this commit is to fix computation of access link. In some cases
msg_vals modification leads to invalid URL computation, notably for frontend
or backend differentiation for target recipients.
Followup of odoo/odoo#63292 .
Task ID-2513724
COM PR odoo/odoo#69607
ENT PR odoo/enterprise#17849
X-original-commit: e618597876692f2d24f8e9308c747b8d1f2d8905
In a migrated db without this fix, you have twice "Grant portal access"
in partner form view, one will fill the partner in the wizard, the other
will launch the wizard without any pre-selected partner.
closesodoo/odoo#69586
X-original-commit: 6c321814dac1f17fa9a1f3f1b6d59c6d45a8cc0d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Issue
- Install "Sale" app
- Acivate "Discounts" feature in settings
- Create a quotation to a portal user (ex: Joel Willis)
- Add a product with a discount then send
- Logout then login as 'Joel Willis'
- Go to 'My account' then 'Quotations'
- Select the quotation just created and print it
Discount not display in pdf file.
Cause
The current env.user when rendering pdf is the portal user.
To display discount, current env.user must have group
'product.group_discount_per_so_line' who is not the case
even when using sudo() on report template.
Solution
Since Odoo 13.0, the sudo() function does not return the
superuser by default but instead the current user
with a bypass on access rights.
Therefore, must add `.with_user(SUPERUSER_ID)` on report.
opw-2501337
closesodoo/odoo#69272
X-original-commit: 5dde19c92ecee8ac0238bb5c8e71263840534c28
Signed-off-by: bon-odoo <nboulif@users.noreply.github.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
Conversion of all modules to the new manifest assets declaration.
Part of task: 2352566
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
This commit removes a needless priority attribute on a portal template.
This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.
Part of task: 2352566
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
Steps:
- Install Projects
- Go to Settings / Translations / Languages
- Install Dutch
- Go to Settings / Users & Companies / Users
- Edit demo:
- Language: Dutch
- Go to Projects
- Click the three dots on the first project in the dashboard
- Click Share
- Select demo as recipient
- Send
- Go to Settings / Technical / Email / Emails
- Click the email you just sent
Bug:
The email is not translated in the partner's language
Explanation:
The context of the template didn't take the current partner's language
into account since it was out of the partners loop.
The subject of the email wasn't aware of the partner's language as the
context hadn't been changed.
Wrapping the translations with the right `lang` context value fixes the
issue.
Also, the subject used the formatted string as the translation source.
This makes it impossible to find a matching translation since the source
is different every time.
opw:2475398
closesodoo/odoo#68162
X-original-commit: e446233a1b454ab1aa883609fd0b8a588fec9f00
Signed-off-by: backspac <backspac@users.noreply.github.com>