diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-15 10:32:45 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2023-11-15 10:32:45 +0700 |
| commit | 4730df5bf97724cd906c8118178407bfbf206bca (patch) | |
| tree | 7d5c418d1049204ecd21b2a5ac8e8cbae354a8ec /indoteknik_custom/models | |
| parent | 132d4b80f3d5dad792468bd14961f6a9540122e2 (diff) | |
| parent | 49846bc78d282516092c6c63db63d4ea01d42949 (diff) | |
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
Diffstat (limited to 'indoteknik_custom/models')
| -rw-r--r-- | indoteknik_custom/models/commision.py | 4 | ||||
| -rw-r--r-- | indoteknik_custom/models/dunning_run.py | 1 | ||||
| -rw-r--r-- | indoteknik_custom/models/solr/apache_solr_queue.py | 5 | ||||
| -rw-r--r-- | indoteknik_custom/models/voucher.py | 2 |
4 files changed, 9 insertions, 3 deletions
diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index d4942a0d..a11d85c7 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -148,6 +148,10 @@ class CustomerCommision(models.Model): ('cashback', 'Cashback'), ('rebate', 'Rebate'), ], string='Commision Type', required=True) + bank_name = fields.Char(string='Bank', tracking=3) + account_name = fields.Char(string='Account Name', tracking=3) + bank_account = fields.Char(string='Account No', tracking=3) + note_transfer = fields.Char(string='Keterangan') # add status for type of commision, fee, rebate / cashback # include child or not? diff --git a/indoteknik_custom/models/dunning_run.py b/indoteknik_custom/models/dunning_run.py index 8e5b2c19..abfd68be 100644 --- a/indoteknik_custom/models/dunning_run.py +++ b/indoteknik_custom/models/dunning_run.py @@ -10,6 +10,7 @@ class DunningRun(models.Model): _name = 'dunning.run' _description = 'Dunning Run' _order = 'dunning_date desc, id desc' + _rec_name = 'number' number = fields.Char(string='Document No', index=True, copy=False, readonly=True) dunning_date = fields.Date(string='Dunning Date', required=True) diff --git a/indoteknik_custom/models/solr/apache_solr_queue.py b/indoteknik_custom/models/solr/apache_solr_queue.py index 8dd7c273..07274295 100644 --- a/indoteknik_custom/models/solr/apache_solr_queue.py +++ b/indoteknik_custom/models/solr/apache_solr_queue.py @@ -72,11 +72,12 @@ class ApacheSolrQueue(models.Model): if count == 0: self.create(payload) - def delete_weekly_solr(self, limit=500): + def delete_weekly_solr(self, limit=500, days_after=30): solr = self.search([ ('execute_status', '=', 'success'), - ('execute_date', '>=', (datetime.utcnow() - timedelta(days=7))), + ('execute_date', '>=', (datetime.utcnow() - timedelta(days=days_after))), ], limit=limit) + for rec in solr: rec.unlink() diff --git a/indoteknik_custom/models/voucher.py b/indoteknik_custom/models/voucher.py index 66c50c24..2eedc861 100644 --- a/indoteknik_custom/models/voucher.py +++ b/indoteknik_custom/models/voucher.py @@ -219,7 +219,7 @@ class Voucher(models.Model): tnc.append(f'<li>Voucher berlaku {self._res_remaining_time()} lagi</li>') tnc.append(f'<li>Voucher tidak bisa digunakan apabila terdapat produk flash sale</li>') if len(self.voucher_line) > 0: - brand_names = ', '.join([x.manufacture_id.x_name for x in self.voucher_line]) + brand_names = ', '.join([x.manufacture_id.x_name or '' for x in self.voucher_line]) tnc.append(f'<li>Voucher berlaku untuk produk dari brand {brand_names}</li>') tnc.append(self.generate_detail_tnc()) tnc.append('</ol>') |
