diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 14:38:58 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 14:38:58 +0700 |
| commit | d2a64b4e6023f0768d5c326c833fd5a9d8a11444 (patch) | |
| tree | 98149f6da42a924b7ad1a1b01c50feeaa138a0bb /indoteknik_api/controllers | |
| parent | 8bb3696e35dc122ea153566834a48ec0659e0101 (diff) | |
| parent | fb9b47c3fb5773782f84628764a01c5deb9be035 (diff) | |
Merge branch 'odoo-backup' of bitbucket.org:altafixco/indoteknik-addons into cr_renca_find
merge
Diffstat (limited to 'indoteknik_api/controllers')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/category.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/category.py b/indoteknik_api/controllers/api_v1/category.py index 7d66ad01..4514c2a0 100644 --- a/indoteknik_api/controllers/api_v1/category.py +++ b/indoteknik_api/controllers/api_v1/category.py @@ -250,4 +250,17 @@ class Category(controller.Controller): category = category.parent_frontend_id categories.reverse() - return self.response(categories, headers=[('Cache-Control', 'max-age=3600, public')])
\ No newline at end of file + return self.response(categories, headers=[('Cache-Control', 'max-age=3600, public')]) + + @http.route(prefix + 'category/<int:id>/short-desc', auth='public', methods=['GET', 'OPTIONS']) + @controller.Controller.must_authorized() + def get_category_short_desc(self, id, **kw): + category = request.env['product.public.category'].browse(id) + + if not category.exists(): + return self.response(code=400, description='Category not found') + + return self.response({ + "id": category.id, + "short_desc": category.short_desc or "" + }, headers=[('Cache-Control', 'max-age=600, public')]) |
