1
1
# Copyright 2022-2024 Tecnativa - Víctor Martínez
2
+ # Copyright 2024 Tecnativa - Carolina Fernandez
2
3
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
3
4
4
5
from odoo import fields
5
6
from odoo .tests import Form , common , new_test_user
6
7
from odoo .tests .common import users
7
8
8
- from odoo .addons .base .tests .common import DISABLED_MAIL_CONTEXT
9
-
10
9
11
10
class TestAccountMove (common .TransactionCase ):
12
11
@classmethod
13
12
def setUpClass (cls ):
14
13
super ().setUpClass ()
14
+ DISABLED_MAIL_CONTEXT = {
15
+ "tracking_disable" : True ,
16
+ "mail_create_nolog" : True ,
17
+ "mail_create_nosubscribe" : True ,
18
+ "mail_notrack" : True ,
19
+ "no_reset_password" : True ,
20
+ }
15
21
cls .env = cls .env (context = dict (cls .env .context , ** DISABLED_MAIL_CONTEXT ))
16
22
new_test_user (
17
23
cls .env , login = "test-account-user" , groups = "account.group_account_invoice"
@@ -27,15 +33,17 @@ def setUpClass(cls):
27
33
{
28
34
"name" : "Test Account" ,
29
35
"code" : "TEST" ,
30
- "account_type" : "liability_payable" ,
36
+ "user_type_id" : cls .env .ref (
37
+ "account.data_account_type_current_liabilities"
38
+ ).id ,
31
39
"reconcile" : True ,
32
40
}
33
41
)
34
42
cls .account_expense = cls .env ["account.account" ].create (
35
43
{
36
44
"name" : "Test Account" ,
37
45
"code" : "ACC" ,
38
- "account_type " : "expense" ,
46
+ "user_type_id " : cls . env . ref ( "account.data_account_type_expenses" ). id ,
39
47
}
40
48
)
41
49
cls .journal = cls .env ["account.journal" ].create (
@@ -60,6 +68,7 @@ def _create_invoice(self, move_type="in_invoice"):
60
68
move_form .invoice_date = fields .Date .from_string ("2000-01-01" )
61
69
with move_form .invoice_line_ids .new () as line_form :
62
70
line_form .product_id = self .product_a
71
+ line_form .name = "Product A\n Test description product A\n <b>B</b>"
63
72
line_form .quantity = 2
64
73
with move_form .invoice_line_ids .new () as line_form :
65
74
line_form .product_id = self .product_b
@@ -92,8 +101,10 @@ def test_invoice_action_post_equipment_1(self):
92
101
self .assertEqual (len (line_a .equipment_ids ), 2 )
93
102
self .assertEqual (len (line_b .equipment_ids ), 0 )
94
103
equipment = fields .first (equipments )
95
- self .assertEqual (equipment .name , self .product_a .name )
96
- self .assertEqual (equipment .product_id , self .product_a )
104
+ self .assertEqual (equipment .name , "Product A" )
105
+ self .assertEqual (
106
+ equipment .note , "<p>Test description product A<br><b>B</b></p>"
107
+ )
97
108
self .assertEqual (equipment .category_id .product_category_id , self .categ )
98
109
self .assertEqual (equipment .assign_date , invoice .date )
99
110
self .assertEqual (equipment .effective_date , invoice .date )
0 commit comments