summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-11-15 10:32:45 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-11-15 10:32:45 +0700
commit4730df5bf97724cd906c8118178407bfbf206bca (patch)
tree7d5c418d1049204ecd21b2a5ac8e8cbae354a8ec
parent132d4b80f3d5dad792468bd14961f6a9540122e2 (diff)
parent49846bc78d282516092c6c63db63d4ea01d42949 (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
-rw-r--r--indoteknik_api/models/product_product.py3
-rw-r--r--indoteknik_custom/models/commision.py4
-rw-r--r--indoteknik_custom/models/dunning_run.py1
-rw-r--r--indoteknik_custom/models/solr/apache_solr_queue.py5
-rw-r--r--indoteknik_custom/models/voucher.py2
-rw-r--r--indoteknik_custom/views/customer_commision.xml10
6 files changed, 20 insertions, 5 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py
index aa9e0ad7..1db58d8e 100644
--- a/indoteknik_api/models/product_product.py
+++ b/indoteknik_api/models/product_product.py
@@ -273,7 +273,8 @@ class ProductProduct(models.Model):
base_price = 0
if base_pricelist:
- base_price = base_pricelist.computed_price / 1.11
+ base_price = base_pricelist.computed_price
+ # base_price = base_pricelist.computed_price / 1.11
discount = 0
price_flashsale = 0
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>')
diff --git a/indoteknik_custom/views/customer_commision.xml b/indoteknik_custom/views/customer_commision.xml
index e299d37e..993521ca 100644
--- a/indoteknik_custom/views/customer_commision.xml
+++ b/indoteknik_custom/views/customer_commision.xml
@@ -20,7 +20,7 @@
<field name="name">customer.commision.line.tree</field>
<field name="model">customer.commision.line</field>
<field name="arch" type="xml">
- <tree editable="top" create="false" delete="false">
+ <tree editable="top" create="false">
<field name="partner_id" readonly="1"/>
<field name="invoice_id" readonly="1"/>
<field name="state" readonly="1"/>
@@ -72,6 +72,14 @@
<page string="Lines">
<field name="commision_lines"/>
</page>
+ <page string="Other Info" name="customer_commision_info">
+ <group>
+ <field name="bank_name"/>
+ <field name="account_name"/>
+ <field name="bank_account"/>
+ <field name="note_transfer"/>
+ </group>
+ </page>
</notebook>
</sheet>
<div class="oe_chatter">