Commit Graph
2013 Commits
Author SHA1 Message Date
niyasraphy 6ff6b23a89 [FIX] website_forum: not redirecting correctly
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.

closes odoo/odoo#132536

X-original-commit: 944b47346d3d5452a57bbe1ed6a666b17dfcbdc1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-21 17:01:12 +02:00
Elisabeth Dickinson c9af4abfd3 [FIX] website_forum: fix redesign layout glitches
- 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

closes odoo/odoo#132226

X-original-commit: c2ed6257f8a2fe74a7f4fa2977b44aac1c0bb0c5
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
2023-08-18 17:13:59 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
niyasraphy abda470f53 [FIX] website_forum: show votes from same forum
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.

closes odoo/odoo#131487

X-original-commit: ae33d2e3832cc2ce5597a6727fd44c9d745d36c5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-16 17:47:13 +02:00
FrancoisGe e3da5f1b7d [REF] *: convert legacy dialogs
The goal of this commit is to convert a bunch of legacy dialogs into owl dialogs.

closes odoo/odoo#131278

Task-id: 3453920
Related: odoo/enterprise#45484
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-16 16:05:12 +02:00
Jorge Pinna Puissant f956e83c74 [REF] *: remove qweb.render
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
2023-08-11 14:32:28 +02:00
Jorge Pinna Puissant 7b1d82aa9b [REF] *: add t-key when needed on the template
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
2023-08-11 14:32:27 +02:00
Louis Wicket (wil) f1722c7334 [IMP] *: unify sprintf and gettext
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.

closes odoo/odoo#123932

Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-10 18:14:04 +02:00
niyasraphy 1e71660329 [IMP] website_forum: show fields only when needed
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)

closes odoo/odoo#129299

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-09 17:04:11 +02:00
niyasraphy 8a72dfc0ba [IMP] website_forum: show icon in validation queue filter
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.

closes odoo/odoo#123636

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-09 17:04:03 +02:00
niyasraphy 24544d8ec5 [IMP] website_forum: redirect to forum main page
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

closes odoo/odoo#118686

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-09 17:03:56 +02:00
Pierre Pulinckx (pipu) b1ebe3b6f4 [REF] *: Replace core._t imports
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

closes odoo/odoo#130865

Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-09 00:13:08 +02:00
Michael (mcm) 00d8aef1c7 [REF] web, *: remove legacy patch
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.

closes odoo/odoo#130867

Related: odoo/design-themes#685
Related: odoo/enterprise#45271
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-07 10:58:48 +02:00
Lopes Marc (loma) 6c3c4fe370 [FIX] website_forum: allow new user to see own pending post
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

closes odoo/odoo#130857

X-original-commit: 9f624795c68d69ddf212657fe43cc45fc32747a0
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-08-07 10:58:37 +02:00
niyasraphy b62f5081aa [IMP] website_forum: show popover info only for public profile
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

closes odoo/odoo#126628

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-04 10:58:55 +02:00
Pierre Pulinckx (pipu) 09535ef5e6 [REF] website_*: Change registerTours of tour_utils
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

closes odoo/odoo#130248

Related: odoo/design-themes#678
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-02 13:20:23 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
Louis Wicket (wil) 7da30c7d14 [FIX] mail, *: fix grammar error in field help
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.

closes odoo/odoo#129468

X-original-commit: 0d10cfeaa56d5df23df05f436d353978043f4a71
Related: odoo/enterprise#44509
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-07-25 17:36:08 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
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>
2023-07-24 20:17:50 +02:00
Florian Charlier f11e84b10c [FIX] website_forum: fix delete button
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

closes odoo/odoo#129161

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-20 15:45:11 +02:00
Lopes Marc (loma) c91346f889 [FIX] website_forum: fix posts sorting by last activity date
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

closes odoo/odoo#129116

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-20 14:23:18 +02:00
Xavier-Do d5ed47a11f [IMP] base: simplify _xmlid_lookup cache
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
2023-07-20 14:23:15 +02:00
Pierre Pulinckx (pipu) 8bfa76a842 [REF] *: Unify _t and _lt
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

closes odoo/odoo#124157

Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-07-19 13:13:16 +02:00
Nicolas Bayet d7245d2abf [REF] web_editor,*: convert wysiwyg to owl
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
2023-07-19 11:39:44 +02:00
Florian Charlier 307c957323 [IMP] website_forum: deny accepting own answers
It doesn't feel right, does it?

