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] delivery_carrier_package_measure_required: Migration to 16.0 #713

Conversation

RodrigoBM
Copy link
Contributor

issue #534

Migration from 14.0

@RodrigoBM RodrigoBM changed the title [16.0][MIG] delivery_carrier_package_measure_required: Migration to 16.0 [WIP][16.0][MIG] delivery_carrier_package_measure_required: Migration to 16.0 Oct 3, 2023
@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch from 2094b7e to c2d36c1 Compare October 3, 2023 12:00
@RodrigoBM RodrigoBM mentioned this pull request Oct 3, 2023
32 tasks
@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch from c2d36c1 to f839883 Compare October 3, 2023 13:32
@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch 2 times, most recently from 0623c66 to 8379158 Compare October 4, 2023 11:32
Copy link

@xAdrianCif xAdrianCif left a comment

Choose a reason for hiding this comment

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

Tech review, thanks for the job!

@RodrigoBM RodrigoBM changed the title [WIP][16.0][MIG] delivery_carrier_package_measure_required: Migration to 16.0 [16.0][MIG] delivery_carrier_package_measure_required: Migration to 16.0 Oct 19, 2023
@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch from 8379158 to 1452fbe Compare October 23, 2023 09:53
@RodrigoBM
Copy link
Contributor Author

is it possible to merge this, @OCA/logistics-maintainers, thank you

@RodrigoBM
Copy link
Contributor Author

Copy link

@jorgemartinez-factorlibre jorgemartinez-factorlibre left a comment

Choose a reason for hiding this comment

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

Tech review, good job @RodrigoBM

@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch 3 times, most recently from d8a54b9 to 6b0ef2a Compare January 10, 2024 17:05
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label May 12, 2024
@hugosantosred
Copy link
Member

hugosantosred commented May 21, 2024

@OCA/logistics-maintainers Could you review for merge or apply the no stale label to this PR? Thanks!

@simahawk simahawk added no stale Use this label to prevent the automated stale action from closing this PR/Issue. and removed stale PR/Issue without recent activity, it'll be soon closed automatically. labels May 21, 2024
@simahawk
Copy link
Contributor

@RodrigoBM can you rebase pls?

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 ping for review ;)

TDu and others added 6 commits May 21, 2024 13:58
This module adds the possibility to flag some measurements on package to be
required for delivery.
The required dimensions on a package need not to be enforce before the
picking is being done (package with content).
Because that blocks any preparation on the package before it is
delivered.

But we still want to be able to check if the package is valid at will.
This can be done with the `delivery_pkg_measure__ignore_package_content`
context key.
@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch from 6b0ef2a to f05c941 Compare May 21, 2024 11:58
@RodrigoBM
Copy link
Contributor Author

@RodrigoBM can you rebase pls?

Done @simahawk

Comment on lines 21 to 27
"delivery_pkg_measure__ignore_package_content"
"delivery_pkg_measure__ignore_package_content", False
)
force_validation = self.env.context.get(
"delivery_pkg_measure__force_validation_package", False
)
for package in self:
if not ignore_pack_content and not package.quant_ids:
if ignore_pack_content or (not force_validation and not package.quant_ids):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we better stick to previously existing context variable (and not invert behavior). I don't find it clearer with the new name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jbaudoux , I think this is better now.

Before the changes we don't check the dimensions in the case if ignore_pack_content is False and the package has no quants.
We also have a variable that is passed by context which is delivery_pkg_measure__ignore_package_content that if you pass it with the value set to True you would expect it not to check the dimensions but this is not the case.

Option1:
ignore_pack_content = True, package.quant_ids = True
(not ignore_pack_content and not package.quant_ids) if == False --> Check dimensions
Opción 2:
ignore_pack_content = True, package.quant_ids = False
(not ignore_pack_content and not package.quant_ids) if == False --> Check dimensions
Opción 3:
ignore_pack_content = False, package.quant_ids = True
(not ignore_pack_content and not package.quant_ids) if == False --> Check dimensions
Opción 4:
ignore_pack_content = False, package.quant_ids = False
(not ignore_pack_content and not package.quant_ids) if == True --> No Check dimensions

But what if we want to be able to skip the dimension check in other cases?

