-
-
Notifications
You must be signed in to change notification settings - Fork 366
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
[16.0][MIG] delivery_carrier_package_measure_required: Migration to 16.0 #713
Conversation
2094b7e
to
c2d36c1
Compare
c2d36c1
to
f839883
Compare
...very_carrier_package_measure_required/tests/test_delivery_carrier_package_measure_require.py
Outdated
Show resolved
Hide resolved
0623c66
to
8379158
Compare
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.
Tech review, thanks for the job!
8379158
to
1452fbe
Compare
is it possible to merge this, @OCA/logistics-maintainers, 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.
Tech review, good job @RodrigoBM
d8a54b9
to
6b0ef2a
Compare
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. |
@OCA/logistics-maintainers Could you review for merge or apply the no stale label to this PR? Thanks! |
@RodrigoBM can you rebase pls? |
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.
@TDu ping for review ;)
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.
6b0ef2a
to
f05c941
Compare
Done @simahawk |
"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): |
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 think we better stick to previously existing context variable (and not invert behavior). I don't find it clearer with the new name.
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.
@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.
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.
however, the delivery_pkg_measure__ignore_package_content context I have not seen used in other OCA modules.
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 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.
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 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.
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.
ping @TDu
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.
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 🤔
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.
Is it a problem to accept this new proposal? Do you need it to be in a separate commit?
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.
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 :)
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.
Done @jbaudoux, sorry for the delay
This PR has the |
1 similar comment
This PR has the |
/ocabot migration delivery_carrier_package_measure_required |
f05c941
to
a285edf
Compare
If package is None all result packages on the stock pickings are checked | ||
otherwise only the one |
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.
If package is None all result packages on the stock pickings are checked | |
otherwise only the one |
docstring out of sync with the code ?
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.
Now that I think about it, I think so
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.
Done
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.
this is now resolved, @TDu?
a285edf
to
62f0a35
Compare
62f0a35
to
ca06d2b
Compare
@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:
|
add measures to package when you add producto to pack.
…ceptions greater granularity is implemented to control possible dimension control exceptions.
ca06d2b
to
dbe2017
Compare
Done. I will take this tip in consideration in the next contributions. |
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.
Thanks
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at fb001cb. Thanks a lot for contributing to OCA. ❤️ |
issue #534
Migration from 14.0