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

[16.0][MIG] purchase_order_secondary_unit #2216

Merged
merged 25 commits into from
Nov 14, 2024

Conversation

dalonsod
Copy link
Contributor

@dalonsod dalonsod commented Mar 27, 2024

Supersedes #2068

@SirAionTech tried to make every change suggested at that PR (removed unnecessary changes and fix splitted in a standalone commit). One test fails (at least locally), still need work.

cc @acsonefho @anddago78

@SirAionTech
Copy link

@dalonsod dalonsod force-pushed the 16.0-mig-purchase_order_secondary_unit branch from 4325613 to 03c0de5 Compare April 5, 2024 11:16
@dalonsod
Copy link
Contributor Author

dalonsod commented Apr 5, 2024

@SirAionTech done!!!

Copy link

@SirAionTech SirAionTech left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
I only looked at the code.

It would be nice if all the migration changes that do not have to be backported could go in the same [MIG] commit, maybe you could set yourself as co-author of the [MIG] commit, if the original author @yajo agrees?

Could you please also squash the bots commits as explained in https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests#mergesquash-the-commits-generated-by-bots-or-weblate?

purchase_order_secondary_unit/models/purchase_order.py Outdated Show resolved Hide resolved
Comment on lines 65 to 67
self.assertEqual(line.secondary_uom_qty, 3.5)
self.assertEqual(line.product_qty, 2450000.0)
self.assertEqual(line.secondary_uom_qty, 3500.0)
Copy link

@SirAionTech SirAionTech Apr 9, 2024

Choose a reason for hiding this comment

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

I am concerned about this change: the test was expecting line.secondary_uom_qty == 3.5, now it happens that line.secondary_uom_qty == 3500.
Usually when this happens it means that there might be something to be fixed in the code, or some cache value to be reset in the test, but the test's assertions shouldn't be changed in a migration.

Or maybe are you saying that the test was asserting something wrong already in 15.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure why these changes were made, maybe @yajo could help us, as original change (at least partially) was made by him, if I'm not wrong

Comment on lines 21 to 32
if hasattr(super(), "_compute_product_qty"):
return super()._compute_product_qty()
self._compute_helper_target_field_qty()
return super()._compute_product_qty()

Choose a reason for hiding this comment

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

Could you please clarify what the bug was?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is explained by original author in commit description

Fix a bug when calling super's _compute_product_qty() was skipping the compute helper from the mixin.

Choose a reason for hiding this comment

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

I had read that already, but saying that the bug was "the helper was not called" does not help me understand what the bug was.

Why do we need to call the helper? What is the error or issue happening without this change?

@dalonsod
Copy link
Contributor Author

dalonsod commented Apr 9, 2024

hello @SirAionTech thanks for the comments. Most of them are related to changes made by other contributors, I've only superseded them, prorizing commits authorship and thus, last changes made by other people, so I'm not able to answer some of that questions you've made. On my own, I solved your last questions about separating commits and fixed a pending test, supposing other changes in core were right, indeed (maybe I did a bad choice).

I could rollback every change that seems to be unnecessary or inadequate (or simply start from scratch), but I'd wait for @acsonefho and @anddago78 feedback

@yajo
Copy link
Member

yajo commented Apr 11, 2024

I think it's good to respect others' authorship. But if you need to squash some things because some commits won't have sense in the final consolidated history, at least tag them as co-authored.

@dalonsod dalonsod force-pushed the 16.0-mig-purchase_order_secondary_unit branch 2 times, most recently from 2429a86 to db5887e Compare April 23, 2024 12:24
@dalonsod
Copy link
Contributor Author

It would be nice if all the migration changes that do not have to be backported could go in the same [MIG] commit, maybe you could set yourself as co-author of the [MIG] commit, if the original author @yajo agrees?

Could you please also squash the bots commits as explained in https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests#mergesquash-the-commits-generated-by-bots-or-weblate?

I've preserved changes in separated commits because one of them was marked as fix by original author, so it can be backported.

And merged bots commits as required

@dalonsod
Copy link
Contributor Author

dalonsod commented May 6, 2024

Hello, @SirAionTech could you review again? Thanks!

Copy link

@SirAionTech SirAionTech left a comment

Choose a reason for hiding this comment

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

Thanks for squashing the commits! I have noticed that 4b1b2f8 is missing, maybe it has been squashed by mistake, could you please check?

Also some threads from previous review #2216 (review) still have to be resolved.

