diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-07-28 15:09:55 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-07-28 15:09:55 +0700 |
| commit | d15ce4e186e2b77f01e8dfd03886298cc733d4c1 (patch) | |
| tree | 1b32a4c29c4fcea85070fcecb5b77a7d55d30029 /indoteknik_api/controllers/api_v1/state.py | |
| parent | deba962d7368a5c4e30441b5a640102608e3dde6 (diff) | |
| parent | 36a53535dbdc5777266fd9276b4c557259dab6be (diff) | |
<hafid> merging odoo-backup
Diffstat (limited to 'indoteknik_api/controllers/api_v1/state.py')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/state.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/indoteknik_api/controllers/api_v1/state.py b/indoteknik_api/controllers/api_v1/state.py index 958359a7..c03042e7 100644 --- a/indoteknik_api/controllers/api_v1/state.py +++ b/indoteknik_api/controllers/api_v1/state.py @@ -8,12 +8,8 @@ class District(controller.Controller): @http.route(prefix + 'state', auth='public', methods=['GET', 'OPTIONS']) @controller.Controller.must_authorized() def get_state(self, **kw): - tempo = kw.get('tempo') - parameters = [] - if tempo == 'true': - parameters.append(('country_id', '=', 100)) + parameters = [('country_id', '=', 100)] # selalu ambil country_id = 100 - name = kw.get('name') if name: name = '%' + name.replace(' ', '%') + '%' @@ -22,7 +18,7 @@ class District(controller.Controller): states = request.env['res.country.state'].search(parameters) data = [] for state in states: - data.append({ 'id': state.id, 'name': state.name}) - + data.append({'id': state.id, 'name': state.name}) + return self.response(data) |
