Before the commit:
A traceback was generated when clicking on 'View all' tags.
Reason:
Issue from PR:- https://github.com/odoo/odoo/pull/129123. In the search box
template, the action value for 'View all' tags was incorrectly formatted,
't-valuef' was used with python expression instead of 't-value' resulting in an
erroneous URI path and causing errors.
After the commit:
The traceback has been resolved by using correct string formatting ensuring the
correct generation of the string.
Task-3525236
closesodoo/odoo#137984
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Fixes a large number of cases where strings are translated then
formatted, instead of letting `_()` do the formatting internally,
which allows it to recover from incorrect translations (missing,
broken, or extra placeholders).
Also
- removes translation markers entirely when there's nothing to
translate e.g. `_("%s - %s")` is not useful
- fixes a few messes which lead to only partial translatability
(DRY is generally a bad idea when translations are involved, even
more so when you don't make the variable part translatable)
- fixes a few nearby issues noticed at the same time
- replaces a few `"%s"` by `%r`, which should automatically quote
strings relatively appropriately
- fixes translated strings which use `\` to escape a newline (in order
to fill-paragraph): `\` escapes only the newline, if the
continuation string is indented this results in a bunch of spaces
ending in the string to translate, which is pretty garbage for the
translator, using implicit concatenation works much better
Note: some of the updates revert f-string parameters to %, because
babel (2.9) apparently has trouble with f-strings and blows up trying
to extract them.
Not in scope:
Helping translators fix translatable strings e.g. any translation
string with more than one placeholder probably should use keyword
placeholders
- Provides more context / data to the translator to make sense of the
sentence.
- Allows reordering the translated terms, which can be necessary
depending on the sentence and language.
closesodoo/odoo#139314
Related: odoo/enterprise#49311
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Significantly improves the usability and the result of the populate for
base models and channel/member/message.
- make populate of base models re-entrant
- adapt size to values that make sense:
- small shows something relevant, and can be quickly ran several times
- medium is fast enough to be usuable but big enough to highlight
performance issues
- large is... still not to be attempted
- avoid conflicting conditions that either make no sense or can lead to
crashes when populating the data or running the database
- better spread of data in channel/member/messages
closesodoo/odoo#139269
X-original-commit: 73a5e322f6e250569ee1942d678f8a4f87616bd7
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
The new method should be used to generate an SQL object that represents
how to order by a field in an SQL query. We introduced the auxiliary
method _order_field_to_sql() so that one can specify some SQL for
ordering by a given field with a simple method override.
Part-of: odoo/odoo#138019
*: website_event, website_forum, website_livechat, website_mass_mailing,
website_slides
This commit permits to reduce the risk to have a wrong h1 tag or
multiple h1 tags on the same page. This commit replaces some h1 tags
with a h2 in snippets. In addition, this commit removes some font sizes
written in the style attribute and replaces them with a font size class
now that they are possible to use and edit as an user.
task-1958098
Part-of: odoo/odoo#129791
Co-authored-by: qsm-odoo <qsm@odoo.com>
* website_slides_forum
Populate a database with different quantities of forums, posts
and comments.The number of replies per question and comments per post
(question or reply) are defined by weights.
We use SQL queries in the '_populate' method to update certain fields
automatically managed by the ORM, as well as the 'last_activity_date' of
posts (questions).
The aim is to give posts, replies and comments varied and consistent
create_dates, as well as a wide variety of authors (create_uid).
Task-3349374
Task-3463533
closesodoo/odoo#132042
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
The aim of this commit is to improve the impact and rendering of app
icons in bright and dark mode. It also reduces the size of svg files.
To achieve that, this commit updates the colors to flat colors. This
change will make the icons stand out and improve their readability.
task-3072562
X-original-commit: 667a19162b74fb6554a2389ba9c6e69de4ff5113
Part-of: odoo/odoo#138279
1. The "unsolved", "unanswered", "answered" were not translatable.
In another language, we would have "unsolved" appear in the middle
of the "sentence"
2. The sentences were chunked. Like "There are no" and "results".
This works in English, but in another language, maybe one needs
to translate this differently from "there are no" + "unsolved" + "results'.
If the grammar of that language is "There are no" + "results" + "unsolved"
translating each chunk directly and keeping them at the same place won't
be grammatically correct, if only it makes sense.
This will also have the beneficial side effect of making them more extensible.
Additionally, fix a typo.
task-3546506
closesodoo/odoo#138461
X-original-commit: 8eae73d806aec2f3b93c576ad4573b4d74510f2a
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
Steps:
- Open Helpdesk
- Enable the 'forum' feature on a helpdesk team
- Open the help webpage
- Search for something
- Traceback appears
Issue:
- When we search for something, we get a traceback instead of search results.
Cause:
- In the template, we do not get the value of create_uid.id as we are trying to
compute it from post_id.
Fix:
- Instead of computing the value from post_id, we need to compute it from post
hence we will obtain the values by writing post.create_uid.id
closesodoo/odoo#138086
Task: 3461563
X-original-commit: 068d81d4466e2293153f1f7c71e32ee7e3ad33c0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Some strings were not translated in website_forum because translation marks
inside backticks will not be extracted to be translated.
i.e., Markup`${_t("Please translate me"}, OK` will not work.
This commit fixes the issue by explicit translation before putting it inside the
backticks.
Task-3462273
closesodoo/odoo#137857
X-original-commit: 5f33cdb8120661dad58eae9be1d6a511dc712bbd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The cookie service was replaced by a utils file in core. This was done
to be able to use the cookies without the need of environment.
"Om Nom Nom Nom" - Cookie Monster
part-of task-id 3439226
closesodoo/odoo#136782
Related: odoo/enterprise#48005
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*: website_forum, website_slides
Purpose
=======
Website profiles of users like Mitchell Admin, which are set as "public",
are also rendered as "Private". In Fact, users can be denied access to
the public profile of other users for different reasons. In such
situations, users should get a more accurate feedback on the reason of
the access denial.
Specifications
==============
On profile access denial, give users a more accurate reason:
- "This profile is private!" when the profile is indeed private
or the karma of the user profile is equal to 0.
-"Not have enough karma to view other users' profile." when the profile
is public but the requesting user has insufficient karma rights.
Also:
- Redirect to the 404 page users trying to access a non-existing
profile.
Note: the minimum level of karma required to access a public profile is
now editable. See odoo/odoo#123411
Task-3360050
closesodoo/odoo#128686
Related: odoo/upgrade#4955
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
This commit removes the files ajax.js and rpc.js then adapts all the
places where their exports were used. For most of the changes, it's a
replace of `this._rpc({...})` by a new `useService("rpc|orm")` like
pattern in the widgets.
closesodoo/odoo#136271
Task: 3439226
Related: odoo/enterprise#47775
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
In this viewtiverse, the heroes remove the context dependencies for
`get_views`, from the views and python fields (such as domain). To reduce
inconsistencies and the number of rpc.
Current issues:
* There may be inconsistencies in views at the JavaScript level. Some
overrides modify the behavior of get_views or domains on fields via
context keys, therefore by changing the action, the rendering may be
different. However, these views are cached. However, the cache key
(Javascript) does not reflect the entire context, and requires additional
post-processing from the server.
* Multiple rpc for the same rendering. get_views being dependent on the
context, as soon as it changes, a new rpc is performed. In most cases,
when JavaScript needs the same view, there is no change depending on the
context, the rpc is useless.
* Inconsistency when rendering subviews, some views could be different
depending on the context, this context can be modified in the view itself
via the context attributes. However, the JavaScript client does not redo
an rpc for each change of these sub-contexts. Therefore the result may be
inconsistent.
Solution:
Limit as much as possible the number of context keys provided when calling
get_views, and use the context provided as a cache key. The authorized
keys are 'lang' and '*_view_ref'. For the cache key, options are added in
the get_views method.
Instead of using the context, it is inserted into python expressions.
This will be evaluated by JavaScript and thus avoids inconsistencies.
task-3414108
task-3414068
closesodoo/odoo#135145
Related: odoo/enterprise#47584
Signed-off-by: Raphael Collet <rco@odoo.com>
Links of the current website forums belonging to the user are now displayed in
the sidebar. A forum is considered to "belongs" to a user if either he has
posted a message on it or he has added one of the post in his favourites.
Technical note: we add the value "my_other_forums" in _prepare_user_values
method to display the other user forums of the website in the side menu on
various pages. That value is only added when the "forum" value is a forum
indicating that the page is currently displaying one of the forum (we use
the test "forum and forum is not True" because forum parameter can take the
value True, None or a recordset). We use a lazy value so that the query to
select the forum is only executed in the page that uses it.
Task-3354382
closesodoo/odoo#130469
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Before Commit:
Currently, when a user marks their answer as the best answer in the forum, an
error notification appears with the message 'Sorry, you cannot vote for your own
posts' However, this error message lacks clarity and does not clarify
the underlying issue.
After Commit:
Now the error message is modified to 'Sorry,
you cannot select your own posts as the best answer'
Task-3481264
closesodoo/odoo#135193
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
*= forum, profile, slides, slides_survey
Purpose
=======
Give users a better experience when browsing website profiles
looking for courses, certifications, forum questions, ...
Specifications
=============
Add search bars for Questions, Answers and Upvotes, small UI changes
here and there.
Task-2676848
Based on #79372
Co-authored by: Fabio Barbero <faba@odoo.com>
Part-of: odoo/odoo#129123
Purpose
=======
Make it possible for users to have an overview and search in all forums.
This includes searching for posts of other users, much like /slides/all.
Specifications
=============
- add routes for `/forum/all`
- change templates in `website_forum` to show posts even if `forum` is
not specified to shows results and search in all forums
Task-2676848
Based on #79372
Co-authored by: Fabio Barbero <faba@odoo.com>
Part-of: odoo/odoo#129123
*: base, crm, digest, mail, mass_mailing, sms, test_base_automation,
website_forum, website_sale
This commit makes "Automated Actions" more discoverable and usable by:
- Adding a menu in the kanban header config dropdown to add/edit them.
- Creating a new custom kanban view for a clear understanding of each
automated action record and its associated actions.
- Introducing new "smart" triggers that appear in the form view based on the
chosen model:
- Updated Values category:
- "Stage is set to" when a `stage_id` field exists in the model,
allowing users to select a specific stage value.
- "State is set to" when a `state` field exists in the model,
allowing users to select a specific state value.
- "Priority is set to" (`priority`) where users can select a specific priority.
- "User is set" (`user_id`, `user_ids` fields)
- "Tag is added" (`tag_ids` field) where users can select a specific tag.
- "On Archive"
- "On Unarchive"
- Timing Conditions:
- "After creation"
- "After last update"
- Deprecating previously known triggers "On Creation" (`on_create`) and "On
Update" (`on_write`) to simplify the user experience. "On Creation & Update"
(`on_create_or_write`) is retained and renamed to "On save".
- Changing the `ir.actions.server` Many2one relationship to a One2many
relationship. Automated actions can now directly contain multiple actions,
eliminating the need for an "Execute several actions" action in automation
rules.
- Introducing a widget for the new `ir.actions.server` One2many field for a
clearer understanding of multiple actions.
This commit also enhances the usability of "Server Actions" (`ir.actions`) by:
- Removing the `ir.server.object.lines` model and the associated `fields_lines`
One2Many field. The attributes of the removed model are now merged into
`ir.actions`. An action can now write to only one field, and the create action
is now a name_create action.
- Adapting the form view when creating an "Update the record" action. The value
field shown adapts itself based on the field to update; this field can be a
`reference` field for a `one2many` `update_field_id`, a `one2many` field for a
selection `update_field_id`, or a `text` field otherwise.
- Refactoring the form view to display only relevant details and other
miscellaneous improvements.
Taskid: 3085360
Part-of: odoo/odoo#114352
Co-authored-by: Florent Dardenne <dafl@odoo.com>
Co-authored-by: Julien Carion <juca@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
When we haven't provided a custom action, the tour step runs the default
action. In the final step of the tour, when there is no `run` or
`isCheck` provided, It shows warnings of 'ignoring action (auto) of last
step' as it can lead to a race condition.
This commit resolves the warnings: `ignoring action (auto) of last step`
task-3429500
closesodoo/odoo#129239
Related: odoo/enterprise#46683
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
This commit removes the legacy session and adapts the modules where it
was used.
task 3439226
closesodoo/odoo#133153
Related: odoo/enterprise#46290
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
*: auth_password_policy, bus, event, im_livechat, mail, mass_mailing,
mrp_subcontracting, point_of_sale, pos_self_order, project, stock,
survey, web, web_editor, web_tour, website, website_event,
website_forum, website_sale, website_slides, base
Historically, the web.assets_common bundle was used to contain assets
that were needed by both the frontend and the backend. In practice, this
caused a bunch of issues where people would add things in assets common
that were not needed by both, and it was also abused as a way to get
bootstrap working in unrelated places by only using that bundle's css.
Because of this, as a first step, the assets_common stop being used in
the frontend, but was left everywhere else.
This commit removes the bundle completely, and moves the files that used
to be in that bundle in the other bundles that need them, this will
allow those bundles to evolve independently going forward.
in im_livechat and mail, some of the unneeded legacy code was removed, this
allows us to avoind including all of the legacy code from web in the
livechat embed bundle and in the dicuss public bundle respectively.
closesodoo/odoo#132190
Related: odoo/enterprise#45884
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
before this commit, on clicking button in the forum main
page the url is not updated correctly with the dynamic
variable, as href is used instead of t-attf-href
* open form
* click meet our community members link
* see the url
after this commit, on redirection url will be properly
updated.
closesodoo/odoo#132536
X-original-commit: 944b47346d3d5452a57bbe1ed6a666b17dfcbdc1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- Improve last activity column
Allow the columns to resize to fit the date line without wrapping
and set the actual date to the title to appear on hover.
- Header fixes
To avoid the searchbar shrinking too much when there are multiple
elements in the header (long title, tag or search filter, ...), we've
set a `min-width` to it , and the `max-width` has been moved
from the second section of the header to the searchbar instead.
The alignment of the title and the rest of the bar is now aligned on the
breadcrumb's baseline instead of vertically centered.
- Fix dropdown title disappearing on selecting a tag
The dropdown's title disappeared when a tag was selected as a filter.
- Height of container and aside
We've removed the `h-100` on the aside to place it on the parent under
the condition that the `forum_welcome_message` has been dismissed.
Because `<main>` has a `flex-grow` is applied to it,
the `#wrap` has a gap under the content where it doesn't meet the full
height of the main.
This blank space is made visible by the grey background of the aside.
This could be solved by a simple `h-100` on the wrap, but it overflows
onto the footer when the `forum_welcome_message` displayed.
- Add missing pages names
Some titles weren't appearing in the breadcrumb due to misplacement of
the `_page_name` t-set or absence of it.
- Switch static image for animation
The empty moderation pages now have an animated svg instead of a static
one. Fun.
- Hide filter tool on empty mod pages
The moderation pages don't need the filter tool to appear when there
are no results.
- Switch conditionals `and/or` to `if`
Although it works, in python we don't use `X and A or B`
but `A if X else B`
- Other visual fixes
In JS : put back removed classes on voteCount element
Tags: fix the overflowing text when tag is long and switch position with
icon for more readability
Remove useless `not inDropdown` condition on form
Fix inverted plural/singular of `Views`
Other minor alignment fixes
task-3083657
part of task-3316555
closesodoo/odoo#132226
X-original-commit: c2ed6257f8a2fe74a7f4fa2977b44aac1c0bb0c5
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
before this commit, if the user profile is opened
from a particular forum, the votes tab is displaying
the votes from all the forums for this user.
where us, the questions and answers tab is filtering
the data based on the selected forum.
after this commit, the data displayed in the votes
tab will also be filtered based on selected forum,
similar to questions and answers tab.
closesodoo/odoo#131487
X-original-commit: ae33d2e3832cc2ce5597a6727fd44c9d745d36c5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The goal of this commit is to convert a bunch of legacy dialogs into owl dialogs.
closesodoo/odoo#131278
Task-id: 3453920
Related: odoo/enterprise#45484
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit removes the qweb.render method, instead it will use the owl
render engine (renderToString or renderToElement).
Part of task~3443861
Part-of: odoo/odoo#130467
As all the templates are now imported in the owl app, the templates must
comply to owl.
t-key is mandatory when using a t-foreach
Part of task~3443861
Part-of: odoo/odoo#130467
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.
closesodoo/odoo#123932
Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
before this commit, in the forum post form view, the
closing related fields, is visible even if the post
is not closed and question field should not be shown
in the parent post.
after this commit, closing fields will be shown only
once post is closed and parent_id and is_correct
field will be shown only in child post(answer)
closesodoo/odoo#129299
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
before this commit, in the forum validation queue filter,
along with the text filter instead of icon some hard coded
value(圾) is shown as text.
* create a user with very minimum XP
* create a post from new user login
* from admin login, click validation queue in the
forum
* click on filter in the validation queue
after this commit, the text will be replaced with fa-font
icon, so that all filters will look similar.
closesodoo/odoo#123636
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
before this commit, on deleting a question from
forum is redirecting to the same question
page with deleted tag.
after this commit, user will be redirected to
forum home page after deleting a question
closesodoo/odoo#118686
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
In this commit, _t import from import { _t } from
"@web/legacy/js/services/core" and from
web/static/src/legacy/js/core/translation.js are replaced by
@web/core/l10n/translation.js.
task-3292454
closesodoo/odoo#130865
Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
This commit removes legacy patch/unpatch functions and adapts their use
by using the modern patch. There was also a custom patch function used
in tests which has been replaced too.
closesodoo/odoo#130867
Related: odoo/design-themes#685
Related: odoo/enterprise#45271
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
How to reproduce the bug:
------------------------
- Create a new user
- Log in as that user
- Go to a forum that don't require karma to ask a question.
- Create a new post
- On validation, you'll end up on a 404 page.
If we use the portal user instead, we see the post with a banner explaining
it has to be validated. This should be the result here too.
Specifications:
--------------
- When new users (karma = 0) create a post, redirect them to the page
relating to their question.
task-3372016
closesodoo/odoo#130857
X-original-commit: 9f624795c68d69ddf212657fe43cc45fc32747a0
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
before this commit, even it the user profile is not public,
or if the user karma is less than karma_profile_min set
in the website, on hovering the move on the user image
in the post, the user details is shown in the pop over
after this commit, the pop over information is shown only
if the user's profile is public profile and user karma is
greater than karma_profile_min in website
closesodoo/odoo#126628
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
As steps are encapsuled in an arrow function from
69a5d8e3ce47238 for steps tour definition to avoid
direct Markup(_t()) interpretation, the same is done
for registerWebsitePreviewTour() of
"odoo/addons/website/static/src/js/tours/tour_utils.js"
in this commit.
This is done in anticipation of the use of
_t() (import from @web/core/l10n/translation) with
registerWebsitePreviewTour().
task-3292454
closesodoo/odoo#130248
Related: odoo/design-themes#678
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
This commit fixes a really old grammar error in the help message of the
message_needaction_counter field.
Before this commit: “Number of messages which requires an action”
After: “Number of messages requiring action”
The subject of “require” is “messages”, which is third-person plural, so
it can't take the -s suffix.
closesodoo/odoo#129468
X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.
Main changes that were requested are:
- record datapoints no longer always have an "id" key in their
data (they still do if the id field is in the view), so we use
record.resId instead
- the new model is based on fined-grained reactivity, so several
components that previously relied on onWillUpdateProps to update
their internal state no longer worked. Typically, using the hook
"observeRecord" is the way to go now.
- specialdata are no longer handled in the model, so the components
needing specialData can use the hook "useSpecialData"
- more generally, all overrides of models (RelationalModel or
KanbanModel) needed to be reworked.
Part of task~3179751
Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
A typo in forum templates leads to a 404 page instead of redirecting to
the page allowing to delete a closed post.
Follow-up of #123709
task-3316555
closesodoo/odoo#129161
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Fixed a typo in forum templates that prevents users from atlerning
between ascending and descending order when sorting forum posts.
follow-up of #123709
task-3316555
closesodoo/odoo#129116
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The _xmlid_lookup cache contains the id of the ir.model.data with is
unused, making cache pupulation and usage more complex than needed.
Removing this id in prevision of the next commit
Part-of: odoo/odoo#129029
The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.
In this commit,
the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
the lazytranslate function _lt() returns _t() function.
Corollaries :
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.
Example :
registry.category("web_tour.tours").add("example", {
test: true,
steps: () => [
{...},
{...},
],
});
task-3292454
closesodoo/odoo#124157
Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
The goal of this commit is to remove all dependency to legacy in the
wysiwyg because the wysiwyg has to be loaded on a lot of form view
(through the html_field).
To remove the dependencies, all the legacy widget that the wysiwyg
uses had to be converted to owl. In order to finish the PR faster,
only a partial conversion of the widgets is done, changing only the
part of the code that was necessary for it to work instead of
rewriting the whole widget from scratch. Another pass should be done
to convert all those widgets to fully embrace the owl paradigm.
task-3175256
Part-of: odoo/odoo#118966