Skip to content

Commit 25c7e21

Browse files
authored
fix: state_id
1 parent 12f084e commit 25c7e21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

res_partner.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
from_partner = modelsFrom.execute_kw(dbFrom, uidFrom, pwdFrom, 'res.partner', 'read', [partner_id], {'fields': ['name', 'street', 'street', 'city', 'state_id', 'country_id']})
3232

3333
if from_partner['state_id']:
34-
country_id = modelsFrom.execute_kw(dbFrom, uidFrom, pwdFrom, 'res.country.state', 'search', [[['id', '=', from_partner['state_id']]]], {'limit': 1})
34+
state_id = modelsFrom.execute_kw(dbFrom, uidFrom, pwdFrom, 'res.country.state', 'search', [[['id', '=', from_partner['state_id']]]], {'limit': 1})
3535
else:
36-
country_id = False
36+
state_id = False
3737

3838
if from_partner['country_id']:
3939
country_id = modelsFrom.execute_kw(dbFrom, uidFrom, pwdFrom, 'res.country', 'search', [[['id', '=', from_partner['country_id']]]], {'limit': 1})
@@ -48,4 +48,4 @@
4848
'state_id': state_id[0],
4949
'country_id': country_id[0]
5050
}])
51-
print(to_partner)
51+
print(to_partner)

0 commit comments

Comments
 (0)