summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-09-10 10:27:28 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-09-10 10:27:28 +0700
commit533f32227dd63cfe98903cf93e1a704a5a7ce696 (patch)
treec5243c7ab01f4f912a3cba9163447be429b9fbc0
parentee22bb5c668c346c5f8ba2c4e148324dab0c6a3e (diff)
parent894d4806067463fceaa2c6e6a67882e8f0bed974 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
-rwxr-xr-xindoteknik_custom/models/product_template.py6
-rw-r--r--indoteknik_custom/models/solr/website_categories_management.py12
-rw-r--r--indoteknik_custom/models/website_categories_management.py4
-rw-r--r--indoteknik_custom/views/website_categories_management.xml9
4 files changed, 9 insertions, 22 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index e6778758..000ee3bf 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -338,9 +338,9 @@ class ProductTemplate(models.Model):
return values
def write(self, vals):
- for rec in self:
- if rec.id == 224484:
- raise UserError('Tidak dapat mengubah produk sementara')
+ # for rec in self:
+ # if rec.id == 224484:
+ # raise UserError('Tidak dapat mengubah produk sementara')
return super(ProductTemplate, self).write(vals)
diff --git a/indoteknik_custom/models/solr/website_categories_management.py b/indoteknik_custom/models/solr/website_categories_management.py
index 1f4caac3..0a40a356 100644
--- a/indoteknik_custom/models/solr/website_categories_management.py
+++ b/indoteknik_custom/models/solr/website_categories_management.py
@@ -67,11 +67,11 @@ class WebsiteCategoriesHomepage(models.Model):
# Prepare Level 1 document
document = {
'id': category.id,
- 'sequence': category.sequence or '',
+ 'sequence_i': category.sequence or '',
'category_id_i': category.category_id.id,
- 'name': category.category_id.name,
- 'numFound': len(category.category_id.product_tmpl_ids),
- 'image': self.env['ir.attachment'].api_image(
+ 'name_s': category.category_id.name,
+ 'numFound_i': len(category.category_id.product_tmpl_ids),
+ 'image_s': self.env['ir.attachment'].api_image(
'product.public.category', 'image_1920', category.category_id.id
),
'categories': []
@@ -99,10 +99,10 @@ class WebsiteCategoriesHomepage(models.Model):
'product.public.category', 'image_1920', category_level_3.id
),
}
- level_2_doc['child_frontend_id_i'].append(level_3_doc)
+ level_2_doc['child_frontend_id_i'].append(json.dumps(level_3_doc))
# Add Level 2 document to Level 1
- document['categories'].append(level_2_doc)
+ document['categories'].append(json.dumps(level_2_doc))
# Sync document with Solr
self.solr().add([document])
diff --git a/indoteknik_custom/models/website_categories_management.py b/indoteknik_custom/models/website_categories_management.py
index 3b1db7dd..e430ef5f 100644
--- a/indoteknik_custom/models/website_categories_management.py
+++ b/indoteknik_custom/models/website_categories_management.py
@@ -7,10 +7,6 @@ class WebsiteCategoriesManagement(models.Model):
category_id = fields.Many2one('product.public.category', string='Category Level 1', help='table ecommerce category', domain=lambda self: self._get_default_category_domain())
sequence = fields.Integer(string='Sequence')
- category_id2 = fields.Many2many(comodel_name='product.public.category',
- relation='website_categories_category_id2_rel',
- column1='website_categories_homepage_id', column2='product_public_category_id',
- string='Category Level 2', copy=False)
line_ids = fields.One2many('website.categories.management.line', 'management_id', string='Category Level 2 Lines', auto_join=True)
status = fields.Selection([
('tayang', 'Tayang'),
diff --git a/indoteknik_custom/views/website_categories_management.xml b/indoteknik_custom/views/website_categories_management.xml
index 6e01e923..6ad85944 100644
--- a/indoteknik_custom/views/website_categories_management.xml
+++ b/indoteknik_custom/views/website_categories_management.xml
@@ -29,7 +29,6 @@
<group>
<field name="sequence"/>
<field name="category_id"/>
- <field name="category_id2" widget="many2many_tags"/>
<field name="status"/>
</group>
</group>
@@ -43,14 +42,6 @@
</tree>
</field>
</page>
- <page string="Detail category">
- <field name="category_id2">
- <tree editable="bottom">
- <field name="name"/>
- <field name="child_frontend_id2" widget="many2many_tags"/>
- </tree>
- </field>
- </page>
</notebook>
</sheet>
</form>