<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/mail/models/mail_tracking_value.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: Reserve mis-referenced trackings to system users</title>
<updated>2020-06-03T11:55:08+00:00</updated>
<author>
<name>David Beguin</name>
<email>dbe@odoo.com</email>
</author>
<published>2020-06-03T10:17:13+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=859537d77cafc6edc6411e6838ce5c09038172f2'/>
<id>859537d77cafc6edc6411e6838ce5c09038172f2</id>
<content type='text'>
Note : Manual forward port recovering from commit ae1e70eba10112170283cfc17fa95d94dd948d2b

Purpose
=======

Let's say that the field 'foo' is tracked and defined with a res.group.

When the field is modified, a mail.tracking.value is generated, but the
reference to the field name is a char field.

When displaying the mail.tracking.values on the chatter, a check is done
according to the field group to decide whether we should display it or not
to the user. See: c7aa8c5#diff-ad8b6db158187579d2208f233d993c3cR43

So if I rename the field, and if the mail.tracking.value is not modified,
the mail.tracking.value magically appears to the users who shouldn't
access it before.

Note: If the migration is correctly handled, this shouldn't be the case.
But manual manipulations on the database could lead to this issue.

Specification
=============

If the field referenced by the mail_tracking_value doesn't seem to exist,
then display its value to system users only, by security.

closes #39016

closes odoo/odoo#52348

Taskid: 2088634
X-original-commit: 19bc081e4a71042c3f009e4af641da18fc16bdfe
Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Note : Manual forward port recovering from commit ae1e70eba10112170283cfc17fa95d94dd948d2b

Purpose
=======

Let's say that the field 'foo' is tracked and defined with a res.group.

When the field is modified, a mail.tracking.value is generated, but the
reference to the field name is a char field.

When displaying the mail.tracking.values on the chatter, a check is done
according to the field group to decide whether we should display it or not
to the user. See: c7aa8c5#diff-ad8b6db158187579d2208f233d993c3cR43

So if I rename the field, and if the mail.tracking.value is not modified,
the mail.tracking.value magically appears to the users who shouldn't
access it before.

Note: If the migration is correctly handled, this shouldn't be the case.
But manual manipulations on the database could lead to this issue.

Specification
=============

If the field referenced by the mail_tracking_value doesn't seem to exist,
then display its value to system users only, by security.

closes #39016

closes odoo/odoo#52348

Taskid: 2088634
X-original-commit: 19bc081e4a71042c3f009e4af641da18fc16bdfe
Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] mail: track fields based on ir_model_fields</title>
<updated>2019-11-19T07:50:34+00:00</updated>
<author>
<name>Kevin Baptiste</name>
<email>kba@odoo.com</email>
</author>
<published>2019-10-18T11:43:32+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=2c6cd81f30a991fd21b0f93fe41ed25736943e79'/>
<id>2c6cd81f30a991fd21b0f93fe41ed25736943e79</id>
<content type='text'>
The tracked field is now a relation to the corresponding ir.model.field.
This prevents potential privacy issues should the field be deleted or renamed.

closes odoo/odoo#39232

Taskid: 2088634
Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The tracked field is now a relation to the corresponding ir.model.field.
This prevents potential privacy issues should the field be deleted or renamed.

closes odoo/odoo#39232

Taskid: 2088634
Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: Reserve mis-referenced trackings to system users</title>
<updated>2019-10-18T12:19:10+00:00</updated>
<author>
<name>Kevin Baptiste</name>
<email>kba@odoo.com</email>
</author>
<published>2019-10-18T09:30:21+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7b8038c4bd8bd24b6028e747d554b9f0da879134'/>
<id>7b8038c4bd8bd24b6028e747d554b9f0da879134</id>
<content type='text'>
Purpose
=======

Let's say that the field 'foo' is tracked and defined with a res.group.

When the field is modified, a mail.tracking.value is generated, but the
reference to the field name is a char field.

When displaying the mail.tracking.values on the chatter, a check is done
according to the field group to decide whether we should display it or not
to the user. See: odoo/odoo@c7aa8c5#diff-ad8b6db158187579d2208f233d993c3cR43

