-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
[17.0][MIG] delivery_roulier: Migration to 17.0 #826
Conversation
2b31945
to
14f3bb5
Compare
e569ac5
to
71d8f32
Compare
71d8f32
to
c98ece8
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.
Migration technically LGTM
c98ece8
to
82d3d6a
Compare
@@ -290,3 +290,17 @@ def open_website_url(self): | |||
action["domain"] = [("id", "in", packages.ids)] | |||
action["context"] = {"picking_id": self.id} | |||
return action | |||
|
|||
def _put_in_pack(self, 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.
I've splitted correctly the migration commit to pre-commit
one.
Here is the latest fixup to update quant_ids
on the package with all quants from move lines in this package.
@rousseldenis @Camille0907
thanks for the reviews
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.
Hello,
I don't get why we need this, not why it is in this module. Is this necessary for this module to work ? Why ?
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.
Hello @florian-dacosta
From my POV, when the package is created and quants are put in pack, it should be linked to a package.
Probably it was a case in previous versions, but not in v17.
As a result here:
def _roulier_get_parcel(self, picking):
self.ensure_one()
weight = self.shipping_weight or self.weight
parcel = {"weight": weight, "reference": self.name}
return parcel
shipping_weight
or weight
are missed and roulier response is wrong.
If you can check the code and suggest better solution it would be great.
BTW, I'm not an expert using this module. But, I need it to be migrated for my project.
Thanks in advance.
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.
Well, I believe it has always been this way. When you click on "put in pack" button, the pack is set on the operations (stock.move.line) but if you check the pack, it is still empty (no quant inside). This is not specific to the v17.
I understand it may be an issue, if you want to generate the label, before validating the picking, which is not the way odoo works.
The label generation is triggered at the end of "stock.picking._action_done". At this stage, the quant are already linked to the pack, so the weight is ok.
I guess it would be nice to be able to generate label before the validation of the shipping, but :
- This is not a problem specific to delivery_roulier, I think it could be an issue for any module managing the carrier label. If I should pick a module with something like that, I'd probably create a new dedicated module, which you could choose to install or not, along with delivery_roulier (or any other module managing shipping labels).
- The way to do it does not seem ok to me. Indeed, the button put_in_pack is optional, you can also set the result_package_id of the stock.move.line manually (in this case the weight won't be ok either)
After you set a result package id, you can remove it manually... You can delete the stock.move.line, you can change the pack, you can do anything. Then, the package on some quants will be wrong, which is an issue.
Also, you have a source package and a result package on stock.move.line. When a quant is already in a pack, when you transfer it, the source package is filled. If you write the pack on the quant with the "put in pack" button, then the source package should probably be set, not sure about the impacts.
Anyway, I have no solution to propose around this subject now, but this one should definitely not go here and should probably be well tested as well, with the different cases.
@rousseldenis is this migration ok now? |
@@ -290,3 +290,17 @@ def open_website_url(self): | |||
action["domain"] = [("id", "in", packages.ids)] | |||
action["context"] = {"picking_id": self.id} | |||
return action | |||
|
|||
def _put_in_pack(self, 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.
Well, I believe it has always been this way. When you click on "put in pack" button, the pack is set on the operations (stock.move.line) but if you check the pack, it is still empty (no quant inside). This is not specific to the v17.
I understand it may be an issue, if you want to generate the label, before validating the picking, which is not the way odoo works.
The label generation is triggered at the end of "stock.picking._action_done". At this stage, the quant are already linked to the pack, so the weight is ok.
I guess it would be nice to be able to generate label before the validation of the shipping, but :
- This is not a problem specific to delivery_roulier, I think it could be an issue for any module managing the carrier label. If I should pick a module with something like that, I'd probably create a new dedicated module, which you could choose to install or not, along with delivery_roulier (or any other module managing shipping labels).
- The way to do it does not seem ok to me. Indeed, the button put_in_pack is optional, you can also set the result_package_id of the stock.move.line manually (in this case the weight won't be ok either)
After you set a result package id, you can remove it manually... You can delete the stock.move.line, you can change the pack, you can do anything. Then, the package on some quants will be wrong, which is an issue.
Also, you have a source package and a result package on stock.move.line. When a quant is already in a pack, when you transfer it, the source package is filled. If you write the pack on the quant with the "put in pack" button, then the source package should probably be set, not sure about the impacts.
Anyway, I have no solution to propose around this subject now, but this one should definitely not go here and should probably be well tested as well, with the different cases.
I'll remove the part I've proposed. |
Thanks, I'll approve then. |
of course, thanks |
@florian-dacosta I've checked your fix in v17. Still the same issue:
so weight is not properly updated in |
The fix was not related to the weight issue, it was about picking tracking link. |
82d3d6a
to
0fa989c
Compare
ah sorry I forgot to update, wait a sec |
@florian-dacosta |
Oh, I understand. After checking the test both on v16 and v17, here is the change that did break the delivery_roulier test : |
I'll prepare a fix |
Currently translated at 100.0% (13 of 13 strings) Translation: delivery-carrier-16.0/delivery-carrier-16.0-delivery_roulier Translate-URL: https://translation.odoo-community.org/projects/delivery-carrier-16-0/delivery-carrier-16-0-delivery_roulier/it/
0fa989c
to
225eaa1
Compare
@florian-dacosta I'm feeling like we can finish the job finally) |
BTW, if we could merge this one today we can also merge one more so it can be a very fast line day 😄 |
@rousseldenis I guess your comment is now obsolete, but if you could confirm it changing your review it would be great! |
@rousseldenis can you please update your review and in case you approve trigger the merge? |
/ocabot migration delivery_roulier |
@simahawk updated with fixup |
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.
@yankinmax cool, tnx. Don't forget to squash 😉
e0820aa
to
9b07dd9
Compare
/ocabot merge nopbump |
Hi @simahawk. Your command failed:
Ocabot commands
More information
|
/ocabot merge nobump |
On my way to merge this fine PR! |
Congratulations, your PR was merged at f219c96. Thanks a lot for contributing to OCA. ❤️ |
Depends on: