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

Commits on May 29, 2024

  1. [FIX] stock: print the delivery address on slip when using packages

    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.
    This bug does not happen if action_confirm is called before setting the partner because when setting the partner the write method will change the partner_id attribute of the moves.
    
    Solution:
    Add the partner_id in _generate_moves() of stock_package_level to create the moves with the selected partner_id.
    
    opw-3901104
    mathcoutant committed May 29, 2024
    Configuration menu
    Copy the full SHA
    6828c34 View commit details
    Browse the repository at this point in the history