Skip to content

Commit

Permalink
[FIX] sale: Sale order note line is not present in generated invoice
Browse files Browse the repository at this point in the history
Steps to reproduce the bug:
- Create a sale order with a product and a note line
- Confirm it
- Add the delivered quantity
- Click "Create invoice"

Bug:
The note line is not present in the generated invoice.

Inspired by: https://github.com/odoo/odoo/blob/bc8856baaa97ac386ce6115919c49d28fd2aab73/addons/sale/models/sale.py#L657-L659

opw:2362321

closes odoo#61225

X-original-commit: ff4f1ea
Signed-off-by: backspac <backspac@users.noreply.github.com>
  • Loading branch information
backspac committed Nov 3, 2020
1 parent 23063ca commit 42d2195
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/sale/models/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,9 @@ def _create_invoices(self, grouped=False, final=False):
if line.display_type == 'line_section':
pending_section = line
continue
if float_is_zero(line.qty_to_invoice, precision_digits=precision):
if line.display_type != 'line_note' and float_is_zero(line.qty_to_invoice, precision_digits=precision):
continue
if line.qty_to_invoice > 0 or (line.qty_to_invoice < 0 and final):
if line.qty_to_invoice > 0 or (line.qty_to_invoice < 0 and final) or line.display_type == 'line_note':
if pending_section:
invoice_vals['invoice_line_ids'].append((0, 0, pending_section._prepare_invoice_line()))
pending_section = None
Expand Down

0 comments on commit 42d2195

Please sign in to comment.