Option1:
ignore_pack_content = False, force_validation = True, package.quant_ids = True
ignore_pack_content or (not force_validation and not package.quant_ids) if = False --> Check dimensions
Opción 2:
ignore_pack_content = False, force_validation = True, package.quant_ids = False
ignore_pack_content or (not force_validation and not package.quant_ids) if = False --> Check dimensions
Opción 3:
ignore_pack_content = False, force_validation = False, package.quant_ids = True
ignore_pack_content or (not force_validation and not package.quant_ids) if = False --> Check dimensions
Opción 4:
ignore_pack_content = False, force_validation = False, package.quant_ids = False
ignore_pack_content or (not force_validation and not package.quant_ids) if = True --> No Check dimensions
Opción 5:
ignore_pack_content = True
ignore_pack_content or (not force_validation and not package.quant_ids) if = True --> No Check dimensions

What do you think about this? this can go in another commit if you think it is more correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

however, the delivery_pkg_measure__ignore_package_content context I have not seen used in other OCA modules.

Copy link
Contributor

Choose a reason for hiding this comment

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

I can't find any usage of this context variable. @TDu What was the purpose of it?
Do we need any of those context variables? If this is useless, I'm more in favor of simplifying. We can already configure which dimension is required.

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 understand @jbaudoux , but now I have client developments that need these contexts. We can change this "if ignore_pack_content or (not force_validation and not package.quant_ids):" to "if self.ignore_check_dimensions():" and have everyone inherit the method to whatever we need.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ping @TDu

Copy link
Member

@TDu TDu May 23, 2024

Choose a reason for hiding this comment

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

As commented in the code that content key delivery_pkg_measure__ignore_package_content was meant to be used to force asking for dimension even for empty packages.

I think the idea behind it was, you receive a new product in your warehouse, all packaging (A, B) for that product are not configured properly. The product arrives in packaging A. But you want the user to configure all packaging (A and B) for that product on first reception.

Now indeed it does not look like it is used 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it a problem to accept this new proposal? Do you need it to be in a separate commit?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the clarification @TDu
@RodrigoBM Your current proposal is fine for me. It is clear and covers all the cases.
Just put that in a separate commit :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done @jbaudoux, sorry for the delay

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

1 similar comment
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@jbaudoux
Copy link
Contributor

/ocabot migration delivery_carrier_package_measure_required

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone May 21, 2024
@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch from f05c941 to a285edf Compare May 22, 2024 13:54
Comment on lines 13 to 14
If package is None all result packages on the stock pickings are checked
otherwise only the one
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
If package is None all result packages on the stock pickings are checked
otherwise only the one

docstring out of sync with the code ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that I think about it, I think so

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor Author

@RodrigoBM RodrigoBM May 24, 2024

Choose a reason for hiding this comment

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

this is now resolved, @TDu?

@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch from a285edf to 62f0a35 Compare May 23, 2024 09:05
@RodrigoBM
Copy link
Contributor Author

ping @TDu @jbaudoux

@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch from 62f0a35 to ca06d2b Compare May 30, 2024 07:35
@jbaudoux
Copy link
Contributor

jbaudoux commented May 30, 2024

@RodrigoBM As a general rule, can you keep commit subject (first line) short and put description in the body (separated by a blank line from the subject).

Like:

delivery_carrier_package_measure_required: put in pack

Add measures to package when you add product to pack

RodrigoBM added 2 commits May 30, 2024 10:05
add measures to package when you add producto to pack.
…ceptions

greater granularity is implemented to control possible dimension control exceptions.
@RodrigoBM RodrigoBM force-pushed the 16.0-mig-delivery_carrier_package_measure_required branch from ca06d2b to dbe2017 Compare May 30, 2024 08:07
@RodrigoBM
Copy link
Contributor Author

@RodrigoBM As a general rule, can you keep commit subject (first line) short and put description in the body (separated by a blank line from the subject).

Like:

delivery_carrier_package_measure_required: put in pack

Add measures to package when you add product to pack

Done. I will take this tip in consideration in the next contributions.

Copy link
Contributor

@jbaudoux jbaudoux left a comment

Choose a reason for hiding this comment

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

Thanks

@jbaudoux
Copy link
Contributor

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-713-by-jbaudoux-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit b422a9c into OCA:16.0 May 30, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

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

@RodrigoBM RodrigoBM deleted the 16.0-mig-delivery_carrier_package_measure_required branch May 30, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved merged 🎉 no stale Use this label to prevent the automated stale action from closing this PR/Issue. ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants