summaryrefslogtreecommitdiff
path: root/indoteknik_api
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-01-14 13:59:17 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-01-14 13:59:17 +0700
commitc57a8aa2bebecb5c196b08d98bd48ba886f60718 (patch)
tree14b635a9ac6f5a8cdbf7ceb47bb4006ecda243b3 /indoteknik_api
parentd2bc3e1d20f196628edaf6956777ca332b8d5063 (diff)
parentb99d9b8b770f6ae24e9de87e50b66868052d0de5 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into gudang-service
merge
Diffstat (limited to 'indoteknik_api')
-rw-r--r--indoteknik_api/controllers/api_v1/category.py15
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')])