summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/solr/product_template.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-10-23 11:23:42 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-10-23 11:23:42 +0700
commit3a8d2713d749ce40d3755d4e0b22898ace4b0d6d (patch)
tree91cbe11ba25529f8d6235a3c90f5d125abf34b2f /indoteknik_custom/models/solr/product_template.py
parent7e734333e198e8405ce49ef96f5cb347b0a892d4 (diff)
parent2016ebabb250d1fe521d9b00668b7fa4313dff81 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/solr/product_template.py')
-rw-r--r--indoteknik_custom/models/solr/product_template.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/indoteknik_custom/models/solr/product_template.py b/indoteknik_custom/models/solr/product_template.py
index aa1708cc..25d7d4b8 100644
--- a/indoteknik_custom/models/solr/product_template.py
+++ b/indoteknik_custom/models/solr/product_template.py
@@ -5,6 +5,7 @@ from datetime import datetime
class ProductTemplate(models.Model):
_inherit = "product.template"
+ unpublished = fields.Boolean(string='Unpublished')
last_update_solr = fields.Datetime(string='Last Update Solr')
desc_update_solr = fields.Char(string='Desc Update Solr')
@@ -23,7 +24,7 @@ class ProductTemplate(models.Model):
'function_name': function_name
})
- @api.constrains('name', 'default_code', 'weight', 'x_manufacture', 'public_categ_ids', 'search_rank', 'search_rank_weekly', 'image_1920', 'active')
+ @api.constrains('name', 'default_code', 'weight', 'x_manufacture', 'public_categ_ids', 'search_rank', 'search_rank_weekly', 'image_1920', 'unpublished')
def _create_solr_queue_sync_product_template(self):
self._create_solr_queue('_sync_product_template_to_solr')
@@ -80,7 +81,7 @@ class ProductTemplate(models.Model):
"category_name": category_name,
"description_t": template.website_description or '',
'has_product_info_b': True,
- 'publish_b': template.active and template.type == 'product',
+ 'publish_b': not template.unpublished,
"qty_sold_f": template.qty_sold
})