summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/solr/apache_solr_queue.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-02-22 14:49:25 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-02-22 14:49:25 +0700
commitda0a75bc6b7166e297bcaf175c15089e95dbbf2e (patch)
tree156cfb319848cd2b2964f83b3cb185e8f920f7b2 /indoteknik_custom/models/solr/apache_solr_queue.py
parent6850fd6f86a0fbba3156e59f9ac5836052f019ce (diff)
parent0face879a802bf1a15d1065d59db64f723b4e8d3 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models/solr/apache_solr_queue.py')
-rw-r--r--indoteknik_custom/models/solr/apache_solr_queue.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/indoteknik_custom/models/solr/apache_solr_queue.py b/indoteknik_custom/models/solr/apache_solr_queue.py
index 07274295..02ad5bb8 100644
--- a/indoteknik_custom/models/solr/apache_solr_queue.py
+++ b/indoteknik_custom/models/solr/apache_solr_queue.py
@@ -18,6 +18,7 @@ class ApacheSolrQueue(models.Model):
('not_found', 'Record not found')
], 'Execute Status')
execute_date = fields.Datetime('Execute Date')
+ description = fields.Text('Description')
def _compute_display_name(self):
for rec in self:
@@ -38,6 +39,16 @@ class ApacheSolrQueue(models.Model):
if elapsed_time > max_exec_time:
break
rec.execute_queue()
+
+ def open_target_record(self):
+ return {
+ 'name': '',
+ 'view_mode': 'form',
+ 'res_model': self.res_model,
+ 'target': 'current',
+ 'type': 'ir.actions.act_window',
+ 'res_id': self.res_id
+ }
def execute_queue(self):
for rec in self:
@@ -57,7 +68,8 @@ class ApacheSolrQueue(models.Model):
rec.execute_status = 'success'
else:
rec.execute_status = 'not_found'
- except:
+ except Exception as e:
+ rec.description = e
rec.execute_status = 'failed'
rec.execute_date = datetime.utcnow()
self.env.cr.commit()