diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-06-19 13:14:29 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-06-19 13:14:29 +0700 |
| commit | 38ac8a13e20e8197c4f4acce5e667ce3ac51e820 (patch) | |
| tree | 7cbc6476d0892e52eb4b6bcf218f480796d33ccf /indoteknik_api/controllers/api_v1 | |
| parent | 393228f1b25d3fa460d8300c45642e66edbca88a (diff) | |
<hafid> fix province api
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -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) |
