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 #60940

Signed-off-by: backspac <backspac@users.noreply.github.com>
  • Loading branch information
backspac committed Oct 29, 2020
1 parent d4207b9 commit ff4f1ea
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 @@ -577,7 +577,7 @@ def action_invoice_create(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 group_key not in invoices:
inv_data = order._prepare_invoice()
Expand All @@ -592,7 +592,7 @@ def action_invoice_create(self, grouped=False, final=False):
if order.client_order_ref and order.client_order_ref not in invoices_name[group_key]:
invoices_name[group_key].append(order.client_order_ref)

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:
section_invoice = pending_section.invoice_line_create_vals(
invoices[group_key].id,
Expand Down

0 comments on commit ff4f1ea

Please sign in to comment.