<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/odoo/addons/base/models, 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] base: confusion between werkzeug.urls and urls local</title>
<updated>2021-05-20T16:36:04+00:00</updated>
<author>
<name>Xavier Morel</name>
<email>xmo@odoo.com</email>
</author>
<published>2021-05-20T08:33:49+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=6e084cefb62fdc94b94d0ef573dce28bfe8961e1'/>
<id>6e084cefb62fdc94b94d0ef573dce28bfe8961e1</id>
<content type='text'>
As part of the Python 3 compatibility effort,
01e35141479b8dfc4a390518f89fc52e7cec5396 moved all uses of urllib(2)
to werkzeug &amp; requests as the packages were renamed and reorganised
between P2 and P3.

For `module.py`, it looks like I confused the `urls` local variable
for an already imported `werkzeug.urls` and just tried calling
`url_parse` on that. Which doesn't work, because `urls` is a
dict.

Fixes #71076

closes odoo/odoo#71117

X-original-commit: 0cfe528de82c1de8971e5bb5f66103447eae781c
Signed-off-by: Xavier Morel (xmo) &lt;xmo@odoo.com&gt;
Signed-off-by: Adrian Torres (adt) &lt;adt@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
As part of the Python 3 compatibility effort,
01e35141479b8dfc4a390518f89fc52e7cec5396 moved all uses of urllib(2)
to werkzeug &amp; requests as the packages were renamed and reorganised
between P2 and P3.

For `module.py`, it looks like I confused the `urls` local variable
for an already imported `werkzeug.urls` and just tried calling
`url_parse` on that. Which doesn't work, because `urls` is a
dict.

Fixes #71076

closes odoo/odoo#71117

X-original-commit: 0cfe528de82c1de8971e5bb5f66103447eae781c
Signed-off-by: Xavier Morel (xmo) &lt;xmo@odoo.com&gt;
Signed-off-by: Adrian Torres (adt) &lt;adt@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] base/ir_model: fix materialized views columns listing</title>
<updated>2021-05-18T17:01:08+00:00</updated>
<author>
<name>Alvaro Fuentes</name>
<email>afu@odoo.com</email>
</author>
<published>2021-04-16T08:00:14+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b886722028c461b2d4f699d12174298c084c5bd1'/>
<id>b886722028c461b2d4f699d12174298c084c5bd1</id>
<content type='text'>
When there is a materialized view that has not been populated any select
on it will fail.

Example of traceback:
```
Traceback (most recent call last):
  File "/home/odoo/src/odoo/12.0/odoo/service/server.py", line 1162, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/odoo/src/odoo/12.0/odoo/modules/loading.py", line 367, in load_modules
    registry.setup_models(cr)
  File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 262, in setup_models
    env['ir.model']._add_manual_models()
  File "/home/odoo/src/odoo/12.0/odoo/addons/base/models/ir_model.py", line 321, in _add_manual_models
    cr.execute('SELECT * FROM %s LIMIT 0' % Model._table)
  File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 148, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 225, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.ObjectNotInPrerequisiteState: materialized view "x_bi_sql_view_report_copy" has not been populated
HINT:  Use the REFRESH MATERIALIZED VIEW command.
```

Several upgrade requests have or had had this error which has been
solved with specific scripts.

Related to #40930

closes odoo/odoo#71002

X-original-commit: b208570ce8399bc6d3e4a8ba02eef6558e0a6ccc
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When there is a materialized view that has not been populated any select
on it will fail.

Example of traceback:
```
Traceback (most recent call last):
  File "/home/odoo/src/odoo/12.0/odoo/service/server.py", line 1162, in preload_registries
    registry = Registry.new(dbname, update_module=update_module)
  File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/home/odoo/src/odoo/12.0/odoo/modules/loading.py", line 367, in load_modules
    registry.setup_models(cr)
  File "/home/odoo/src/odoo/12.0/odoo/modules/registry.py", line 262, in setup_models
    env['ir.model']._add_manual_models()
  File "/home/odoo/src/odoo/12.0/odoo/addons/base/models/ir_model.py", line 321, in _add_manual_models
    cr.execute('SELECT * FROM %s LIMIT 0' % Model._table)
  File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 148, in wrapper
    return f(self, *args, **kwargs)
  File "/home/odoo/src/odoo/12.0/odoo/sql_db.py", line 225, in execute
    res = self._obj.execute(query, params)
psycopg2.errors.ObjectNotInPrerequisiteState: materialized view "x_bi_sql_view_report_copy" has not been populated
HINT:  Use the REFRESH MATERIALIZED VIEW command.
```

Several upgrade requests have or had had this error which has been
solved with specific scripts.

Related to #40930

closes odoo/odoo#71002

X-original-commit: b208570ce8399bc6d3e4a8ba02eef6558e0a6ccc
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] mail: allow to force the FROM headers of the outgoing mail server</title>
<updated>2021-05-17T11:14:53+00:00</updated>
<author>
<name>std-odoo</name>
<email>std@odoo.com</email>
</author>
<published>2021-04-14T07:23:06+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=13ff118da832a339d9cb43d74bf0b5dd0cf3c036'/>
<id>13ff118da832a339d9cb43d74bf0b5dd0cf3c036</id>
<content type='text'>
Purpose
=======
We want to be able to force the FROM headers when we sent email in
SMTP. So we can avoid the emails to be considered as spam.

Specifications
==============
This is done with 2 system parameters.

If the system parameter `mail.force.smtp.from` is set we encapsulate all
outgoing email from with the given value.

If the previous system parameter is not set and if both
`mail.dynamic.smtp.from` and `mail.catchall.domain` are set, we
encapsulate the FROM only if the domain of the email is not the same as
the domain of the catchall parameter.

Otherwise we do not encapsulate the email (same behavior as before this
commit).

Task 2367946
See odoo/odoo/pull/61853

closes odoo/odoo#70854

X-original-commit: 044532aed6f796cd93e37556b4a8ce47d2c23a7c
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Signed-off-by: Olivier Dony (odo) &lt;odo@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purpose
=======
We want to be able to force the FROM headers when we sent email in
SMTP. So we can avoid the emails to be considered as spam.

Specifications
==============
This is done with 2 system parameters.

If the system parameter `mail.force.smtp.from` is set we encapsulate all
outgoing email from with the given value.

If the previous system parameter is not set and if both
`mail.dynamic.smtp.from` and `mail.catchall.domain` are set, we
encapsulate the FROM only if the domain of the email is not the same as
the domain of the catchall parameter.

Otherwise we do not encapsulate the email (same behavior as before this
commit).

Task 2367946
See odoo/odoo/pull/61853

closes odoo/odoo#70854

X-original-commit: 044532aed6f796cd93e37556b4a8ce47d2c23a7c
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Signed-off-by: Olivier Dony (odo) &lt;odo@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] *: update documentation links Following the recent reorganisation of the documentation in 12.0+, the majority of the documents have been moved and their old links are no longer valid. Some redirection rules will soon be deployed, but those rules might be dropped in some years and we want the links to still work, which is why we still replace the links to the new ones.</title>
<updated>2021-05-17T08:25:31+00:00</updated>
<author>
<name>Victor Feyens</name>
<email>vfe@odoo.com</email>
</author>
<published>2021-05-12T14:07:43+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=598dda32f48ffeb64cbd398c6ffb1fe7577468f2'/>
<id>598dda32f48ffeb64cbd398c6ffb1fe7577468f2</id>
<content type='text'>
FW-Port of odoo/odoo#70675 (13.0)

closes odoo/odoo#70728

X-original-commit: 85c24961ab9ff5c1c79eb7415c97c46d9a77cca3
Related: odoo/enterprise#18283
Signed-off-by: Victor Feyens (vfe) &lt;vfe@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
FW-Port of odoo/odoo#70675 (13.0)

closes odoo/odoo#70728

X-original-commit: 85c24961ab9ff5c1c79eb7415c97c46d9a77cca3
Related: odoo/enterprise#18283
Signed-off-by: Victor Feyens (vfe) &lt;vfe@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] base: error when no field to reflect</title>
<updated>2021-05-12T14:29:00+00:00</updated>
<author>
<name>Raphael Collet</name>
<email>rco@odoo.com</email>
</author>
<published>2021-05-11T16:21:01+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=5145c97fcab85fb836605d1b68322f329c43b024'/>
<id>5145c97fcab85fb836605d1b68322f329c43b024</id>
<content type='text'>
We have observed that in some circumstances, there is no field to
reflect on a given model.  Avoid an exception in that case.

closes odoo/odoo#70774

Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have observed that in some circumstances, there is no field to
reflect on a given model.  Avoid an exception in that case.

