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

[FIX] stock: print the delivery address on slip when using packages #165194

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

mathcoutant
Copy link

Issue

The delivery slip of a picking with a package doesn't print the delivery address of the partner.

Steps to reproduce:

  1. Go to Settings > Inventory > Operations and enable 'Packages'
  2. Go to Inventory > Configuration > Warehouse Management > Operations Types
  3. Open operation type 'Delivery Orders' and enable 'Show Detailed Operations' and 'Move Entire Packages'
  4. Create a package: in Purchase, new RFQ, select products, confirm order, receive products, click on 'Put in Pack' and validate
  5. In Inventory create a new Delivery Order, select a Delivery Address and the package you just created
  6. Mark it as Done, validate and print the delivery slip
  7. The delivery address is not the right one (the one selected on step 5)

Cause:

When creating the moves for the items in the package, the partner_id is not given. So the moves don't have the field partner_id. When the method should_print_delivery_address() of stock_picking is called, it returns False as self.move_ids[0].partner_id is undefined, and the delivery address is not printed.

Solution:

Add the partner_id in _generate_moves() of stock_package_level to create the moves with the selected partner_id.

opw-3901104


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

@robodoo
Copy link
Contributor

robodoo commented May 13, 2024

@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label May 13, 2024
Copy link
Contributor

@adwid adwid left a comment

Choose a reason for hiding this comment

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

Can you add a test ?
I will then look at the fix :)

You can simplify the step 4 by updating the inventory with the data you want (that way you avoid the process of a PO + receipt)
I let you check the use of the method _update_available_quantity in the tests

@mathcoutant mathcoutant force-pushed the 16.0-opw-3901104-wrong_delivery_address_on_pdf-mcou branch 4 times, most recently from fa2636c to e75ead8 Compare May 15, 2024 14:07
@mathcoutant mathcoutant requested a review from adwid May 16, 2024 06:39
@mathcoutant mathcoutant force-pushed the 16.0-opw-3901104-wrong_delivery_address_on_pdf-mcou branch 4 times, most recently from 8668faf to 11251e2 Compare May 16, 2024 08:40
The delivery slip of a picking with a package doesn't print the delivery address of the partner.

Steps to reproduce:
1. Go to Settings > Inventory > Operations and enable 'Packages'
2. Go to Inventory > Configuration > Warehouse Management > Operations Types
3. Open operation type 'Delivery Orders' and enable 'Show Detailed Operations' and 'Move Entire Packages'
4. Create a package: in Purchase, new RFQ, select products, confirm order, receive products, click on 'Put in Pack' and validate
5. In Inventory create a new Delivery Order, select a Delivery Address and the package you just created
6. Mark it as Done, validate and print the delivery slip
7. The delivery address is not the right one (the one selected on step 5)

Cause:
When creating the moves for the items in the package the partner_id is not given. So the moves don't have the field partner_id. When the method should_print_delivery_address() of stock_picking is called it returns False as self.move_ids[0].partner_id is undefined and the delivery address is not printed.

Solution:
Add the partner_id in _generate_moves() of stock_package_level to create the moves with the selected partner_id.

opw-3901104
@mathcoutant mathcoutant force-pushed the 16.0-opw-3901104-wrong_delivery_address_on_pdf-mcou branch from 11251e2 to 89e386a Compare May 16, 2024 08:42
@adwid adwid changed the title [FIX] stock: wrong address on delivery slip when using packages [FIX] stock: print the delivery address on slip when using packages May 16, 2024
@adwid adwid marked this pull request as ready for review May 16, 2024 09:48
@C3POdoo C3POdoo requested a review from a team May 16, 2024 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants