diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-10-25 08:47:36 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-10-25 08:47:36 +0700 |
| commit | 9fa80c62cdffec5b91aaf2a2899d70d0f507c2e4 (patch) | |
| tree | 93ae8d82f774345f650bc8d072dea759c6e33363 /indoteknik_api/models | |
| parent | a21c5fe37529b2d2259d3b86d8e98730b2bc8513 (diff) | |
| parent | a7be93f4825967807f12e6bfbebcf090af8500fa (diff) | |
Merge branch 'production' into iman/switch-account
# Conflicts:
# indoteknik_api/controllers/api_v1/user.py
# indoteknik_custom/models/user_company_request.py
Diffstat (limited to 'indoteknik_api/models')
| -rw-r--r-- | indoteknik_api/models/res_users.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indoteknik_api/models/res_users.py b/indoteknik_api/models/res_users.py index 195d786f..f7fdc4ed 100644 --- a/indoteknik_api/models/res_users.py +++ b/indoteknik_api/models/res_users.py @@ -48,6 +48,7 @@ class ResUsers(models.Model): 'street': user.street or '', 'street2': user.street2 or '', 'city': None, + 'state_id': 0, 'district': None, 'sub_district': None, 'zip': user.zip or '', @@ -62,12 +63,18 @@ class ResUsers(models.Model): 'companyType': user.customer_type or 'nonpkp', } + if user.state_id: + data['state_id'] = { + 'id': user.state_id.id, + 'name': user.state_id.name + } or None + if user.kota_id: data['city'] = { 'id': user.kota_id.id, 'name': user.kota_id.name } or None - + if user.kecamatan_id: data['district'] = { 'id': user.kecamatan_id.id, |