closes odoo/odoo#70774

Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] website_event_track: fix new track notifications by email</title>
<updated>2021-05-03T12:53:59+00:00</updated>
<author>
<name>std-odoo</name>
<email>std@odoo.com</email>
</author>
<published>2021-04-27T09:18:10+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=45ffab08a7c1dacc70d331077198f92884b53646'/>
<id>45ffab08a7c1dacc70d331077198f92884b53646</id>
<content type='text'>
Bug
===
1. Create an event which allows track proposal
2. Follow it and subscribe to "New Track"
3. Log in in incognito and submit a proposal

The email is not sent, because it's sent as the public user, which has
no email address set. And so it the 2 system parameters
&lt;mail.catchall.domain&gt; and &lt;mail.default.from&gt; are not set, we can not
know which email address used to send the email.

Note that this bug also occurs if you create a track with a user without
an email address set.

Task 2510181

closes odoo/odoo#69890

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Bug
===
1. Create an event which allows track proposal
2. Follow it and subscribe to "New Track"
3. Log in in incognito and submit a proposal

The email is not sent, because it's sent as the public user, which has
no email address set. And so it the 2 system parameters
&lt;mail.catchall.domain&gt; and &lt;mail.default.from&gt; are not set, we can not
know which email address used to send the email.

Note that this bug also occurs if you create a track with a user without
an email address set.

Task 2510181

closes odoo/odoo#69890

Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] base: Fix wrong wording for error when archiving a contact with a user still linked to it</title>
<updated>2021-04-27T12:31:13+00:00</updated>
<author>
<name>Kamen Zhekov</name>
<email>kzh@odoo.com</email>
</author>
<published>2021-04-20T13:14:04+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=073a4a3d1dbc8ac973c963c6b53d23ba1635bfe4'/>
<id>073a4a3d1dbc8ac973c963c6b53d23ba1635bfe4</id>
<content type='text'>
Description of the issue/feature this PR addresses and current behavior before PR:
There is a discrepancy in the wording of the error message provided. The error reads that an 'internal user' is linked but really its a 'portal user.'.

Desired behavior after PR is merged:
The wording of the error is clearer, and it now says 'portal user' instead of 'internal user'.

OPW: 2498139

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#69925

X-original-commit: cdd94cddc2ba3478bb41227896609aded2bd8548
Signed-off-by: Simon Goffin (sig) &lt;sig@openerp.com&gt;
Signed-off-by: Kamen Zhekov &lt;kzhekov@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Description of the issue/feature this PR addresses and current behavior before PR:
There is a discrepancy in the wording of the error message provided. The error reads that an 'internal user' is linked but really its a 'portal user.'.

Desired behavior after PR is merged:
The wording of the error is clearer, and it now says 'portal user' instead of 'internal user'.

OPW: 2498139

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#69925

X-original-commit: cdd94cddc2ba3478bb41227896609aded2bd8548
Signed-off-by: Simon Goffin (sig) &lt;sig@openerp.com&gt;
Signed-off-by: Kamen Zhekov &lt;kzhekov@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] base: ensure_one in ir.sequence._get_prefix_suffix</title>
<updated>2021-04-20T12:07:29+00:00</updated>
<author>
<name>wan</name>
<email>wan@odoo.com</email>
</author>
<published>2021-04-20T08:48:05+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=804934cec9380a12e1d10c7f4110102c86233fdf'/>
<id>804934cec9380a12e1d10c7f4110102c86233fdf</id>
<content type='text'>
The try/except is there to check that the string can be interpolated, so
it is catching a ValueError. But if there is a singleton error (when the
length of `self` is bigger than 1), it will raise a ValueError too.
The UserError raised in the except is then weird/wrong.

closes odoo/odoo#69538

X-original-commit: 36ebbb6f312d488b33bae098546ff71baf578a08
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
Signed-off-by: William André (wan) &lt;wan@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The try/except is there to check that the string can be interpolated, so
it is catching a ValueError. But if there is a singleton error (when the
length of `self` is bigger than 1), it will raise a ValueError too.
The UserError raised in the except is then weird/wrong.

closes odoo/odoo#69538

