File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -43,3 +43,16 @@ def test_sale_note_to_invoice(self):
43
43
)
44
44
self .assertEqual (invoice_line_note .name , 'Test sale order line note' )
45
45
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 )
Original file line number Diff line number Diff line change @@ -17,6 +17,5 @@ class SaleAdvancePaymentInv(models.TransientModel):
17
17
@api .multi
18
18
def create_invoices (self ):
19
19
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 )
22
21
return super ().create_invoices ()
You can’t perform that action at this time.
0 commit comments