Skip to content

Commit bea4dcb

Browse files
committed
fixup! Create module sale_invoice_line_note
1 parent 312ed45 commit bea4dcb

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

sale_invoice_line_note/tests/test_sale_invoice_line_note.py

+13
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,16 @@ def test_sale_note_to_invoice(self):
4343
)
4444
self.assertEqual(invoice_line_note.name, 'Test sale order line note')
4545
self.assertEqual(invoice_line_note.sequence, 12)
46+
47+
def test_sale_note_no_copy(self):
48+
wizard = self.env['sale.advance.payment.inv'].with_context(
49+
active_ids=self.sale_order.ids).create({
50+
'advance_payment_method': 'all',
51+
})
52+
wizard.copy_notes_to_invoice = False
53+
wizard.create_invoices()
54+
invoice = self.sale_order.invoice_ids
55+
invoice_line_note = invoice.invoice_line_ids.filtered(
56+
lambda l: l.display_type == 'line_note'
57+
)
58+
self.assertFalse(invoice_line_note)

sale_invoice_line_note/wizard/sale_make_invoice_advance.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ class SaleAdvancePaymentInv(models.TransientModel):
1717
@api.multi
1818
def create_invoices(self):
1919
if self.copy_notes_to_invoice:
20-
return super(SaleAdvancePaymentInv, self.with_context(
21-
_copy_notes=True)).create_invoices()
20+
self = self.with_context(_copy_notes=True)
2221
return super().create_invoices()

0 commit comments

Comments
 (0)