@@ -61,8 +61,8 @@ def setUpClass(cls):
61
61
"reconcile" : True ,
62
62
}
63
63
)
64
- (cls .partner_asus + cls .partner_c2c + cls .partner_agrolait ).with_context (
65
- force_company = cls .main_company .id
64
+ (cls .partner_asus + cls .partner_c2c + cls .partner_agrolait ).with_company (
65
+ cls .main_company .id
66
66
).write ({"property_account_payable_id" : cls .account_payable .id })
67
67
cls .general_journal = cls .journal_model .create (
68
68
{
@@ -184,9 +184,7 @@ def check_eur_currency_sct(self):
184
184
agrolait_pay_line1 = pay_lines [0 ]
185
185
accpre = self .env ["decimal.precision" ].precision_get ("Account" )
186
186
self .assertEqual (agrolait_pay_line1 .currency_id , self .eur_currency )
187
- self .assertEqual (
188
- agrolait_pay_line1 .partner_bank_id , invoice1 .invoice_partner_bank_id
189
- )
187
+ self .assertEqual (agrolait_pay_line1 .partner_bank_id , invoice1 .partner_bank_id )
190
188
self .assertEqual (
191
189
float_compare (
192
190
agrolait_pay_line1 .amount_currency , 42 , precision_digits = accpre
@@ -212,9 +210,7 @@ def check_eur_currency_sct(self):
212
210
)
213
211
self .assertEqual (agrolait_bank_line .communication_type , "normal" )
214
212
self .assertEqual (agrolait_bank_line .communication , "F1341-F1342-A1301" )
215
- self .assertEqual (
216
- agrolait_bank_line .partner_bank_id , invoice1 .invoice_partner_bank_id
217
- )
213
+ self .assertEqual (agrolait_bank_line .partner_bank_id , invoice1 .partner_bank_id )
218
214
219
215
action = self .payment_order .open2generated ()
220
216
self .assertEqual (self .payment_order .state , "generated" )
@@ -281,9 +277,7 @@ def test_usd_currency_sct(self):
281
277
asus_pay_line1 = pay_lines [0 ]
282
278
accpre = self .env ["decimal.precision" ].precision_get ("Account" )
283
279
self .assertEqual (asus_pay_line1 .currency_id , self .usd_currency )
284
- self .assertEqual (
285
- asus_pay_line1 .partner_bank_id , invoice1 .invoice_partner_bank_id
286
- )
280
+ self .assertEqual (asus_pay_line1 .partner_bank_id , invoice1 .partner_bank_id )
287
281
self .assertEqual (
288
282
float_compare (
289
283
asus_pay_line1 .amount_currency , 2042 , precision_digits = accpre
@@ -309,9 +303,7 @@ def test_usd_currency_sct(self):
309
303
)
310
304
self .assertEqual (asus_bank_line .communication_type , "normal" )
311
305
self .assertEqual (asus_bank_line .communication , "Inv9032-Inv9033" )
312
- self .assertEqual (
313
- asus_bank_line .partner_bank_id , invoice1 .invoice_partner_bank_id
314
- )
306
+ self .assertEqual (asus_bank_line .partner_bank_id , invoice1 .partner_bank_id )
315
307
316
308
action = self .payment_order .open2generated ()
317
309
self .assertEqual (self .payment_order .state , "generated" )
@@ -354,17 +346,17 @@ def create_invoice(
354
346
currency_id ,
355
347
price_unit ,
356
348
reference ,
357
- type = "in_invoice" ,
349
+ move_type = "in_invoice" ,
358
350
):
359
351
data = {
360
352
"partner_id" : partner_id ,
361
353
"reference_type" : "none" ,
362
354
"ref" : reference ,
363
355
"currency_id" : currency_id ,
364
356
"invoice_date" : time .strftime ("%Y-%m-%d" ),
365
- "type " : type ,
357
+ "move_type " : move_type ,
366
358
"payment_mode_id" : cls .payment_mode .id ,
367
- "invoice_partner_bank_id " : cls .env .ref (partner_bank_xmlid ).id ,
359
+ "partner_bank_id " : cls .env .ref (partner_bank_xmlid ).id ,
368
360
"invoice_line_ids" : [],
369
361
}
370
362
line_data = {
@@ -375,5 +367,5 @@ def create_invoice(
375
367
}
376
368
data ["invoice_line_ids" ].append ((0 , 0 , line_data ))
377
369
inv = cls .env ["account.move" ].create (data )
378
- inv .post ()
370
+ inv .action_post ()
379
371
return inv
0 commit comments