Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0] Improving the mail tracking value #170

Merged
merged 1 commit into from
Apr 26, 2018

Conversation

TDu
Copy link
Member

@TDu TDu commented Jun 7, 2017

Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.

@TDu TDu force-pushed the improve-tracking-value branch 2 times, most recently from 03df92e to 5cfe1a5 Compare June 7, 2017 13:29
@guewen
Copy link
Member

guewen commented Jun 7, 2017

@rafaelbn Travis is failing due to an error with Mailgun. The 10.0 branch is failing as well, do you have an idea why?

Travis logs of the 10.0 branch (https://travis-ci.org/OCA/social/jobs/234268290#L745-L746):

Mailgun: Database 'bad_db' is not the current database
Mailgun: event type 'bad_event' not supported
Mailgun: Invalid signature 'bad_signature' != '4fb6d4dbbe10ce5d620265dcd7a3c0b8ca0dede1433103891bc1ae4086e9d5b2'


_inherit = "mail.tracking.value"

new_value_formated = fields.Char(compute='_compute_formatted_value',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a "t" in fields name

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed

def _compute_formatted_value(self):
""" Sets the value formatted field used in the view """
for record in self:
if record.field_type in ('many2many', 'one2many', 'char'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we do something better here? Just guessing.... maybe we can use qweb widgets to render values in human readable mode?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the type, the values are stored in different fields, we just want to read the value from the correct field. There is no need for a particular rendering more than that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, is not required, I'm just saying that since the formatted value is always a char we can format it using qweb rendering (especially for date, datetime, monetary, etc)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simahawk ah I get it, indeed it makes sense for date, datetime, monetary, ... Can be a future improvement :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TDu can you add a comment here to remind this improvement and add a line in the README roadmap?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@yajo yajo added this to the 10.0 milestone Jun 8, 2017
@TDu TDu force-pushed the improve-tracking-value branch 2 times, most recently from 7857fe2 to b8ec2e4 Compare June 8, 2017 13:07
@rafaelbn rafaelbn requested a review from antespi June 8, 2017 21:49
Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested functionally. I think module's name must be tracking_value_improved, please change if possible


To access the new view displaying value changes :

Settings -> Technical -> Improved tracking values
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better -> Tracking Values Improved

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not correct English, Rafa

'name': 'Improved tracking value change',
'version': '10.0.1.0.0',
'summary': 'Improves tracking changes by adding many2many and one2many \
support. As well as a view to consult changes',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description is for user, normal people, they must understand what module makes but they don't know what's a many2many o similar. Please explain it from the functional point of view not a technical one

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally there is a bunch of whitespace being added here. The strings should instead be started and stopped.

'my first line. '
'my second line.'

Copy link
Member Author

@TDu TDu Jun 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, changed description and removed whitespaces.

# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
'name': 'Improved tracking value change',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO: Tracking value change improved

@rafaelbn
Copy link
Member

rafaelbn commented Jun 8, 2017

Please @carlosdauden could you check #170 (comment) thanks!

===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/{project_repo}/issues>`_. In case of trouble, please
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad link

'name': 'Improved tracking value change',
'version': '10.0.1.0.0',
'summary': 'Improves tracking changes by adding many2many and one2many \
support. As well as a view to consult changes',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally there is a bunch of whitespace being added here. The strings should instead be started and stopped.

'my first line. '
'my second line.'


import json

from odoo import models, fields, api
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetize imports

@pedrobaeza
Copy link
Member

Rebase as branch is already green

@TDu TDu force-pushed the improve-tracking-value branch 2 times, most recently from 4e528c7 to 40796ba Compare October 2, 2017 13:58
@TDu
Copy link
Member Author

TDu commented Oct 2, 2017

Change to the readme following comments.
And rebase is done.

Copy link
Contributor

@simahawk simahawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TDu can you get back on this? 😄
BTW I triggered runbot rebuild as it was killed

def _compute_formatted_value(self):
""" Sets the value formatted field used in the view """
for record in self:
if record.field_type in ('many2many', 'one2many', 'char'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TDu can you add a comment here to remind this improvement and add a line in the README roadmap?

@TDu
Copy link
Member Author

TDu commented Mar 29, 2018

I added the comment in the code and readme about improving the rendering depending of value type.
Seems like I needed a memory refresh about this module...

@rafaelbn
Copy link
Member

Hello, just a question before merging. Is there any possibility you add some test to improve codecov/patch — 28.57% of diff hit (target 97.13%). ? Please? 🙏

We have been working hard to have high coverage in this repo .

Thanks!

@TDu
Copy link
Member Author

TDu commented Apr 16, 2018

Yes sure, will do.
I also think it would be good to have some test for it.

@TDu TDu force-pushed the improve-tracking-value branch 2 times, most recently from 2f024c1 to e8c10bf Compare April 20, 2018 14:16
@TDu TDu force-pushed the improve-tracking-value branch 3 times, most recently from 7939834 to 26236f9 Compare April 26, 2018 10:55
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
@TDu
Copy link
Member Author

TDu commented Apr 26, 2018

@rafaelbn Tests are done, coverage three digits number 😁

@rafaelbn
Copy link
Member

Thank you!!!

@rafaelbn rafaelbn merged commit fc4cccb into OCA:10.0 Apr 26, 2018
ThomasBinsfeld pushed a commit to acsone/social that referenced this pull request Jul 6, 2018
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
hbrunn pushed a commit that referenced this pull request Aug 28, 2018
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
mbcosta pushed a commit to akretion/social that referenced this pull request Feb 22, 2021
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
MiquelRForgeFlow pushed a commit to ForgeFlow/social that referenced this pull request Feb 22, 2021
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
mbcosta pushed a commit to akretion/social that referenced this pull request Feb 22, 2021
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
Zar21 pushed a commit to Studio73/social that referenced this pull request Aug 12, 2021
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
BT-jaldabo pushed a commit to BT-jaldabo/social that referenced this pull request Apr 4, 2022
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
duyanhk15 pushed a commit to duyanhk15/social_k15 that referenced this pull request Sep 27, 2022
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
ferran-S73 pushed a commit to Studio73/social that referenced this pull request Nov 7, 2022
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
sonhd91 pushed a commit to duyanhk15/social_k15 that referenced this pull request Jan 9, 2023
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
ajaniszewska-dev pushed a commit to ajaniszewska-dev/social that referenced this pull request Jun 12, 2023
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
sonhd91 pushed a commit to sonhd91/social that referenced this pull request Aug 14, 2023
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
nguyenminhchien pushed a commit to nguyenminhchien/social that referenced this pull request Oct 20, 2023
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
sonhd91 pushed a commit to duyanhk15/social_k15 that referenced this pull request Feb 7, 2024
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
quoc-pn pushed a commit to quoc-pn/social that referenced this pull request Apr 25, 2024
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
quoc-pn pushed a commit to quoc-pn/social that referenced this pull request Apr 25, 2024
Improve the tracking of changed values on database fields
("mail.tracking.value" functionality) by adding many2many and one2many support.
As well as a more user friendly view to consult changes recorded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants