summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2025-12-15 13:44:06 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2025-12-15 13:44:06 +0700
commit6ebf59cda9356890dfa3fe181ab4efc1194103e9 (patch)
treeddc375cc4e8c17ca9a89f050fffaf3849b9abb49
parent0a81a44ccfdfc7219ee29b2b6f79fa73143e095d (diff)
parentc8fadfcb646ec86b73d92f199a98000aeabcbfe8 (diff)
merge
-rwxr-xr-xindoteknik_custom/models/product_template.py12
-rw-r--r--indoteknik_custom/models/solr/apache_solr.py13
-rw-r--r--indoteknik_custom/models/solr/product_product.py2
-rw-r--r--indoteknik_custom/models/solr/product_template.py2
-rwxr-xr-xindoteknik_custom/views/product_template.xml2
5 files changed, 26 insertions, 5 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 2cbef168..75adb352 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -16,7 +16,17 @@ _logger = logging.getLogger(__name__)
class ProductTemplate(models.Model):
_inherit = "product.template"
-
+ x_attribute_set_id = fields.Integer(
+ string="Magento Attribute Set ID",
+ default=0,
+ index=True,
+ help="Attribute Set ID dari Magento"
+ )
+ x_attribute_set_name = fields.Char(
+ string="Magento Attribute Set Name",
+ help="Attribute Set Name dari Magento"
+ )
+
image_carousel_lines = fields.One2many(
comodel_name="image.carousel",
inverse_name="product_id",
diff --git a/indoteknik_custom/models/solr/apache_solr.py b/indoteknik_custom/models/solr/apache_solr.py
index d111c1c1..c2283421 100644
--- a/indoteknik_custom/models/solr/apache_solr.py
+++ b/indoteknik_custom/models/solr/apache_solr.py
@@ -7,9 +7,12 @@ import time
from odoo.tools.config import config
_logger = logging.getLogger(__name__)
-_solr = pysolr.Solr('http://10.148.0.5:8983/solr/product/', always_commit=True, timeout=30)
-_variants_solr = pysolr.Solr('http://10.148.0.5:8983/solr/variants/', always_commit=True, timeout=30)
-_recommendation_solr = pysolr.Solr('http://10.148.0.5:8983/solr/recommendation/', always_commit=True, timeout=30)
+# _solr = pysolr.Solr('http://10.148.0.5:8983/solr/product/', always_commit=True, timeout=30)
+# _variants_solr = pysolr.Solr('http://10.148.0.5:8983/solr/variants/', always_commit=True, timeout=30)
+# _recommendation_solr = pysolr.Solr('http://10.148.0.5:8983/solr/recommendation/', always_commit=True, timeout=30)
+_solr = pysolr.Solr('http://localhost:8983/solr/product/', always_commit=True, timeout=30)
+_variants_solr = pysolr.Solr('http://localhost:8983/solr/variants/', always_commit=True, timeout=30)
+_recommendation_solr = pysolr.Solr('http://localhost:8983/solr/recommendation/', always_commit=True, timeout=30)
# _solr = pysolr.Solr('http://34.101.189.218:8983/solr/product/', always_commit=True, timeout=30) # for development only
@@ -24,7 +27,7 @@ class ApacheSolr(models.Model):
if env == 'development':
url = 'http://localhost:8983/solr/'
elif env == 'production':
- url = 'http://34.101.189.218:8983/solr/'
+ url = 'http://locahost:8983/solr/'
return pysolr.Solr(url + schema, always_commit=False, timeout=10)
@@ -266,6 +269,8 @@ class ApacheSolr(models.Model):
'tax_f': tax,
'stock_total_f': variant.qty_stock_vendor,
'weight_f': variant.product_tmpl_id.weight,
+ 'attribute_set_id_i': variant.product_tmpl_id.x_attribute_set_id or 0,
+ 'attribute_set_name_s': variant.product_tmpl_id.x_attribute_set_name or '',
'manufacture_id_i': variant.product_tmpl_id.x_manufacture.id or 0,
'manufacture_name_s': variant.product_tmpl_id.x_manufacture.x_name or '',
'manufacture_name': variant.product_tmpl_id.x_manufacture.x_name or '',
diff --git a/indoteknik_custom/models/solr/product_product.py b/indoteknik_custom/models/solr/product_product.py
index 7260c3ca..7df56e57 100644
--- a/indoteknik_custom/models/solr/product_product.py
+++ b/indoteknik_custom/models/solr/product_product.py
@@ -73,6 +73,8 @@ class ProductProduct(models.Model):
'image_mobile_s': ir_attachment.api_image('product.template', 'image_256', variant.product_tmpl_id.id),
'stock_total_f': variant.qty_free_bandengan,
'weight_f': variant.weight,
+ 'attribute_set_id_i': variant.product_tmpl_id.x_attribute_set_id or 0,
+ 'attribute_set_name_s': variant.product_tmpl_id.x_attribute_set_name or '',
'manufacture_id_i': variant.product_tmpl_id.x_manufacture.id or 0,
'manufacture_name_s': variant.product_tmpl_id.x_manufacture.x_name or '',
'manufacture_name': variant.product_tmpl_id.x_manufacture.x_name or '',
diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py
index a7beca12..d6ca9097 100644
--- a/indoteknik_custom/models/solr/product_template.py
+++ b/indoteknik_custom/models/solr/product_template.py
@@ -105,6 +105,8 @@ class ProductTemplate(models.Model):
"variant_total_i": template.product_variant_count,
"stock_total_f": template.qty_stock_vendor,
"weight_f": template.weight,
+ # "attribute_set_id_i": template.x_attribute_set_id or 0,
+ # "attribute_set_name_s": template.x_attribute_set_name or '',
"manufacture_id_i": template.x_manufacture.id or 0,
"manufacture_name_s": template.x_manufacture.x_name or '',
"manufacture_name": template.x_manufacture.x_name or '',
diff --git a/indoteknik_custom/views/product_template.xml b/indoteknik_custom/views/product_template.xml
index 177449f4..1933a5d1 100755
--- a/indoteknik_custom/views/product_template.xml
+++ b/indoteknik_custom/views/product_template.xml
@@ -112,6 +112,8 @@
<field name="virtual_rating"/>
<field name="search_rank"/>
<field name="solr_flag"/>
+ <field name="x_attribute_set_id"/>
+ <field name="x_attribute_set_name"/>
</field>
</field>
</record>