diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-12-11 11:51:06 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-12-11 11:51:06 +0700 |
| commit | 0391f0df5d30cd81b4281c3d5082bf96671bd97b (patch) | |
| tree | 687b99356f5ad4ab6699cfde8684560cb0e3c7fb /indoteknik_api/controllers/api_v1/state.py | |
| parent | 31374ed669121ba6c8ec401f82ad0bfedf07a6d6 (diff) | |
<iman> update code
Diffstat (limited to 'indoteknik_api/controllers/api_v1/state.py')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/state.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/state.py b/indoteknik_api/controllers/api_v1/state.py index 598ef70b..958359a7 100644 --- a/indoteknik_api/controllers/api_v1/state.py +++ b/indoteknik_api/controllers/api_v1/state.py @@ -8,7 +8,11 @@ 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)) + name = kw.get('name') if name: @@ -18,7 +22,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) |