Task-3316555

Part-of: odoo/odoo#123709
2023-07-18 16:58:45 +02:00
Florian Charlier 872f903113 [REF] website_forum: clean multiple methods
# forum.post
search_can_view: improve readability
convert_answer_to_comment: remove unused parameter
unlink_comment: extract operations from loop; early return

# forum.post.vote
write: simplification upvote computation
_check_karma_rights: upvote is a flag

# ir_attachment
_can_bypass_rights_on_media_dialog: grammar

# website_forum controller
questions: simplifications
_prepare_open_forum_user: 'my_profile' isn't used since c8c8eb3d
question_edit_answer: avoid failure on unmatched `answer`
Usage of f-strings when multiple string concatenation or type cast
removing ask_hide which seems really dead

Also, various changes to follow PEP8 for imports and indentations.

Task-3271492

Part-of: odoo/odoo#123709
2023-07-18 16:58:44 +02:00
Florian Charlier 0bde4a1652 [REF] website_forum: reduce JQuery usage
and reduce code duplicity with respect to displaying errors.
We'll do more when time allows.

Task-3316555

Part-of: odoo/odoo#123709
2023-07-18 16:58:44 +02:00
Lopes Marc (loma)andFlorian Charlier 280537b9fe [IMP] website_forum: replace bump with last activity
Purpose
=======
1. The post "activity" date shown on a forum's list of posts is not a
great user experience as it is seems to be updated for writes on the
 original post and not, e.g., when a reply is added.

2. Remove bumping on social sharing.
As we are not in 2015 anymore, sharing is not a relevant "activity"
for the post. This is illustrated by the fact that `allow_bump`
could not be updated with the client, and the "default" "target_type"
is not found in the codebase anymore. We clean that here.

Specifications
==============
- Drop bump_date and use last_activity_date instead of write date
to log activity
- Update post last_activity_date whenever a reply or a comment is
added to the original post or one of its replies
- Sort posts lists by `last_activity_date desc` by default
- Use luxon.js library to render the bump_date field as a
`relative datetime`(e.g.: 2 days ago, 1 hour ago...)

Task-3349374
Task-3316555

Part-of: odoo/odoo#123709
Co-authored-by: Florian Charlier <flch@odoo.com>
2023-07-18 16:58:44 +02:00
Florian Charlier 3d1d5bfb09 [IMP] website_forum: search and filter tags
This commit enables user to

* Track, show, and use the forum's
  * Most commonly used tags
  * Unused tags (for the moderators)
* Search tags
* Get an improved "no results" experience with tags

Task-3349375

Part-of: odoo/odoo#123709
2023-07-18 16:58:43 +02:00
Elisabeth DickinsonandFlorian Charlier 21531bd9b9 [IMP] website_forum, *: redesign forum's frontend
* = website_slides_forum, website_mail, website_profile

In `website_(slides)_forum`:
All forums page:
Course forums are displayed on the same level as regular forums (with
a tag "Course" to differentiate them).
We don't see this page if there is only one forum.

This new design resembles that of Discourse with a table for the list
of questions and a sidebar on the left.

Other pages such as the Tags, FAQ, and Moderation pages have also been
revamped. Some of the functionality comes in the following commits.

Notes: The table rows have been made fully clickable, but by doing so
other clickable or hoverable elements lose their function.
In order to counteract this, a `position-relative` and
`z-index-1` classes are added to them.

The image_url definition wasn't working properly: When a user didn't have
and avatar, a placeholder with their initial is generated. But it did
not take the size option defined in the widget. This has been
corrected by changing it to `request.website.image_url(...)`

In the posts' page, the answer box now comes up from the bottom of the
screen.

In the FAQ pages, the accordion has been replaced by BS accordion
component using `accordion-item` instead of cards. The web editor
however is still using the old system.

In `website_mail`:
A new template for the follow button has been created in order to
redesign it for the forum without disrupting this element in other
modules (ie: website_mail, blog).

Task-3083657
Part of Task-3316555

Part-of: odoo/odoo#123709
Co-authored-by: Florian Charlier <flch@odoo.com>
2023-07-18 16:58:43 +02:00
niyasraphy 9bacc4e25d [FIX] website_forum: traceback on clicking publish/unpublish
before this commit, on clicking the publish/unpublish
buttons from the tree view of the forum post, is showing
traceback due to missing is_published field in the
forum.post model.

publish/unpublish buttons in the action menu is added
by the js class website_pages_list.

