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][IMP] event: Make event report inheritable. #16633

Closed
wants to merge 1 commit into from

Conversation

sergio-teruel
Copy link
Contributor

@sergio-teruel sergio-teruel commented Apr 25, 2017

Description of the issue/feature this PR addresses:
This PR makes event report inheritable for other modules as sale report
Current behavior before PR:
extend event repor tis not possible
Desired behavior after PR is merged:
You can extend the event report

--
@mart-e Can you take a look?. Thanks
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
cc @Tecnativa

event_event e
def _from(self):
from_str = """
event_event e
Copy link
Collaborator

Choose a reason for hiding this comment

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

Include here FROM word

@sergio-teruel
Copy link
Contributor Author

@pedrobaeza Changes done.

FROM
event_event e
LEFT JOIN event_registration r ON (e.id=r.event_id)
event_event e LEFT JOIN event_registration r ON (e.id=r.event_id)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why changing here the 2 lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it fit and it is short

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, but making changes here the priority is to modify the minimum number of lines, and it doesn't comply with general rule applied in other reports (one line, one table)

tools.drop_view_if_exists(self.env.cr, 'report_event_registration')
# TOFIX this request won't select events that have no registration
def _select(self):
select_str = """SELECT
Copy link
Collaborator

Choose a reason for hiding this comment

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

Don't change here the indentation

@sergio-teruel
Copy link
Contributor Author

@pedrobaeza changes done

@tivisse
Copy link
Contributor

tivisse commented May 29, 2017

@sergio-teruel Thanks for the feedback.

By the way I don't understand why you make a query and a subquery for the SELECT. Furthermore, I won't do it in 10.0 but in master instead.

Waiting your input.

@tivisse tivisse self-assigned this May 29, 2017
@sergio-teruel
Copy link
Contributor Author

@tivisse Thanks for your review, In a first commit I did not use a subquery, but in other modules that depend of event I had needed make calculation over the fields, also by this way i can add other models to query and make compute fields in the query, i think this way is more cleaner.

@tivisse
Copy link
Contributor

tivisse commented May 30, 2017

Well I still don't understand why you make a second request to retrieve all the elements you selected in the sub request. It's not correct performance wise.

IMHO you should have only one select.

@pedrobaeza
Copy link
Collaborator

@tivisse are there any chance that this can land on 10.0 if we fix it? Should we pass an OPW ticket?

@tivisse
Copy link
Contributor

tivisse commented Jun 13, 2017

@pedrobaeza If we remove the first query, I have no objections to merge this in 10.0 :)

@pedrobaeza
Copy link
Collaborator

Hi @tivisse, I have fixed the PR, removing the subquery. I have also checked that the FIXME comment is no longer applied, as events without registrations also appear on the query.

@tivisse tivisse closed this in 18152f3 Jun 21, 2017
@tivisse
Copy link
Contributor

tivisse commented Jun 21, 2017

@sergio-teruel @pedrobaeza

As the report doesn't exist anymore in master (I suppose to use a pivot view instead), I merged (exceptionally) your PR on 10.0 at 18152f3

Have a nice day.

@pedrobaeza pedrobaeza deleted the 10.0-PR-event branch June 21, 2017 10:11
@pedrobaeza
Copy link
Collaborator

Thank you very much!

I see the new approach of using pivot view over event.event with computed fields for the quantities. Indeed it seems better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants