9
9
class TestAccountCheckReport (TransactionCase ):
10
10
def setUp (self ):
11
11
super (TestAccountCheckReport , self ).setUp ()
12
- self .account_invoice_model = self .env ["account.invoice" ]
13
12
self .journal_model = self .env ["account.journal" ]
14
- self .register_payments_model = self .env ["account.register.payments" ]
13
+ self .account_move_model = self .env ["account.move" ]
14
+ self .account_move_line_model = self .env ["account.move.line" ]
15
+ self .register_payments_model = self .env ["account.payment.register" ]
15
16
self .payment_method_model = self .env ["account.payment.method" ]
16
- self .account_invoice_line_model = self .env ["account.invoice.line" ]
17
17
self .account_account_model = self .env ["account.account" ]
18
18
self .payment_model = self .env ["account.payment" ]
19
19
@@ -50,7 +50,7 @@ def setUp(self):
50
50
"type" : "bank" ,
51
51
"code" : "bank" ,
52
52
"check_manual_sequencing" : True ,
53
- "outbound_payment_method_ids " : [
53
+ "outbound_payment_method_line_ids " : [
54
54
(4 , self .payment_method_check .id , None )
55
55
],
56
56
}
@@ -69,11 +69,11 @@ def _create_account(self, name, code, user_type, reconcile):
69
69
return account
70
70
71
71
def _create_vendor_bill (self , account ):
72
- vendor_bill = self .account_invoice_model .create (
72
+ vendor_bill = self .account_move_model .with_context (
73
+ default_move_type = "in_invoice"
74
+ ).create (
73
75
{
74
- "type" : "in_invoice" ,
75
76
"partner_id" : self .partner1 .id ,
76
- "account_id" : account .id ,
77
77
"currency_id" : self .company .currency_id .id ,
78
78
"journal_id" : self .purchase_journal .id ,
79
79
"company_id" : self .company .id ,
@@ -82,13 +82,13 @@ def _create_vendor_bill(self, account):
82
82
return vendor_bill
83
83
84
84
def _create_invoice_line (self , account , invoice ):
85
- invoice_line = self .account_invoice_line_model .create (
85
+ invoice_line = self .account_move_line_model .create (
86
86
{
87
87
"name" : "Test invoice line" ,
88
88
"account_id" : account .id ,
89
89
"quantity" : 1.000 ,
90
90
"price_unit" : 2.99 ,
91
- "invoice_id " : invoice .id ,
91
+ "move_id " : invoice .id ,
92
92
"product_id" : self .product .id ,
93
93
}
94
94
)
@@ -106,7 +106,7 @@ def test_01_check_printing(self):
106
106
self ._create_invoice_line (acc_expense , vendor_bill )
107
107
vendor_bill .action_invoice_open ()
108
108
ctx = {
109
- "active_model" : "account.invoice " ,
109
+ "active_model" : "account.move " ,
110
110
"active_ids" : [vendor_bill .id ],
111
111
}
112
112
register_payments = self .register_payments_model .with_context (** ctx ).create (
@@ -134,7 +134,7 @@ def test_02_get_invoices(self):
134
134
self ._create_invoice_line (acc_expense , vendor_bill )
135
135
vendor_bill .action_invoice_open ()
136
136
ctx = {
137
- "active_model" : "account.invoice " ,
137
+ "active_model" : "account.move " ,
138
138
"active_ids" : [vendor_bill .id ],
139
139
}
140
140
register_payments = self .register_payments_model .with_context (** ctx ).create (
0 commit comments