1
1
from odoo .exceptions import ValidationError
2
2
from odoo .tests import tagged
3
- from odoo .addons .account .tests .common import AccountTestInvoicingHttpCommon
3
+ from odoo .addons .point_of_sale .tests .test_frontend import TestPointOfSaleHttpCommon
4
4
from unittest .mock import patch
5
5
from freezegun import freeze_time
6
6
7
7
8
8
@tagged ('post_install_l10n' , 'post_install' , '-at_install' )
9
- class TestPosQris (AccountTestInvoicingHttpCommon ):
9
+ class TestPosQris (TestPointOfSaleHttpCommon ):
10
10
""" Testing QRIS payment via PoS """
11
11
12
12
@classmethod
13
- @AccountTestInvoicingHttpCommon .setup_chart_template ('id' )
14
13
def setUpClass (cls ):
15
14
super ().setUpClass ()
16
- cls .company_data ['company' ].qr_code = True
17
- cls .company_data ['company' ].partner_id .update ({
15
+ cls .company .update ({
16
+ 'qr_code' : True ,
17
+ 'currency_id' : cls .env .ref ('base.IDR' ).id ,
18
+ })
19
+ cls .company .partner_id .update ({
18
20
'country_id' : cls .env .ref ('base.id' ).id ,
19
21
'city' : 'Jakarta' ,
20
22
})
23
+ cls .pos_user .write ({
24
+ "group_ids" : [
25
+ (4 , cls .env .ref ('account.group_account_invoice' ).id )
26
+ ]
27
+ })
21
28
22
29
cls .acc_qris_id = cls .env ['res.partner.bank' ].create ({
23
30
'acc_number' : '123456789012345678' ,
@@ -36,19 +43,6 @@ def setUpClass(cls):
36
43
'taxes_id' : False ,
37
44
})
38
45
39
- # Create user.
40
- cls .pos_user = cls .env ['res.users' ].create ({
41
- 'name' : 'A simple PoS man!' ,
42
- 'login' : 'pos_user' ,
43
- 'password' : 'pos_user' ,
44
- 'group_ids' : [
45
- (4 , cls .env .ref ('base.group_user' ).id ),
46
- (4 , cls .env .ref ('point_of_sale.group_pos_user' ).id ),
47
- (4 , cls .env .ref ('account.group_account_invoice' ).id ),
48
- ],
49
- })
50
-
51
- cls .company = cls .company_data ['company' ]
52
46
cls .pos_receivable_bank = cls .copy_account (cls .company .account_default_pos_receivable_account_id , {'name' : 'POS Receivable Bank' })
53
47
cls .outstanding_bank = cls .copy_account (cls .outbound_payment_method_line .payment_account_id , {'name' : 'Outstanding Bank' })
54
48
0 commit comments