Comment on lines 21 to 32
if hasattr(super(), "_compute_product_qty"):
return super()._compute_product_qty()
self._compute_helper_target_field_qty()
return super()._compute_product_qty()

Choose a reason for hiding this comment

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

I had read that already, but saying that the bug was "the helper was not called" does not help me understand what the bug was.

Why do we need to call the helper? What is the error or issue happening without this change?

purchase_order_secondary_unit/models/purchase_order.py Outdated Show resolved Hide resolved
@pilarvargas-tecnativa
Copy link
Contributor

please include #2311

@sergio-teruel
Copy link
Contributor

@dalonsod Can you add this commit from 15 7b728cd?

Do you have planned finished the migration work?

Thanks

carlosdauden and others added 6 commits November 13, 2024 16:40
Fix a bug when calling super's `_compute_product_qty()` was skipping the compute helper from the mixin.

@moduon MT-3483

Co-authored-by: Andrea Cattalani <22261939+anddago78@users.noreply.github.com>
… qty set to 1

Co-authored-by: David Alonso // Solvos <david.alonso@solvos.es>
…secondary uom without product in sale order line

TT51683
@dalonsod dalonsod force-pushed the 16.0-mig-purchase_order_secondary_unit branch from db5887e to ee8f610 Compare November 13, 2024 16:05
@dalonsod
Copy link
Contributor Author

please include #2311

@pilarvargas-tecnativa added

Can you add this commit from 15 7b728cd?

@sergio-teruel added

@dalonsod
Copy link
Contributor Author

Do you have planned finished the migration work?

@sergio-teruel this PR has been a little headache for me, because I've superseded a PR that had been superseded another one as well. I've tried to preserve some improvements/contributions added by previous authors, some of them technically complex for my current knowledge of recent Odoo versions, or difficult to understand. Most of pending tasks are finished IMO, but some of them are still pending.

Not sure if I can resume this in the next weeks, so feel free to supersede it, if you're ready for it...

Copy link
Contributor

@sergio-teruel sergio-teruel left a comment

Choose a reason for hiding this comment

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

Functional review OK
code review!

@pedrobaeza
Copy link
Member

/ocabot migration purchase_order_secondary_unit
/ocabot merge nobump

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Nov 14, 2024
@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 16.0-ocabot-merge-pr-2216-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot mentioned this pull request Nov 14, 2024
53 tasks
@OCA-git-bot OCA-git-bot merged commit 150d2c0 into OCA:16.0 Nov 14, 2024
9 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 0b4e9d7. Thanks a lot for contributing to OCA. ❤️

@dalonsod dalonsod deleted the 16.0-mig-purchase_order_secondary_unit branch November 14, 2024 08:06
@SirAionTech
Copy link

/ocabot migration purchase_order_secondary_unit
/ocabot merge nobump

@pedrobaeza some things I mentioned in #2216 (review) are still missing, for instance commit 4b1b2f8 has not been ported: it has probably been squashed by mistake in some other commit.

@pedrobaeza
Copy link
Member

Sorry, didn't know. Can any of you do the corresponding followup PR?

@SirAionTech
Copy link

Sorry, didn't know. Can any of you do the corresponding followup PR?

For what I see, the open comments cannot be fixed afterwards.

I wouldn't know how to do a PR to restore a commit that has been squashed in some other commit, even if I added an empty commit (just to mention that the commit's author helped with the translations) the history would be wrong.

Another unresolved comment is for understanding why a change has been made, for instance:

Why do we need to call the helper? What is the error or issue happening without this change?

(from #2216 (comment)).
I couldn't do a PR to fix that either.

I was just waiting for some answers and being asked to update the review.
Maybe the comments were not important enough to block the migration, but an answer would have been appreciated anyway.

Just please have a better look at
image
before merging.

@pedrobaeza
Copy link
Member

Well, the usual flow for blocking a PR is to put "Changes requested". Sorry anyway for not looking with enough care.

@SirAionTech
Copy link

Well, the usual flow for blocking a PR is to put "Changes requested".

That is what I did in #2216 (review)
image
and that results in
image
(the tooltip is shown on hover)

Please let me know if I had to do something different: if I'm reviewing things wrong I'd like to know before creating more confusion in other pull requests.

Sorry anyway for not looking with enough care.

Appreciate it, thanks :)

@pedrobaeza
Copy link
Member

No, you didn't. You pressed on "Comment", not on "Request changes". You did code suggestions, but that's something different.

imagen

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.