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.
closesodoo/odoo#128540
X-original-commit: ada177c9a840347330942a8e1db2204bf0c280e0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
closesodoo/odoo#124112
Related: odoo/upgrade#4841
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
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
closesodoo/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>
*: 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.
closesodoo/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>
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.
closesodoo/odoo#123638
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#124740
X-original-commit: faaf76c0043d72da7cec587c327d6b508b2ca0fd
Signed-off-by: Dieleman Guillaume (gdi) <gdi@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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.
closesodoo/odoo#124359
X-original-commit: b87dac213dcc8a197dc7c00245a392d1e4d86925
Signed-off-by: Géry Debongnie <ged@odoo.com>
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
closesodoo/odoo#123831
X-original-commit: b14edd74d00c0b0054827563f032f2c384503360
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
closesodoo/odoo#123725
X-original-commit: dc049ce98292e08f5ecf2f20005dc227375dde75
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
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/36c734ab37fdf1d6a245e0e29cfefe3cc46c6d92closesodoo/odoo#122108
X-original-commit: 6ab323a0eeafe7511db8dd893d8f398544ee08c2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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).
closesodoo/odoo#121629
Related: odoo/enterprise#41171
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
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
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
closesodoo/odoo#120437
Signed-off-by: Géry Debongnie <ged@odoo.com>
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.
closesodoo/odoo#114624
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
Replaced _.each() functions (average 235 occurences)
Description of the refactoring this PR addresses:
Current behavior before PR:
There are underscore.js function enumerated above used in odoo.
Desired behavior after PR is merged:
These functions has been replaced by native javascript
prototypes/methods/functions.
TaskId : 3246238
closesodoo/odoo#118565
Signed-off-by: Georis François (fge) <fge@odoo.com>
before this commit, in the website forum faq section,
it is shown, for each down vote it will reduce 10 xp,
but actually it is reducing 2 XP.
after this commit, the points shown in the faq
will be corrected to 2 xp from 10 xp.
closesodoo/odoo#118216
X-original-commit: 3168a39885ec8d4bdf3f9029ab0716beaee11ba1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
before this commit, in the votes tab in the website
user profile, the date time is shown including the
milli seconds in it.
* open forum
* open own user profile
* click votes tab and see the date time
after this commit, the milli seconds info will be
removed from the date time.
closesodoo/odoo#118152
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.
task id: 3162300
closesodoo/odoo#117305
Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
'slug' cannot be called on records which are not yet saved, aka have no ID.
In this commit we set the website_url to False for records that do not have
any ID.
Code managing those URLs is updated to be defensive, as notably when using
studio you may end up trying to call methods on in-memory records.
Followup of odoo/odoo@da3f4c2aff
Task-3254382
closesodoo/odoo#117255
X-original-commit: 36c734ab37fdf1d6a245e0e29cfefe3cc46c6d92
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
*: website_blog,website_event,website_forum,website_hr_recruitment,
website_livechat,website_sale,website_slides
Prior to this commit, elements inside the New+ modal had a `isDisplayed`
property that was meant to be changed by the patches done by each
module. Unfortunately, this was forgotten in the refactor done in [1]
and more precisely when the component was introduced in [2].
This commit fixes that by checking the access rights of the user on each
individual model used on the create form.
[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/ca2e143d54622d598201826a2cd669bad64b205d
opw-3198700
closesodoo/odoo#117206
X-original-commit: 58704cb7615addd7d40291431e05a894776320d8
Related: odoo/enterprise#39066
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
textwrap does the ellision and we don't need to replace newlines characters.
It is done for us already (except that multiple newlines will be replaced by
a single space).
closesodoo/odoo#116778
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Avoid search_count in a loop using a filtered_domain.
Also removed a sudo, as anyway this method is already called in sudo in
most cases.
Part-of: odoo/odoo#116778
Insteadeither is added without space, adding spacing between the words.
Insteadeither --> Instead either
closesodoo/odoo#116493
X-original-commit: 4e59006e2a5a3812cc72dd622b2fcec1468ec0d2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, the compute method was not returning the value for the
field karma_flag field, and thus it was returning compute method failed to
assign value error.
After this commit, the compute method will return correctly set the value
for karma_flag field from the forum.
closesodoo/odoo#116281
X-original-commit: odoo/odoo@bfa3f2d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently 'forums_count' field on website is not correctly updated. Test
introduced recently show that
* at website create, counter is not computed;
* at forum create, counter is not computed;
Only updating a forum active flag, website value, or unlinking it recomputes
the counters.
Note that manually updating counters is required as forum with False website
are global forum, valid for all websites.
Finally rename 'forums_count' into 'forum_count'. Fields in Odoo are rarely
plural (more like 'forum_ids' / 'forum_count' for example, even if in our
case the 2many does not exist due to shared behavior).
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Add tests for website.forums_count field that should be synchronized manually
with the actual number of forum. Seems it is not working as expected, as
the manual update is not done at forum creation, and the default seems not
correctly computed.
Those tests are therefore red without the upcoming fix.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Gamification data used in some emails to add links and shortcuts is not
correctly translated. Let us fix it.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Instead of doing 1 search_count / user in the loop, use read_group to fetch
data in batch.
Also remove an unnecessary import.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
PURPOSE
Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.
SPECIFICATIONS
Rename main views and actions according to guidelines. Having standardized
names eases process of finding and updating views.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Default value is currently not translated, which is sad. We therefore move
it into its own default method, use translation marks, and Markupize the
whole result.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Better have a correctly formatted content looking like all other HTML fields.
This is achieved by using sanitize parameter which cleans up html content
according to our standards.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
A strange manipulation is performed when trying to create tags. In this
commit we simply make styling happy by trying to first prepare data
(strip, content) then use it. Feature is untouched currently.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Mainly reorganize them alphabetically so that execution order matches the
definition order. It helps when debugging.
Also clean some tests from odoo/odoo@f9c2716b3e because they either test nothing
either are not understandable by standard humans. Other tests are left
untouched.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
PURPOSE
Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.
SPECIFICATION
Reorganize main content of python code
* group compute fields on top, order them following fields definition;
* add section separators, to separate compute methods / CRUD methods /
business methods / Mail methods / Tooling in file and have a way to
sort a bit the code out;
* rename compute methods to start with '_compute', to match guidelines
and be coherent with global odoo naming;
* perform some relining in fields definition, don't enforce any char
length but try to stay aligned with Odoo apps;
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841