after this commit, the js class is removed from the
tree and thus no publish/unpublish button is shown
in the action menu.

closes odoo/odoo#128540

X-original-commit: ada177c9a840347330942a8e1db2204bf0c280e0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-15 12:00:47 +02:00
Martin Trigaux cd2f330bec [IMP] *: remove glocal ACL
Specify explicit route for each ,, line
This is part of task 3230280 where global ir.model.access will be
forbidden.
The goal is to make access to public/portal explicit. Too often,
global access was granted with only employees in mind.

Remove ,,0,0,0,0 lines

mail:
employee already had read access to mail.group
still needed to subtypes as in ir.rule domain

mail_group: employee already had read access
pos_mercury: only needed for employees

membership:
move public access for website_membership as needed in the controllers

website_customer: employee already had read access

website_event_booth: no need for category
website_event_exhibitor: retrieved in sudo
website_event_track: not needed for location

Part-of: odoo/odoo#125216
2023-07-11 22:33:47 +02:00
dane@odoo.com fc66f54ed4 [IMP] website_forum: multi forum pending
This change introduces ability for users (who don't have enough karma)
to create one pending post per forum.
Previously users could only do it in all of forums.

ticket-3354435

closes odoo/odoo#124112

Related: odoo/upgrade#4841
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-06-28 17:41:35 +02:00
Florian Charlier 3dc7099d37 [FIX] website_forum: fix tag posts count dependencies
Post counts were not updated when a post was created or deleted
because of missing dependencies in the _compute.

Note that while "active_test" is included when counting without
specifying it, the field must be explicitly added to the `_compute`'s
dependency list to trigger it.

Task-3358143

closes odoo/odoo#125968

X-original-commit: 6e1d976131dccecec35d12b8a03328ce9882d055
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
2023-06-22 17:10:42 +02:00
Jeremy Kersten 5746f4eccc [FIX] website_forum: don't use trailing / in url_for
Since PR https://github.com/odoo/odoo/pull/106109, url_for remove the
trailing / so we need to handle this case from another way

closes odoo/odoo#125598

X-original-commit: 1d04e56013e53320da4eda5335e06a69f2c479e9
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-06-19 16:40:15 +02:00
Samuel Degueldre 81be42d8f9 [FIX] *: ensure tour tips are correctly translated
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows

In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.

This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.

This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.

In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.

closes odoo/odoo#125284

X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-06-19 13:35:28 +02:00
niyasraphy 08f196cf8c [IMP] website_forum: add karma_user_bio field to view
before this commit, karma_user_bio was not added in the
forum forum view and the default value set for the field
was 750, this field decide whether the pop over has to
show or not when user places the mouse hover the author
box in the frontend forum post.

after this commit, as the field is added to the view
end user will be able to adjust the value as per the
need.

closes odoo/odoo#123638

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-16 09:34:46 +02:00
Guillaume (gdi) 864d008ac7 [FIX] website_forum: enlarge answer textarea
This commit permits to enlarge the answer textarea in the forum.

Steps to reproduce the "issue" resolved by this commit:
- Go to /forum
- Click on a thread
- Click on "Answer"

=> The textarea is too small to write a long answer.

task-2865782

closes odoo/odoo#124740

X-original-commit: faaf76c0043d72da7cec587c327d6b508b2ca0fd
Signed-off-by: Dieleman Guillaume (gdi) <gdi@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-13 08:44:19 +02:00
Guillaume (gdi) 7332998e89 [FIX] website_forum: permit to post an image without text
In the website forum, we checked that the post content is not empty
before posting a post or an answer. Before this commit, it was just a
verification that the content is not an empty string.
Users are also able to post an image and we want to allow them to create
a post or an answer with only an image. This commit changes the
verification to check if the content is empty or if it only contains
images.

Steps to reproduce the issue resolved by this commit:
- Go to the website forum
- Create a new post
- Set a title
- Add an image as description
- Click on "Post Your Question"

=> The post is not created because the content is considered as empty.

task-2865782

X-original-commit: 048c6b779423ff34dd80f51e2a9202e16553a3ae
Part-of: odoo/odoo#124740
2023-06-13 08:44:18 +02:00
Pulinckx Pierre (PIPU) 911e2a5df9 [FIX] website,* : fix map on jquery arrays
Jquery find return an object instead of an array of element.
When you map on this object, the first callback element is
so the index and not the element. This commit fix wrong usages of
.map() used with Jquery.

closes odoo/odoo#124359

X-original-commit: b87dac213dcc8a197dc7c00245a392d1e4d86925
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-06-08 23:01:21 +02:00
Florian Charlier 5239a98293 [FIX] website_forum: fix new post button popover
When a portal user asks a question (e.g. on the Help demo forum) and
go back to the forum's home page while their post is to be validated
before they can post again, they're hit with a traceback (because the
offset argument type is incorrect).

Probably coming from switching bootstrap version.

Task-3347773

closes odoo/odoo#123831

X-original-commit: b14edd74d00c0b0054827563f032f2c384503360
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-06 10:30:17 +02:00
Florian Charlier 3509ddf3ed [FIX] website_forum: prevent calling vote on multi
This method was supposed to work in multi (see history) but that
behavior was lost somewhere.

Voting for several posts at the same time doesn't mean much in the end
and the function wouldn't work anyway because:

1. Return values wouldn't work in multi
2. It would try to vote n times for each of the n posts in self and
  violate unique constraint.
3. If the last existing vote had opposed value to the new vote,
  the method would create only '0'-valued votes for all the new
  records.

We here then clean it make sure it is not called on several posts.

A test is extended to check votes and records counts.

Task-3267872

closes odoo/odoo#123725

X-original-commit: dc049ce98292e08f5ecf2f20005dc227375dde75
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
2023-06-05 17:51:40 +02:00
niyasraphy 527766a0af [CLN] website_forum: clean moderation_queue temporary fix
Follow-up of [1] fixing an undesired override of the env user
 when rendering other users' details.

This cleans up the temporary patch in stable in favor of simply
renaming the variable defined in the template.

[1] https://github.com/odoo/odoo/commit/5f2a0bea54a4daca565d3ba3be32ce5582253cca

closes odoo/odoo#115006

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-05 13:31:10 +02:00
niyasraphy 50c8807c3d [FIX] website_forum: missing parenthesis for function
before this commit, on clicking on Go To Website
smart button in forum is not redirecting to the
corresponding forum due to missing parenthesis
to the function.

after this commit, on clicking the Go To Website
smart button, user is redirected to the forum.

introduced in: https://github.com/odoo/odoo/commit/36c734ab37fdf1d6a245e0e29cfefe3cc46c6d92

closes odoo/odoo#122108

X-original-commit: 6ab323a0eeafe7511db8dd893d8f398544ee08c2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-23 18:02:09 +02:00
Louis Wicket (wil) 04189318cc [I18N] *: update master translations
Currently, only stable releases see their translations updated. This has
resulted in master accumulating outdated stuff for years, which can be
confusing for users testing master on runbot.

This one-shot commit resynchronizes master translations based on the
content from 16.0 and removes empty PO files (i.e. no longer containing
translations).

closes odoo/odoo#121629

Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-22 17:52:07 +02:00
Brieuc-brd ee75969979 [IMP] *: app icons: replace svg to png
The introduction of Milk has brought new app icons.
Using the svg format creates a lack of anti-aliasing on the edges of the
shapes, which makes the icons look bad.
Since the png size has been reduced, we can afford to use the png format
to have the best possible quality without having a lack of performance.

task-3326633
Part of task-3326263

X-original-commit: e07cb722f2b11407a3ad093bd688b7d37afd5a88
Part-of: odoo/odoo#121886
2023-05-22 13:54:07 +02:00
Martin Trigaux 077bbd0b0b [I18N] *: export master source terms
closes odoo/odoo#121563

Related: odoo/enterprise#41140
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-05-17 10:34:00 +02:00
Pulinckx Pierre (PIPU) f4f0f78318 [REF] *: Replace underscore.js function by native JS
Before this commit : The library underscore.js and
underscore.string.js were used in the ODOO solution.
After this commit : Every usages of a function from
underscore.js lib has been replaced with native javascript.
The goal is to remove all usages of underscore.js and to
not use anymore this library in ODOO.
---
TaskId : 3246238

closes odoo/odoo#120437

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-15 09:37:48 +02:00
niyasraphy 1b03544678 [IMP] website_forum: improve window title
before this commit, on editing a forum post
window title is shown as edit_post(id) as the
name is not set on the template.

after this commit, window title will be shown
as Edit Post.

closes odoo/odoo#114624

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-05-15 09:37:42 +02:00
Brieuc-brd 418413e499 [IMP] web, *: directional icons
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.

task-2818586

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00