X-original-commit: 36ebbb6f312d488b33bae098546ff71baf578a08
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
Signed-off-by: William André (wan) &lt;wan@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] base: avoid infinite recursion on attachments search</title>
<updated>2021-04-19T08:41:14+00:00</updated>
<author>
<name>Andrea Grazioso (agr-odoo)</name>
<email>agr@odoo.com</email>
</author>
<published>2021-03-29T13:18:31+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=f1a5ad5f20bf1b885a3c2dc2248b8fb15b2d6565'/>
<id>f1a5ad5f20bf1b885a3c2dc2248b8fb15b2d6565</id>
<content type='text'>
Have a large number of attachments with res_field set
Then go to Settings -&gt; Technical -&gt; Attachments -&gt; add a filter "Res
Field" is set.

You will have traceback. This occur because the `_search` function will
omit from results records with res_field set, forcing recursive calls
until either we scan the whole table (80 records at a time) or we hit
max recursion limit

opw-2463634

closes odoo/odoo#69443

X-original-commit: 08fb44a1f8af9684c28c0dd5e82121193d9bef9a
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Have a large number of attachments with res_field set
Then go to Settings -&gt; Technical -&gt; Attachments -&gt; add a filter "Res
Field" is set.

You will have traceback. This occur because the `_search` function will
omit from results records with res_field set, forcing recursive calls
until either we scan the whole table (80 records at a time) or we hit
max recursion limit

opw-2463634

closes odoo/odoo#69443

X-original-commit: 08fb44a1f8af9684c28c0dd5e82121193d9bef9a
Signed-off-by: Raphael Collet (rco) &lt;rco@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] base: Report which PDFs can't be read</title>
<updated>2021-04-09T08:00:51+00:00</updated>
<author>
<name>Raf Geens</name>
<email>raf@odoo.com</email>
</author>
<published>2021-04-01T15:39:20+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=266a8e2a8abf936d5fbd45752ddf492d92e6a397'/>
<id>266a8e2a8abf936d5fbd45752ddf492d92e6a397</id>
<content type='text'>
PyPDF2 can't read some PDFs due to bugs, lack of fault-tolerance and not
supporting some encryption schemes. When invoices are uploaded directly
through the Invoices / Accounting app, that will fail for those files
because it will try to read part of them. When invoices are uploaded
through the Documents app, they're not read, which means the customer
can end up in a situation where read and merge operations (like when
printing a selection of original vendor bills) will fail.

The structural solution for this is to replace PyPDF2 with a more capable
 library, like pikepdf: https://github.com/odoo/odoo/pull/64356 .

This change is too impactful for stable, and there are compatibility
concerns as well.

A possible workaround is merging the PDFs we can and bundling the rest
together in a zip file. This is possible on the level of just
_merge_pdfs, but the PDF extension and mimetype are pretty hard-coded
and the changes required to switch them to ZIP based on what happens in
_merge_pdfs seem too impactful.

Instead, this fix detects as early as possible if the PDFs can't be
read and reports it to the user. The excluded PDFs can still be
downloaded individually. In this way the user has a workaround
and does not need to resort to trial and error to figure out which PDFs
are causing the problem.

Related tickets: 2359929, 2389679

closes odoo/odoo#68964

X-original-commit: 7a3fb09dbc68797522a3191a3358db296f279b36
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
PyPDF2 can't read some PDFs due to bugs, lack of fault-tolerance and not
supporting some encryption schemes. When invoices are uploaded directly
through the Invoices / Accounting app, that will fail for those files
because it will try to read part of them. When invoices are uploaded
through the Documents app, they're not read, which means the customer
can end up in a situation where read and merge operations (like when
printing a selection of original vendor bills) will fail.

The structural solution for this is to replace PyPDF2 with a more capable
 library, like pikepdf: https://github.com/odoo/odoo/pull/64356 .

This change is too impactful for stable, and there are compatibility
concerns as well.

A possible workaround is merging the PDFs we can and bundling the rest
together in a zip file. This is possible on the level of just
_merge_pdfs, but the PDF extension and mimetype are pretty hard-coded
and the changes required to switch them to ZIP based on what happens in
_merge_pdfs seem too impactful.

Instead, this fix detects as early as possible if the PDFs can't be
read and reports it to the user. The excluded PDFs can still be
downloaded individually. In this way the user has a workaround
and does not need to resort to trial and error to figure out which PDFs
are causing the problem.

Related tickets: 2359929, 2389679

closes odoo/odoo#68964

X-original-commit: 7a3fb09dbc68797522a3191a3358db296f279b36
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
