<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/website_forum/models/forum.py, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[FIX] mail: send notification mail with right access link when using mail.thread</title>
<updated>2021-01-06T17:03:53+00:00</updated>
<author>
<name>Achraf (abz)</name>
<email>abz@odoo.com</email>
</author>
<published>2020-10-23T06:47:54+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=79f27f640ccdd14f285a9dd9fc0ae770c992376f'/>
<id>79f27f640ccdd14f285a9dd9fc0ae770c992376f</id>
<content type='text'>
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#64170

X-original-commit: 2b6d2b71f6c60bcf64db440473c88d1dc335acbf
Related: odoo/enterprise#15588
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Co-authored-by: Achraf Ben Azzouz &lt;abz@odoo.com&gt;
Co-authored-by: Thibault Delavallée &lt;tde@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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#64170

X-original-commit: 2b6d2b71f6c60bcf64db440473c88d1dc335acbf
Related: odoo/enterprise#15588
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Co-authored-by: Achraf Ben Azzouz &lt;abz@odoo.com&gt;
Co-authored-by: Thibault Delavallée &lt;tde@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website_forum: do not copy fields</title>
<updated>2020-10-23T17:33:59+00:00</updated>
<author>
<name>Swapnesh Shah</name>
<email>swapneshshah111@gmail.com</email>
</author>
<published>2020-10-23T17:33:59+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d35acd37720e8f498f5eef319c50780eaa7cb72e'/>
<id>d35acd37720e8f498f5eef319c50780eaa7cb72e</id>
<content type='text'>
Fields `views`, `closed_reason_id`, `closed_uid` and `closed_date` should not be copied while copying post.

closes odoo/odoo#60661

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fields `views`, `closed_reason_id`, `closed_uid` and `closed_date` should not be copied while copying post.

closes odoo/odoo#60661

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] *: correct typos and bad English</title>
<updated>2020-10-29T18:07:49+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2020-10-29T15:51:43+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=62a18bdb372e234107fd2099a2df5f9e3a442c96'/>
<id>62a18bdb372e234107fd2099a2df5f9e3a442c96</id>
<content type='text'>
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61002

Related: odoo/enterprise#14485
Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Courtesy of translators
Reexport .pot of modified modules

closes odoo/odoo#61002

Related: odoo/enterprise#14485
Signed-off-by: Martin Trigaux (mat) &lt;mat@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] tools.sql, website_*: increment counter with skip lock</title>
<updated>2020-09-28T13:38:28+00:00</updated>
<author>
<name>Jeremy Kersten</name>
<email>jke@odoo.com</email>
</author>
<published>2020-09-25T15:06:36+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d92e61e89f468c2db2fbd68b2f0d6b36c77f1065'/>
<id>d92e61e89f468c2db2fbd68b2f0d6b36c77f1065</id>
<content type='text'>
*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#58534

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*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#58534

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website_{slides,forum}: enable slide content and forum creation</title>
<updated>2020-08-26T10:09:45+00:00</updated>
<author>
<name>Dharmraj Jhala</name>
<email>dja@odoo.com</email>
</author>
<published>2020-08-26T10:00:36+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a677859a03c86bf6ac791c31f52ce8609bcba594'/>
<id>a677859a03c86bf6ac791c31f52ce8609bcba594</id>
<content type='text'>
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#56573

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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#56573

Signed-off-by: Jérémy Kersten (jke) &lt;jke@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] mail: reorganize a bit 13+ thread code and set some methods private</title>
<updated>2020-08-27T14:29:48+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2020-08-27T12:23:52+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4a5fc70cfc3c86da33e2480fbd59c8f6d575c6e9'/>
<id>4a5fc70cfc3c86da33e2480fbd59c8f6d575c6e9</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website_forum: error when converting answer/comment</title>
<updated>2020-08-03T07:51:07+00:00</updated>
<author>
<name>Jorge Pinna Puissant</name>
<email>jpp@odoo.com</email>
</author>
<published>2020-07-31T07:37:53+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=aaad54bdac42ca1e85f37a2a2acdbf1f3ee522fd'/>
<id>aaad54bdac42ca1e85f37a2a2acdbf1f3ee522fd</id>
<content type='text'>
- 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) &lt;jpp@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- 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) &lt;jpp@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] website_[blog/shop/forum]: rename routes to remove 'useless' part</title>
<updated>2020-07-22T06:53:37+00:00</updated>
<author>
<name>Jeremy Kersten</name>
<email>jke@odoo.com</email>
</author>
<published>2020-07-17T12:37:58+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=01c17707bd216ad16d98766abd06e842044d052a'/>
<id>01c17707bd216ad16d98766abd06e842044d052a</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] *: correct support of multi records in methods</title>
<updated>2020-06-19T13:27:41+00:00</updated>
<author>
<name>Victor Feyens</name>
<email>vfe@odoo.com</email>
</author>
<published>2020-06-19T13:24:57+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=bdcad21ccc3b9ff5110230440eb2aa5e18e13ffa'/>
<id>bdcad21ccc3b9ff5110230440eb2aa5e18e13ffa</id>
<content type='text'>
Wrong usage of self in for loops makes some apparently multi-friendly
methods not work correctly when called with a recordset of len &gt; 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) &lt;vfe@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Wrong usage of self in for loops makes some apparently multi-friendly
methods not work correctly when called with a recordset of len &gt; 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) &lt;vfe@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] *: replace to new _() syntax</title>
<updated>2020-06-18T11:03:34+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2020-06-04T10:39:11+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ba244cef01132347df4d2d9553ea3105ba13a938'/>
<id>ba244cef01132347df4d2d9553ea3105ba13a938</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
