-
-
Notifications
You must be signed in to change notification settings - Fork 666
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][ADD] stock_quant_package_fast_move #1428
base: 16.0
Are you sure you want to change the base?
[16.0][ADD] stock_quant_package_fast_move #1428
Conversation
@angelinaanaki Thanks for this. Couldn't you use a batch picking flow instead (several picking at once) - and maybe extend that process ? |
05b91f5
to
8b5b8ab
Compare
Hi @rousseldenis just wondering why should we use the batch picking flow if we can transfer multiple package in a singe picking using package level? |
Ok, need testing the flow |
f2fa39a
to
e48963d
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.
Code review LGTM. Please fix comment regarding link format in the /readme files and squash commits afterwards
58899f6
to
372a0b2
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.
All features work as expected
372a0b2
to
f2d8214
Compare
2669c53
to
4ae70da
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.
Functional LGTM
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!
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.
In some files, you have an incorrect license reference.
The link is http://www.gnu.org/licenses/lgpl and you need http://www.gnu.org/licenses/agpl
Please review the files and correct them.
Everything else is fine
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
or if the destination package does not belong to the specified location. | ||
""" | ||
# Check if the location is different from the current location | ||
if location == self[0].location_id and not destination_package: |
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 do you only check the location_id in the first package?
What will happen if packages from different location_ids are selected?
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.
Before this, validation ensures the source location is the same for all packages. - https://github.com/OCA/stock-logistics-workflow/pull/1428/files#diff-8d3622c031c6c7da6edf3c7e1d6e83021cacb13df6f5cc2f25b518262fae59deR47
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 spot where is that check? And why is this necessary that they are all in the same source location?
if location == self[0].location_id and not destination_package: | |
if location in self.location_id and not destination_package: |
stock_quant_package_fast_move/wizard/stock_quant_package_fast_move_wizard.py
Outdated
Show resolved
Hide resolved
stock_quant_package_fast_move/wizard/stock_quant_package_fast_move_wizard.py
Outdated
Show resolved
Hide resolved
def create_new_package(self): | ||
""" | ||
Create a new stock package. | ||
|
||
Returns: | ||
- package (recordset of stock.quant.package): The newly created package object. | ||
""" | ||
package = self.env["stock.quant.package"].create({}) | ||
return package |
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 just create a package inline?
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 just create a package inline?
This is in case someone would need to implement some custom flow here
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
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
picking.action_confirm() | ||
picking.button_validate() | ||
if no_validate: |
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.
Should't it be if not no_validate
?
If you check 'Don't Validate', the created internal picking won't be validated. Otherwise, it will be validated and the package will directly moved to the specified destination location
""" | ||
Move packages to a specified location. | ||
|
||
Parameters: | ||
- location (recordset of stock.location): The destination location. | ||
- destination_package (recordset of stock.quant.package, optional): | ||
Optional destination package. If provided, it must belong to the specified location. | ||
- no_validate (boolean, optional): | ||
- validate (boolean, optional): |
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 set to True, the created picking will be validated. Otherwise it will remain in the "Ready" state.
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.
Thank you for your review. Could you please check it again?
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
9cdb07a
to
8f56ef0
Compare
8f56ef0
to
888da7c
Compare
} | ||
|
||
def check_source_location(self): | ||
if any(package.location_id != self[0].location_id for package in self): |
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 remove this restriction because this scenario is possible.
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
1bbcb4b
to
d0a585a
Compare
1c7779d
to
cbf149d
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.
LGTM
- validate (boolean, optional): | ||
If set to True, the created picking will be validated. | ||
Otherwise it will remain in the "Ready" state. Defaults to 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.
validate
is required in args, is this docstring accurate?
99bff74
to
b70bc8b
Compare
@hoangtrann Thank you very much for your review! The issue was due to the moves being created only at the package level while in the 'draft' state, as seen here. I resolved this by adding the 'done' state after the picking confirmation. Could you please review it again and let me know your thoughts? |
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.
Looking good, package is now showing content if not validate immediately
eb21513
to
874ec61
Compare
test-requirements.txt
Outdated
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.
stock_picking_move_package_to_package was merged, please remove it from thetest-requirements
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. I’ve removed stock_picking_move_package_to_package from the test-requirements.
a1c45ce
to
729119c
Compare
This PR has the |
729119c
to
d43ab73
Compare
ee64a74
to
dafbc70
Compare
Hey @OCA/logistics-maintainers would be great to have this PR merged. Not only it's already "ready for merge" but also has "fast" in the 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.
Just minor remarks. I wonder if all the options are necessary (validate & batch)?
What happens if the moved package was reserved by another operation? Do you want to allow the move?
string="Package Move Operation", | ||
domain="[('show_entire_packs', '=', True)]", | ||
) | ||
use_batch_transfers = fields.Boolean() |
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 there any use for having this option?
"context": self.env.context, | ||
} | ||
|
||
def create_batch_transfer( |
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.
def create_batch_transfer( | |
def _move_with_batch_transfer( |
use_batch_transfers = active_company.use_batch_transfers | ||
|
||
if use_batch_transfers: | ||
self.create_batch_transfer( |
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.
self.create_batch_transfer( | |
self._move_with_batch_transfer( |
location, destination_package, validate, picking_type_id | ||
) | ||
else: | ||
# Create a picking |
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 you create a method for above option, create also a method for this option like
_move_with_picking(location, destination_package, validate, picking_type_id)
to be consistent
|
||
return True | ||
|
||
def create_new_package(self): |
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 you need this hook, then move it inside the wizard as this serves the wizard only
"stock.location", "Destination Location", required=True | ||
) | ||
put_in_new_package = fields.Boolean("Put in New Package") | ||
validate = fields.Boolean() |
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 there any use for not validating the movement?
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 yes, sometimes we create a picking and then validate it later when goods a physically moved.
@@ -0,0 +1,15 @@ | |||
- Go to **Inventory -> Products -> Packages**. | |||
|
|||
- Open a package or select several packages in the list view. **Important**: All selected packages must be located in the same location. |
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.
The important restriction was dropped. This need to be removed then. And the location check here to be fixed https://github.com/OCA/stock-logistics-workflow/pull/1428/files#r1444030377
Hi @jbaudoux , first of all - thank you for your review! Regarding your question - sounds reasonable. Let us check this. |
Return created picking after move package to new location
This PR is dependent on changes introduced in PR #1422, specifically on the module stock_picking_move_package_to_package.