@@ -72,6 +72,8 @@ def _generate_sample_data(self, **kwargs):
72
72
res_id = kwargs .get ("res_id" )
73
73
res = self .browse (res_id )
74
74
75
+ res_partner_model_obj = self .env ["res.partner" ]
76
+
75
77
registrants = kwargs .get ("registrant_ids" )
76
78
membership_kinds = kwargs .get ("membership_kinds" )
77
79
num_crs = min (res .num_crs , 1000 )
@@ -83,7 +85,7 @@ def _generate_sample_data(self, **kwargs):
83
85
registrant_id = random .choice (registrants )
84
86
85
87
# Get applicants based on registrant_id
86
- registrant = self . env [ "res.partner" ] .search ([("id" , "=" , registrant_id )])[0 ]
88
+ registrant = res_partner_model_obj .search ([("id" , "=" , registrant_id )])[0 ]
87
89
if registrant .lang :
88
90
lang = registrant .lang
89
91
else :
@@ -95,7 +97,7 @@ def _generate_sample_data(self, **kwargs):
95
97
applicant_id = random .choice (applicant_ids )
96
98
97
99
# TODO: Fix error in phone number format
98
- applicant = self . env [ "res.partner" ] .search ([("id" , "=" , applicant_id )])
100
+ applicant = res_partner_model_obj .search ([("id" , "=" , applicant_id )])
99
101
if applicant .phone :
100
102
applicant_phone = applicant .phone
101
103
else :
0 commit comments