So if I rename the field, and if the mail.tracking.value is not modified,
the mail.tracking.value magically appears to the users who shouldn't
access it before.

Note: If the migration is correctly handled, this shouldn't be the case.
But manual manipulations on the database could lead to this issue.

Specification
=============

If the field referenced by the mail_tracking_value doesn't seem to exist,
then display its value to system users only, by security.

closes odoo/odoo#39033

Taskid: 2088634
X-original-commit: ae1e70eba10112170283cfc17fa95d94dd948d2b
Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purpose
=======

Let's say that the field 'foo' is tracked and defined with a res.group.

When the field is modified, a mail.tracking.value is generated, but the
reference to the field name is a char field.

When displaying the mail.tracking.values on the chatter, a check is done
according to the field group to decide whether we should display it or not
to the user. See: odoo/odoo@c7aa8c5#diff-ad8b6db158187579d2208f233d993c3cR43

So if I rename the field, and if the mail.tracking.value is not modified,
the mail.tracking.value magically appears to the users who shouldn't
access it before.

Note: If the migration is correctly handled, this shouldn't be the case.
But manual manipulations on the database could lead to this issue.

Specification
=============

If the field referenced by the mail_tracking_value doesn't seem to exist,
then display its value to system users only, by security.

closes odoo/odoo#39033

