-
-
Notifications
You must be signed in to change notification settings - Fork 162
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
[16.0][MIG] sale_report_margin: Migration to 16.0 #175
[16.0][MIG] sale_report_margin: Migration to 16.0 #175
Conversation
[FIX] sale_report_margin: website attribute in manifest
LGTM |
LGTM @flalexg . It seems the README is missing to be migrated. Could you check it, please? |
I made a branch from yours to increment coverage. if you find it right we can merge/cherry-pick the commit so it pases tests. factorlibre#4 |
Hi! I checked the README and I think its okey. When its merged the new README will be generated, but it has de the fragments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR has the |
1 similar comment
This PR has the |
/ocabot migration sale_report_margin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please name the commit adding the tests also with the module name according guidelines:
def _group_by_sale(self): | ||
res = super()._group_by_sale() | ||
res += """, | ||
l.purchase_price""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being this one a measure, is it needed to be grouped by it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @pedrobaeza! Sorry for the late response. You are right, its unnecessary. Deleted the function. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still see it in the PR.
7c7a9f1
to
a52077c
Compare
c183e77
to
4e17aa8
Compare
@pedrobaeza now I remember why I used de group by. psycopg2.errors.GroupingError: column "l.purchase_price" must appear in the GROUP BY clause or be used in an aggregate function Shall we keep the first commit? |
|
||
def _select_additional_fields(self): | ||
res = super()._select_additional_fields() | ||
res["purchase_price"] = "l.purchase_price" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to overwrite _select_sale
instead and do SUM(l.purchase_price)
for having this correctly and not grouping by.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, maybe this can serve:
res["purchase_price"] = "l.purchase_price" | |
res["purchase_price"] = "SUM(l.purchase_price)" |
4e17aa8
to
5845dda
Compare
Hi @pedrobaeza! @flalexg and I have been reviewing it, and, with the change you propose it works as expected. Thank you! |
Great. Note that it's not the same that the module installs without error than it works as expected, and with the group by, you would find ugly totals or unfolded results when using the module. /ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at f84626e. Thanks a lot for contributing to OCA. ❤️ |
No description provided.