Commit Graph
389 Commits
Author SHA1 Message Date
Stefan Rijnhart 84cb5433ab [FIX] website_forum: prevent error when creating multi
closes odoo/odoo#76496

X-original-commit: f827177ef434eeb14e1214ff8948ee807d90de3a
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-09-18 14:03:46 +00:00
Benoit Socias 9f9c4bb7e4 [IMP] website(_*): replace search callbacks by a mixin
Before this commit the `_search_get_detail` result contained callback
functions to handle special behavior during fetching and rendering.

After this commit a `website.searchable.mixin` is introduced that must
be inherited by models that participate in website-based searches.
Custom behavior previously achieved with callbacks is now achieved by
overloading methods of this mixin.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Benoit Socias 7559626c54 [IMP] website, *: make a generic search bar snippet available
(*: website_blog, website_event, website_forum, website_sale,
website_slides)

Before this commit the search bar was specific to products.

After this commit a generic search bar is available as a general feature
of website which can be configured to inspect specific models.
The snippet is used to replace the old search bar in blog, courses,
event, forum, page and shop.
The search results of these pages and the autocomplete of the search bar
run through the same search mechanism.
A new hybrid results page has also been created as a target of a search
on "Everything".

In each involved module, `website._search_get_details()` is implemented
to return search metadata for every model related to the `search_type`
parameter.
Search metadata for a single model is returned by `_search_get_detail()`
on that specific model.

The autocomplete runs through the additional
`website._search_render_results()` pre-rendering step that prepares the
data to fit in the autocomplete template.

task-2379555
https://github.com/odoo/odoo/pull/65871

Part-of: odoo/odoo#65871
2021-09-03 06:59:33 +00:00
Martin Trigaux c7bac3dee0 [IMP] *: make ir.model.data helper private
No reason to interfact with them directly in RPC
2021-08-10 13:49:04 +02:00
Gorash 7df343dd1b [IMP] base: QWeb _render return Markup unicode instead of utf8 bytes
In order to limit encoding decoding, the _render method returns a
unicode string in the markup safe object instead of a MarkupSafeBytes

closes odoo/odoo#68299

Related: odoo/upgrade#2454
Related: odoo/enterprise#17270
Signed-off-by: Antony Lesuisse (al) <al@openerp.com>
2021-08-03 16:20:22 +00:00
15aae7ea34 [IMP] website: organize links in menu & footer on configurator apply
The configurator takes care of the organization of the links to the different
pages. Some links are put in the menu and some are put in the footer. The order
is predefined. If too many links are present in the menu then a sub-menu 'Company'
is created and some links are put in it. For the 'News' and 'Succes Stories' features
a website specific blog is created.

Links have the following order in the menu and are present only if their corresponding
website.configurator.feature has been selected in the configurator excepted for the 'Home'
and 'Contact us' links which are default links:
- 'Home'
- 'Shop'
- 'Event'
- 'Courses'
- 'Services'
- 'Pricing'
- 'Company': if more than 8 links in menu and more than 1 item in this submenu
             otherwise the three following links are in the top menu.
  - 'News'
  - 'Success Stories'
  - 'About us'
- 'Appointment'
- 'Contact us'

Links in footer:
- 'Privacy Policy'
- 'Help': if website_helpdesk installed. This is not a website.configurator.feature.
- 'Forum'

Community: https://github.com/odoo/odoo/pull/71993
Enterprise: https://github.com/odoo/enterprise/pull/18930

task-2518565

Co-authored-by: Sébastien Mottet (oms) <oms@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2021-07-30 13:51:33 +00:00
Arthur Detroux (ard) 3a23891fa1 [IMP] website_forum: change welcome message sanitization
This commit changes the sanitization of the welcome_message to be on par
with other modules that take advantage of web_editor.

Part of https://github.com/odoo/odoo/pull/67140
task-2381049
2021-07-30 12:52:30 +00:00
Achraf (abz)andThibault Delavallée f5adb5b25d [FIX] mail: send notification mail with right access link when using mail.thread
PURPOSE

Notification may be sent using a generic mail.thread record, notably when
sending user notifications. In that case links to view document are
incorrect.

HOW TO REPRODUCE

Issue

    - Install "Approvals"
    - Submit new approval with you as "Request Owner"
    - Click on "View Approval Request" in your mailbox

    The link redirects to a 505 error

Cause

    The model is not the correct one and the res_id is undefined

Solution

    Specify the model and the res_id to _notify_get_action_link
    when creating the link with kwargs

SPECIFICATIONS

Propagate message value through various notification sub methods. That way
we can rely on them if model seems void.

Also limit values given as URL parameters to some white listed values.

LINKS

opw-2358846
Task ID-2379766
Followup of odoo/odoo#60998
Followup of odoo/odoo#61545
Closes odoo/odoo#63292
Closes odoo/enterprise#15585

closes odoo/odoo#64229

X-original-commit: 58bac5d242d6548d54f0163328fa64b319852e40
Related: odoo/enterprise#15634
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Achraf Ben Azzouz <abz@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2021-01-07 17:44:37 +00:00
Adrian Torres 679185f3e8 [IMP] *: replace all raises inside unlink by api.ondelete
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
2020-12-04 09:16:16 +00:00
Victor Feyens 0e992e0b72 [IMP] website_forum: support batch creation
See merge commit for more details.

Task ID-2330149
COM PR odoo/odoo#61246
ENT PR odoo/enterprise#14561
2020-12-03 10:19:18 +00:00
Swapnesh Shah f55d1a0d52 [FIX] website_forum: do not copy fields
Fields `views`, `closed_reason_id`, `closed_uid` and `closed_date` should not be copied while copying post.

closes odoo/odoo#62401

X-original-commit: d35acd37720e8f498f5eef319c50780eaa7cb72e
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-26 13:06:17 +00:00
Martin Trigaux c59c10f1bc [FIX] *: correct typos and bad English
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61010

X-original-commit: 62a18bdb372e234107fd2099a2df5f9e3a442c96
Related: odoo/enterprise#14489
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-10-29 19:23:41 +00:00
Jeremy Kersten 6538e20bb6 [FIX] tools.sql, website_*: increment counter with skip lock
*blog, forum, slides

Based on https://github.com/odoo/odoo/pull/48552#discussion_r440061218 suggestion

Add a new method 'increment_skip_lock' in tools.sql to allow to easily
increment a specific field of 1 if the record is not locked.

The method return boolean if at least 1 record has been incremented.

closes odoo/odoo#58765

X-original-commit: d92e61e89f468c2db2fbd68b2f0d6b36c77f1065
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-29 08:48:59 +00:00
Dharmraj Jhala 7e750ac639 [FIX] website_{slides,forum}: enable slide content and forum creation
Since a recent refactoring[1] is merged, few compute methods are being
called at record creation, and throws traceback because of newID.

This commit fixes the traceback by improving the compute methods and
thus enable users to create records of slide contents and forums.
Note - compute fields should be assigned a value, and so we update
the recordset with default values while creation. See below PR for
more information.

[1] - https://github.com/odoo/odoo/pull/55995

Task - 2325605

closes odoo/odoo#58196

X-original-commit: a677859a03c86bf6ac791c31f52ce8609bcba594
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-09-22 10:07:46 +00:00
Thibault Delavallée 371ab515bb [REF] mail: reorganize a bit 13+ thread code and set some methods private
PURPOSE

Since v13 some commits added code in mail thread file. This file is already
quite long and keeping it organized allow to understand its content.

SPECIFICATIONS

Clearly separate CRUD / CRUD HELPERS / TRACKING / ... . Notably tracking
code was split accross two code sections.

Make some internal tools methods private. They do not require to be public
  * with_lang: does not makes sense to be available outside of odoo. It is
    renamed to _fallback_lang as it does not allow to set a specific lang in
    the environment like with_user. It is used to fallback on user's lang
    in context;
  * get_mail_message_access: purely internal method used for access rights;

LINKS

Task ID-2327096 (code cleaning)
PR #56631

X-original-commit: 4a5fc70cfc3c86da33e2480fbd59c8f6d575c6e9
2020-08-28 07:59:23 +00:00
Jorge Pinna Puissant aaad54bdac [FIX] website_forum: error when converting answer/comment
- Create 2 companies (A and B for instance);
- Create 2 users with password, one on each company (user 'a' in
  company A and user 'b' in company B);
- Add enough karma on both users;
- Add a valid email address to both users;
- As user 'b' :
  - open any forum topic and validate the email address;
  - post an answer or comment to a forum post;
- As user 'a' :
  - open the forum and find the answer/comment made by user 'b';
  - convert the answer as comment or convert a comment as answer;

Before this commit, an error was raised : 'Access to unauthorized or
invalid companies'.

opw-2296470

closes odoo/odoo#55301

X-original-commit: ce63a20ca26f1773ea7e1133b0a3796fda692e11
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-08-03 07:51:07 +00:00
Jeremy Kersten 01c17707bd [IMP] website_[blog/shop/forum]: rename routes to remove 'useless' part
Url for a product become:
/shop/productname-id instead of /shop/product/productname-id

Url for a blog post become:
/blog/blogname-1/blogpost-1 instead of /blog/blogname-1/post/blogpost-1

Url for a question on forum become:
/forum/forumname-1/title-1 instead of /forum/forumname-1/question/title-1

task-2295016
2020-07-22 06:53:37 +00:00
Victor Feyens bdcad21ccc [FIX] *: correct support of multi records in methods
Wrong usage of self in for loops makes some apparently multi-friendly
methods not work correctly when called with a recordset of len > 1.

This commit replaces those references by the correct unique record
reference which should be used at this iteration of the loop, avoiding
potential exceptions or wrong behavior in the concerned methods.

