summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-14 09:02:40 +0700
committerFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-14 09:02:40 +0700
commit96b727403891f0cabcc65c9147fb5bd7ed9b33f2 (patch)
tree7b5abb35cb2d2ac3ac45e060d5f33a3ed8eb1acb
parente8291422441d48909252471282c4b72372cccefb (diff)
parentb99d9b8b770f6ae24e9de87e50b66868052d0de5 (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into magento-solr-v1
-rw-r--r--indoteknik_api/controllers/api_v1/category.py15
-rw-r--r--indoteknik_custom/models/commision.py5
-rwxr-xr-xindoteknik_custom/models/product_public_category.py1
-rwxr-xr-xindoteknik_custom/views/product_public_category.xml1
4 files changed, 20 insertions, 2 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')])
diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py
index 441dd54f..983c07fe 100644
--- a/indoteknik_custom/models/commision.py
+++ b/indoteknik_custom/models/commision.py
@@ -489,7 +489,10 @@ class CustomerCommision(models.Model):
raise UserError('Line sudah ada, tidak bisa di generate ulang')
if self.commision_type == 'fee':
- self._generate_customer_commision_fee()
+ if self.brand_ids:
+ self._generate_customer_commision_rebate()
+ else:
+ self._generate_customer_commision_fee()
else:
self._generate_customer_commision_rebate()
diff --git a/indoteknik_custom/models/product_public_category.py b/indoteknik_custom/models/product_public_category.py
index 1039ec52..dadcb181 100755
--- a/indoteknik_custom/models/product_public_category.py
+++ b/indoteknik_custom/models/product_public_category.py
@@ -15,6 +15,7 @@ class ProductPublicCategory(models.Model):
child_frontend_id = fields.One2many('product.public.category', 'parent_frontend_id', string='Children Frontend Categories')
child_frontend_id2 = fields.Many2many('product.public.category', relation='website_categories_child_frontend_rel', column1='website_categories_homepage_id', column2='product_public_category_id', string='Category Level 3')
sequence_frontend = fields.Integer(help="Gives the sequence order when displaying a list of product categories.", index=True)
+ short_desc = fields.Char(string='Short Description')
# @api.model
# def _onchange_child_frontend_id2(self, parent):
diff --git a/indoteknik_custom/views/product_public_category.xml b/indoteknik_custom/views/product_public_category.xml
index a45e0a2e..c2ee154d 100755
--- a/indoteknik_custom/views/product_public_category.xml
+++ b/indoteknik_custom/views/product_public_category.xml
@@ -22,6 +22,7 @@
<field name="image" widget="image"/>
<field name="sequence_frontend"/>
<field name="parent_frontend_id"/>
+ <field name="short_desc"/>
</xpath>
<xpath expr="//form[1]/sheet[1]/div[1]/group[1]" position="after">
<notebook>