Taskid: 2088634
X-original-commit: ae1e70eba10112170283cfc17fa95d94dd948d2b
Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] *: remove usage of `oldname` attribute</title>
<updated>2019-08-05T09:36:41+00:00</updated>
<author>
<name>Christophe Simonis</name>
<email>chs@odoo.com</email>
</author>
<published>2019-08-05T09:07:26+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=886eca0131716e137e60a1e398a9fc3996dfa425'/>
<id>886eca0131716e137e60a1e398a9fc3996dfa425</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>[REM] *: calls to @api.multi</title>
<updated>2019-07-17T12:13:12+00:00</updated>
<author>
<name>Adrian Torres</name>
<email>adt@odoo.com</email>
</author>
<published>2019-07-10T12:59:37+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4b38cc6590abcb58a0ca102a06063eb3db7ac1f4'/>
<id>4b38cc6590abcb58a0ca102a06063eb3db7ac1f4</id>
<content type='text'>
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'`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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'`
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] mail: Rename groups field of mail.tracking.value</title>
<updated>2019-04-17T15:05:17+00:00</updated>
<author>
<name>Lucas Lefèvre</name>
<email>lul@odoo.com</email>
</author>
<published>2019-03-15T08:33:19+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=fbf9b55c5b1af68999fccd5dd168e5eb67af4880'/>
<id>fbf9b55c5b1af68999fccd5dd168e5eb67af4880</id>
<content type='text'>
This commit renames the `groups` field into
`field_groups`.

The previous name was impossible to grep as
the word `groups` is everywhere in the code base.

Also the new name better follows the implicit convention
that fields related to the tracked field all start
with `field_`.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit renames the `groups` field into
`field_groups`.

The previous name was impossible to grep as
the word `groups` is everywhere in the code base.

Also the new name better follows the implicit convention
that fields related to the tracked field all start
with `field_`.
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] mail: Delete tracking values when uninstalling module</title>
<updated>2019-04-17T15:05:17+00:00</updated>
<author>
<name>Lucas Lefèvre</name>
<email>lul@odoo.com</email>
</author>
<published>2019-03-14T15:11:17+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=8d2d41068d364f67c4da3eb68eb1f3c95e3c479c'/>
<id>8d2d41068d364f67c4da3eb68eb1f3c95e3c479c</id>
<content type='text'>
Purpose
=======
mail.tracking.values should be deleted when the corresponding
field is deleted (when the module which defined it is uninstalled).

Firstly because we don't want useless data in db.

Secondly because the groups associated with the field can no longer
be checked if it was deleted. As we don't know to whom the value
was restricted, the value should not be displayed anyway.
Note: this case was fixed in saas-12.2 by b9e96b7 but the proper
way to fix it is to delete the tracking values.

Specification
=============

Delete `mail.tracking.value` when the associated
`ir.model.fields` is deleted.

Two alternatives were considered:

1. Change the `field` field of `mail.tracking.value` from Char
to a m2o to `ir.model.fields` which allows to use delete
oncascade. This implies to modify existing code, but more
importantly it adds database queries.

2. Override the unlink method of `ir.model.fields` to
first unlink associated tracking values.

The first method is probably cleaner but the second method
was nonetheless chosen as we don't want to impact
performance in the main tracking flow only to better
support module uninstalls which happens rarely.

Note: when a module is uninstalled, `ir.model.fields`
are unlinked one by one (in a for loop). Tracking values are
therefore also unlinked field by field. Batchifying field
deletion would greatly reduce the amount of queries.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purpose
=======
mail.tracking.values should be deleted when the corresponding
field is deleted (when the module which defined it is uninstalled).

Firstly because we don't want useless data in db.

Secondly because the groups associated with the field can no longer
be checked if it was deleted. As we don't know to whom the value
was restricted, the value should not be displayed anyway.
Note: this case was fixed in saas-12.2 by b9e96b7 but the proper
way to fix it is to delete the tracking values.

Specification
=============

Delete `mail.tracking.value` when the associated
`ir.model.fields` is deleted.

Two alternatives were considered:

1. Change the `field` field of `mail.tracking.value` from Char
to a m2o to `ir.model.fields` which allows to use delete
oncascade. This implies to modify existing code, but more
importantly it adds database queries.

2. Override the unlink method of `ir.model.fields` to
first unlink associated tracking values.

The first method is probably cleaner but the second method
was nonetheless chosen as we don't want to impact
performance in the main tracking flow only to better
support module uninstalls which happens rarely.

Note: when a module is uninstalled, `ir.model.fields`
are unlinked one by one (in a for loop). Tracking values are
therefore also unlinked field by field. Batchifying field
deletion would greatly reduce the amount of queries.
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] mail: Check field exists when computing groups</title>
<updated>2019-03-05T08:55:02+00:00</updated>
<author>
<name>Lucas Lefèvre</name>
<email>lul@odoo.com</email>
</author>
<published>2019-02-25T09:27:08+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=120b8768bb5d5f61a66ca539ac49ca8cfe1f37a7'/>
<id>120b8768bb5d5f61a66ca539ac49ca8cfe1f37a7</id>
<content type='text'>
Steps to reproduce:

1. install `hr_contract_salary`

2. create a contract

3. set or update `hr_responsible_id` on the contract
(it creates a `mail.tracking.value`)

4. uninstall `hr_contract_salary`

5. go to the contract form view
=&gt; traceback `hr_responsible_id` does not exist

Before displaying a `mail.tracking.value`, `groups` of the
fields are checked to fitler tracking values according to access
rights of the user.
However if the module that added the field has been uninstalled,
the field does not exists anymore.

Fix:
check if field exists before getting fields groups.
If the field does not exists: set groups to `base.group_system`

closes odoo/odoo#31398

Signed-off-by: "Yannick Tivisse (yti)" &lt;yti@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps to reproduce:

1. install `hr_contract_salary`

2. create a contract

3. set or update `hr_responsible_id` on the contract
(it creates a `mail.tracking.value`)

4. uninstall `hr_contract_salary`

5. go to the contract form view
=&gt; traceback `hr_responsible_id` does not exist

Before displaying a `mail.tracking.value`, `groups` of the
fields are checked to fitler tracking values according to access
rights of the user.
However if the module that added the field has been uninstalled,
the field does not exists anymore.

Fix:
check if field exists before getting fields groups.
If the field does not exists: set groups to `base.group_system`

closes odoo/odoo#31398

Signed-off-by: "Yannick Tivisse (yti)" &lt;yti@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] mail: allow tracking on groups protected fields</title>
<updated>2019-02-13T10:03:33+00:00</updated>
<author>
<name>Lucas Lefèvre</name>
<email>lul@odoo.com</email>
</author>
<published>2019-02-08T12:17:23+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c7aa8c5f669b5aa8d9789b812d0105ac0c4928c5'/>
<id>c7aa8c5f669b5aa8d9789b812d0105ac0c4928c5</id>
<content type='text'>
Purpose
=======

Currently fields with a `groups` attribute can't be tracked.
Otherwise changes would be visible by all in the chatter, including
users which normally don't have the access rights because they are
not members of `groups`.

Specification
=============

Filter tracking field values according to the `groups` attributes.
Users without the access rights should not see them.

If a message is only composed of tracking values and the user doesn't
have the rights to see them, an empty message should not be displayed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purpose
=======

Currently fields with a `groups` attribute can't be tracked.
Otherwise changes would be visible by all in the chatter, including
users which normally don't have the access rights because they are
not members of `groups`.

Specification
=============

Filter tracking field values according to the `groups` attributes.
Users without the access rights should not see them.

If a message is only composed of tracking values and the user doesn't
have the rights to see them, an empty message should not be displayed.
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] mail: rename and merge tracking-related parameters</title>
<updated>2019-01-04T11:46:14+00:00</updated>
<author>
<name>Thibault Delavallée</name>
<email>tde@odoo.com</email>
</author>
<published>2018-11-06T11:20:41+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=09ad56bcd647d94b08615e5a92974d450a9c9737'/>
<id>09ad56bcd647d94b08615e5a92974d450a9c9737</id>
<content type='text'>
Track_visibility field parameter allows to track field changes in mail. Since
commit https://github.com/odoo/odoo/commit/c99de4551583e801ecc6669ac456c4f7e2eef1da only updated values are tracked. Previously to that commit it
was possible to have field values being tracked whenever any other change
occurred. This feature has been removed to simplify tracking and avoid having
unnecessary values in the tracking table. In this commit we rename the
track_visibility parameter to tracking. Old parameter value is still supported
in mail for backward compatibility.

Commit https://github.com/odoo/odoo/commit/ec35eca7c6b772139c8fa143b388ad1d936bc9ea added sequence on tracking so that display of tracking values
is coherent through various chatter messages. To ease tracking configuration
it is merged with the tracking (old track_visibility) parameter. It means
tracking parameter can either be True (default sequence of 100) or an integer
giving the sequence to apply on the tracking.

Purpose of those changes is to simplify tracking configuration with studio
in mind. That way changing one parameter allow to customize the tracking of
fields in chatter.

Sequence field on mail.tracking.value model is renamed to tracking_sequence to
have a coherent namespace for tracking information. Tracking information on
ir.model.fields is also updated accordingly. To simplify manipulation boolean
value for tracking is automatically transformed into a sequence of 100.

This commit is linked to task ID 1903814 and PR #28430.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Track_visibility field parameter allows to track field changes in mail. Since
commit https://github.com/odoo/odoo/commit/c99de4551583e801ecc6669ac456c4f7e2eef1da only updated values are tracked. Previously to that commit it
was possible to have field values being tracked whenever any other change
occurred. This feature has been removed to simplify tracking and avoid having
unnecessary values in the tracking table. In this commit we rename the
track_visibility parameter to tracking. Old parameter value is still supported
in mail for backward compatibility.

Commit https://github.com/odoo/odoo/commit/ec35eca7c6b772139c8fa143b388ad1d936bc9ea added sequence on tracking so that display of tracking values
is coherent through various chatter messages. To ease tracking configuration
it is merged with the tracking (old track_visibility) parameter. It means
tracking parameter can either be True (default sequence of 100) or an integer
giving the sequence to apply on the tracking.

Purpose of those changes is to simplify tracking configuration with studio
in mind. That way changing one parameter allow to customize the tracking of
fields in chatter.

Sequence field on mail.tracking.value model is renamed to tracking_sequence to
have a coherent namespace for tracking information. Tracking information on
ir.model.fields is also updated accordingly. To simplify manipulation boolean
value for tracking is automatically transformed into a sequence of 100.

This commit is linked to task ID 1903814 and PR #28430.</pre>
</div>
</content>
</entry>
</feed>