closes odoo/odoo#53320

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-06-19 13:27:41 +00:00
Martin Trigaux ba244cef01 [IMP] *: replace to new _() syntax
Using a few regex like
\((_\(.*%s.*)(\) % )([\w\[\]][\w .\[\]\(\)'"]*)\)
($1, $3))

Old syntax is still compatible but starts the migration to the new
syntax that catches error.
2020-06-18 13:03:34 +02:00
Jeremy Kersten 0d25f4f801 [IMP] website_forum: store the forum_count
Cannot be a one2many, since website_id=False means that it is for all websites
2020-06-08 07:43:07 +00:00
Jeremy Kersten f553d871fa [FIX] website_forum: child_ids from current forum only
Before this commit, we got all post where parent_id = self.id, whatever the forum_id from the post
2020-06-08 07:43:07 +00:00
Jeremy Kersten 1b7f55a15e [IMP] website_forum: perf - replace any by in
Usinf of any seems not efficient in this case

> timeit.timeit('any(7 == o for o in [1,3,5,7,9,12])', number=10000000)
6.556934245978482

> timeit.timeit('7 in set([1,3,5,7,9,12])', number=10000000)
2.78867393406108

> timeit.timeit('7 in [1,3,5,7,9,12]', number=10000000)
0.534781630965881
2020-06-08 07:43:06 +00:00
Jeremy Kersten 52a0406a2c [IMP] website_forum: delay the set_viewed
Try to make the update the latest possible, to minimize risk of concurrent
update.

Since it is not critical to loose a view, add the old value in where clause, to
try to decrease the risk to alter at the same time a same row.
2020-06-08 07:43:06 +00:00
Okan SUMER (osu) f759a316f6 [IMP] website_profile: add badge breadcrumb and profile rank
This commit add a breadcrumb in the badge frontend view to redirect
to the last page the user was.
It highlights the user profile line in ranking view (profile/users).
It add this line at the top of every pages except for the one where
it already was.

Part of https://github.com/odoo/odoo/pull/46634

task-2201708
2020-05-15 08:40:14 +00:00
Okan SUMER (osu) 645056554e [IMP] website_forum: frontend improvements and corrections
This commit adds new features and corrects some others in the frontend
of website_forum app.
- In the "about" section of a forum, use the s_accordion instead
  of a custom one for the first 3 elements, the last one is on a
  new page accessible from a link below the accordion
- Cut the description after a specific amount of characters in the
  page where all forum are listed
- In that same view, create options that show the number of post
  and the last post a forum has. Create an option to render forums
  in list view
- Allow the user to cancel his vote (down or up)
- Hide the answer box in the post view. Make it appear when the user
  click on the "answer" button
- Use a JS public widget to validate a Post form (new, save, comment)
- Enable the modification of a forum's image from the frontend
- Hide Solved/Unsolved categories in "Discussion" forums
- Disable the possibility to add snippets to an answer
- Corrections of tours that broke after these modifications

Part of https://github.com/odoo/odoo/pull/46634

task-2201708
2020-05-14 18:27:00 +00:00
Okan SUMER (osu) b869020401 [IMP] website_forum: improve tree and form view
This commit add a lot of features and information about forum.forum,
forum.post, forum.tag.

- Correct the forum and post tree view to correctly render the number
  of posts, answers, views and favorites
- Add a Status column to post tree view
- Add stat buttons to redirect to the frontend
- Add stat buttons to highlight datas in forum.forum and forum.post
- Make the tree view of forum.tag editable
- Add buttons to change the state of a forum.post in the form view
- Add post close reason menu and views

Part of https://github.com/odoo/odoo/pull/46634

task-2201708
2020-05-14 18:27:00 +00:00
Okan SUMER (osu) bfb70b6b9c [IMP] website_forum: rename fields, labels, texts,...
This commit rename every "Question" references by "Post"
to make it appropriate for both forum's type (Question and Discussion)
It renames some other fields/labels to be shorter or with a
capital letter at the start.
Update demo data to add a title to answers

Part of https://github.com/odoo/odoo/pull/46634

task-2201708
2020-05-14 18:27:00 +00:00
DramixDw 9b9829416b [IMP] website: simplify website menu
Some apps, once installed, automatically create a menuitem in website.
What complexify the UI and create useless menu withtout plusvalue.

It is not because you install livechat to make support online, that you want
a link in your menu to show stats e.g.

Now we remove the default menu created, and help user to find it when he create
a link. The autocomplete suggest most of the main App's controllers

task-2189613

closes odoo/odoo#49081

Related: odoo/enterprise#9733
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-05-01 07:59:07 +00:00
Victor Feyens 9ff94fec74 [IMP] website_forum: improve forum.post child_count performance.
PURPOSE

Several counter fields are performed inefficiently. They use compute methods
using length of 2many fields instead of making use of more efficient ORM
methods like read_group.

SPECIFICATIONS

No functional change, only technical performance improvements. Purpose is to
improve forum.post child_count performance.

LINKS

Task ID 2196182
PR #44662
2020-04-21 12:28:52 +00:00
Adrian Torres 1daf8eb127 [FIX] *: set ondelete policy of required Selection fields
With this commit, Selection fields with `required=True` which are
extended via `selection_add` are given proper ondelete policies to
ensure the cleanup of records containing these extended options during
uninstall of the extending module.

This commit also cleans up leftover uninstall hooks that were being used
to handle the same set of problems prior to the ondelete mechanism being
implemented for Selection fields.

closes odoo/odoo#46325

Related: odoo/enterprise#9117
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-03-30 13:42:04 +00:00
Adrian Torres 9befa3d245 [FIX] *: adapt code for resolve_2many_commands removal
This code adapts all business code instances of calls to
`resolve_2many_commands` and replaces them by calls to `new` which
returns a record-like object whose api is more familiar than the
`resolve_2many_commands` api.
2020-03-23 15:14:10 +00:00
Olivier Dony 5f4ac9ea6d [FIX] website_forum: fix permissions for tag notifs
Forum users can follow tags and will be notified when a new post
includes the tag. However the person posting it does not have access to
the list of followers, so the notification would fail with an
AccessError. The OP would get a 403 page and the post would not be
posted.

closes odoo/odoo#47907

X-original-commit: 2b2b8484cefc4b2cfdf1023fb8209e70eef5ec24
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-03-18 11:53:38 +00:00
jbm-odoo 49d64a8fb1 [IMP] website_forum: Add privacy
Add privacy on forum: public or private. If private, we must select
one group that has access.

For forum linked to eLearning course: the privacy of forum is the same
as the course. If the course is not yet published, the forum will be
invisible (unless we have the group group_website_slides_officer).

If a forum linked to a course is unlinked or removed, the forum will
become private and his group will be set to group_website_slides_officer.

All posts and tags have the same access rules as their linked forum.

closes odoo/odoo#43486

Taskid: 2169965
Related: odoo/upgrade#758
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-02-28 08:58:43 +00:00
Rémi Rahir c45f4ebc42 [FIX] website_forum: wrong user displayed on forum
The function to convert an answer to a comment was creating a new
message with the create_uid of the current user instead of the original
poster, therefore creating a mismatch between the create_uid and the
user of the message author.

Since the template 'website_forum.author_box' was designed to work with
different objects (mail.message & forum.post), it displays the
information of the object.create_uid which is not the correct user in
this case.

This commit ensures that we create the message with the correct user to
avoid the mismatch.

closes odoo/odoo#46486

X-original-commit: 20800955257c4f871cc21f8e21cd22c1a3b0fe9f
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2020-02-27 20:01:19 +00:00
Paul Morelle 0cc95583bf [FIX] website_forum: give a name to posts created from comments
From Odoo 13.0, the list of answers of a user displays the name of the
answer itself, and not its parent's.
Answers created directly on a question are given a name, but answers
created from a comment are not.

This commit fixes this behavior for a better consistancy: all posts
should have a displayable name.

A migration step on saas~12.5 will populate from their parent's name
the existing posts that don't have a name.

closes odoo/odoo#45193

X-original-commit: 327079e97d12bf3bfcbc74e78bcc7ebc36149d02
Signed-off-by: Paul Morelle <madprog@users.noreply.github.com>
2020-02-12 13:16:47 +00:00
Thibault Delavallée e2b33f460d [REF] mail, various: rename subtype parameter of message_post to subtype_xmlid
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

LINKS

Task ID 2071556
PR #38692
2019-12-02 15:18:44 +00:00
David Beguin be3f074a91 [REF] gamification, * : rename challenge.category into challenge.challenge_category
To ease grep in the code, especially that challenge is quite heavily used.

Task ID : 1961053
PR #32594
2019-11-22 14:45:39 +00:00
Stéphane Bidoul (ACSONE) c8c8413e3e [IMP] mail: enforce kw args for message_{post/notify/log}
Since there are message_post overrides using the form `def message_post(self,
**kwargs)` in some modules, this method is intended to be invoked with keyword
arguments only.

This commit enforces this behavior. Calls such as `message_post("body")` will
fail regardless of which addon is installed, forcing users to use
`message_post(body="body")`.

It also fixes a message_post override in hr, and applies the same
mechanism to message_notify, and _message_log.

closes odoo/odoo#33306

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-10-02 15:42:04 +00:00
c8c8eb3d56 [IMP] website_forum, *: revamp design
* web_editor, website_profile

Part of https://github.com/odoo/odoo/pull/35749
task-2024197

Co-authored-by: Jérémy Kersten <jke@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Co-authored-by: fja-odoo <fja@odoo.com>
2019-10-01 16:52:20 +00:00
fja-odoo 424adb63e3 [IMP] gamification, *: remove KarmaError
* = stock, test_website, web, website_forum, website_slides, base

Replace KarmaError with AccessError and remove the related override made
on crash_manager and ir_http.

task-2069890

closes odoo/odoo#36655

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-09-12 13:49:02 +00:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:

* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;

* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;

* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);

* make method `modified` take advantage of inverse fields to inverse
dependencies;

* filter records by evaluating a domain on records in Python;

* a computed field with `readonly=False` behaves like a normal field
with an onchange method;

* computed fields are computed in superuser mode by default.

Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
qmo-odoo f5ddd6f151 [FIX] website_forum: rename compute method for forum statistics
SPECIFICATIONS

This commit renames the compute method _compute_slides_statistics to
_compute_forum_statistics. Purpose is to make read easier to understand
by having meaningful names .

LINKS

Task 1978731
PR #33255
2019-08-08 08:26:08 +00:00
mreficent 355a5dfc36 [IMP] *: fix typos in comments
closes odoo/odoo#35404

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-08-07 10:28:33 +00:00
Christophe Simonis 886eca0131 [IMP] *: remove usage of oldname attribute
This attribute is misleading as it is insufficient to correctly upgrade
the database. It only renames the column in the database, but other
operations are needed, like updating the corresponding `ir.model.fields`
record (and its xmlid). The default values and the translations are also
lost during the upgrade.

Moreover, this feature was misused. It was:
 - left on fields during multiple versions.
 - used on reports (SQL views). This would be ok if the feature was
   complete, but, as is, it was useless.
 - kept unchanged after a second renaming of the field (which can happen
   versions later the first rename).
 - used, even when the meaning of the field changed. i.e. the field
   `archived` has been renamed to the classic `active`, but the value
   in the database should be switched.
2019-08-05 09:36:41 +00:00
fja-odoo 5dac8f8f29 [REF] website, *: remove hardcoded image urls
* = website_forum, website_profile, website_sale,
website_sale_comparison, website_slides, website_slides_survey

Some image links were hard coded in the xml views of website, now they
are replaced with website.image_url(model, field).

Part of https://github.com/odoo/odoo/pull/34149
task-2007400

closes odoo/odoo#34149

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-05 13:24:22 +00:00
Jérémy HennecartandThibault Delavallée 2e707935f1 [REF] website_slides_forum: improve integration into eLeaning application
PURPOSE

eLearning should have its own application in manager. Indeed this is becoming
a big application and having it embedded inside Website application is not
enough anymore. It should also hold updated and easy-to-use menus,
navigation, actions and views in backend.

SPECIFICATIONS

Add menu after Courses

  * Forum
    * Forums: add columns to list view: Posts (questions count), Views
      (sum of views of each post), Answers (sum of child_count on each post),
      Favorites (sum of favourite_count on each post)
    * Posts: add columns to list view: Views / Answers / Favourites

Add menu entry inside Reporting
  * Forum: graph view on forum.post model
      Area chart: # Posts created by months, color=forum

LINKS

Task 1978729
PR #35061

Co-Authored-By: Thibault Delavallée <tde@odoo.com>
Co-Authored-By: Jérémy Hennecart <jeh@odoo.com>
2019-08-05 08:43:20 +00:00
Andrea Ulliana f9c2716b3e [IMP] website_forum: bring forum modes
It is now possible to specify the forum mode : Questions and Answers or
Discussions. In Q&A mode, a user can only reply once while there is no
limit in Discussions mode.

task-2008910

closes odoo/odoo#34097

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-08-02 16:32:29 +00:00
Sébastien Theys 1e9772889b [IMP] *: use image.mixin when appropriate
The following models are already using big images, or they might need big images
in the future:

- partner
- hr employee
- shop category
- lunch product
- gamification badge and karma rank

PR: #34925
2019-08-02 16:47:58 +00:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02:00
Thibault Delavallée 488a5d5af5 [IMP] mail: prepare new SMS model by updating mail.notification
This commit prepares SMS refactoring by updating some mail models. Purpose
is to be able to store SMS notification information inside existing mail
flow and models.

Main changes

  * mail.notification: define a notification_type field to store the medium
    used to notify people. In mail two ways exist: inbox and email. It will
    ease introduction of SMS notification mechanism. This field replaces the
    is_email boolean field;
  * mail.notification: make res_partner_id field not required. This means
    notifications could be linked to something else than a partner. An SMS
    for example. For Inbox and email notifications partner is still required
    and a constraint is added accordingly;
  * mail.thread: let notification methods handle the creation and update of
    their notification instead of creating them in _notify_thread and tweaking
    them in sub notification methods;
  * mail.thread: clearly move inbox-style notification in its own method like
    notify by email;

Some lighter code changes

  * propagate message_type to notification recipient computation. It will
    allow for example to be more precise when computing a notification type
    depending on the message_type. For example, send a notification by SMS
    when the message_type is SMS;
  * ease inheritance of ``_notify_thread`` by returning computed recipients
    data. It will allow to work on it without having to re-compute it;
  * propagate kwargs from message_post and message_notify to notify methods.
    This allow to avoid depending on context and set explicit parameters.
    Drawback is that message_post and notify must separate kwargs used to
    create a message and those that are propagated to notification methods;
  * update various notification check to ensure they work on email
    notifications, notably the resend and cancel wizards;

One side effect of this commit is that notifications are created by the
relevant notification method. Previously all notifications were created
by writing on needaction_partner_ids fields then updated according to the
notification process. Notably there could be too much notification created
when sending emails due to _notify_customize_recipients not being correctly
synchronized with notification. This issue is now solved as only really
sent emails create notifications.

Migration tips

  * notification_type: notification.is_email and 'email' else 'inbox';
  * remove is_email;

Related to task 1922163
Linked to PR #33510
2019-07-12 14:54:11 +00:00