-
-
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
[18.0][MIG] delivery_package_number: Migration to 18.0 #932
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] delivery_package_number: Migration to 18.0 #932
Conversation
[UPD] Update delivery_package_number.pot [UPD] README.rst
[UPD] Update delivery_package_number.pot [UPD] README.rst Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: delivery-carrier-14.0/delivery-carrier-14.0-delivery_package_number Translate-URL: https://translation.odoo-community.org/projects/delivery-carrier-14-0/delivery-carrier-14-0-delivery_package_number/
…ransfer wizard if picking have not carrier. TT38549
…delivery_carrier_label module
…es wizard. TT48170
If we don't return the print action the label won't be downloaded. TT48759
61324bd
to
5331e6a
Compare
/ocabot migration delivery_package_number |
if picking.package_ids: | ||
picking.number_of_packages = len(picking.package_ids) | ||
packages = picking.move_line_ids.result_package_id | ||
if packages: |
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.
why this if
?
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.
Because we don't want to loose the info set on number_of_packages
when no packages are set when modifying the move_line_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.
Some delivery modules depend on this field number_of_packages
on the picking but not everyone need this wizard to manually enter a number of parcels.
In my opinion, this module deserves to be split in 2 modules.
I remember some old discussions on this matter. cc @mt-software-de
And it would be the occasion to make it compatible with https://github.com/OCA/delivery-carrier/pull/973/files#diff-c8a077a1b4a9e53784be8d2bd8afc36a7ef4a45e87e29ba9bd5712f1927e71c7R10
cc @rousseldenis @lmignon
number_of_packages = fields.Integer( | ||
string="Number of Packages", | ||
compute="_compute_number_of_packages", | ||
readonly=False, | ||
store=True, | ||
default=0, | ||
copy=False, | ||
) |
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.
Any chance to extract this in a separate module stock_picking_number_package
in stock-logistics-warehouse
?
Yes but the discussion was on the automatic package creation. Which was a problem when running the unittests. But still i think it would be great to separate it. |
Hi, maybe other option is add an option to ask or not the number of packages... delivery-carrier/delivery_package_number/models/stock_picking.py Lines 43 to 50 in 5331e6a
|
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.
Another remark regarding module name.
Several carrier API use the term of package number to identify the "position" of the package in a list of packages. For example, when you have 3 packages and you number them 1/3, 2/3, 3/3, the package number is 1 (2 and 3 resp.) and the package total is 3.
What about renaming this module to stock_delivery_number_packages ?
# Copyright 2020 Tecnativa - David Vidal | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Stock Picking Package Number", |
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.
Maybe align with module 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.
Done
Just a remark: module names shouldn't contain plurals |
5331e6a
to
45212d5
Compare
I have added an option to prevent the wizard from popping up in the operation type. |
@CarlosRoca13 Thanks. I prefer opt-in than opt-out options. Otherwise, set opt-out default to True |
And what about the customers who already have these modules? Will they lose a feature during the migration, or will it be necessary to include a script to disable the field for existing operation types? From my point of view, the field should remain as it is now to avoid giving customers the impression that they are losing a feature and to prevent spending extra time creating a script that would achieve the same result. What do you think? @pedrobaeza @sergio-teruel |
Yes, the default for the option should preserve the existing behavior. Those not wanting them should change that default option on their installations. |
It should be like @jbaudoux mentioned it, if someone using it already you should create a migration for it. |
|
Well, it's true that splitting into 2 modules is not something wild: |
(edited)
|
cc @Tecnativa TT52963
ping @sergio-teruel @chienandalu