Skip to content

[16.0] account_payment_sale: error generating invoice from multiple sale orders #1574

@mihien

Description

@mihien

Module

account_payment_sale

Describe the bug

After selecting multiple sale orders and trying to generate an invoice for these orders, if at least one sale order has a payment_mode_id set and at least one other does not, we get an error message.

This is due to the fact that payment_mode_id has been added to the grouping keys. And when sorting those sale orders, a comparison will be done between an int and a NoneType.

To Reproduce

16:

Steps to reproduce the behavior:

  1. Create two sale orders with the same company, the same client and same currency. But set a payment_mode_id on one of those and not the other.
  2. Select those two sale orders and generate invoices for those sale orders

Expected behavior
An invoice should be generated and we are redirected to the view of the invoice.

Additional context
The context shouldn't have any impact.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions