summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-02-10 10:35:55 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-02-10 10:35:55 +0700
commitb0de64ae769148a009d0a08a957c5c35dee174a9 (patch)
tree9df917ff06a9be467bcdcffe8f0a2f3cdb4fd0b5
parentd51c653d99a6133807e789c7b22b23e28e5abb87 (diff)
add notification in dunning run
-rw-r--r--indoteknik_custom/models/dunning_run.py3
-rw-r--r--indoteknik_custom/views/dunning_run.xml1
2 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_custom/models/dunning_run.py b/indoteknik_custom/models/dunning_run.py
index ee0669ca..98689550 100644
--- a/indoteknik_custom/models/dunning_run.py
+++ b/indoteknik_custom/models/dunning_run.py
@@ -23,6 +23,7 @@ class DunningRun(models.Model):
date_terima_tukar_faktur = fields.Date(string='Terima Faktur')
shipper_faktur_id = fields.Many2one('delivery.carrier', string='Shipper Faktur')
is_validated = fields.Boolean(string='Validated')
+ notification = fields.Char(string='Notification')
def copy_date_faktur(self):
if not self.is_validated:
@@ -51,12 +52,14 @@ class DunningRun(models.Model):
invoice.invoice_date_due = due_date
if not invoice.shipper_faktur_id:
invoice.shipper_faktur_id = self.shipper_faktur_id
+ self.notification = 'Berhasil copy tanggal terima faktur ke setiap invoice %s' % self.date_terima_tukar_faktur
def validate_dunning(self):
if not self.dunning_line:
raise UserError('Dunning Line masih kosong, generate dulu')
else:
self.is_validated = True
+ self.notification = 'Jangan lupa klik Copy Date jika sudah ada tanggal kirim / tanggal terima faktur'
def generate_dunning_line(self):
if self.is_validated:
diff --git a/indoteknik_custom/views/dunning_run.xml b/indoteknik_custom/views/dunning_run.xml
index 6343a79b..cae9cc32 100644
--- a/indoteknik_custom/views/dunning_run.xml
+++ b/indoteknik_custom/views/dunning_run.xml
@@ -63,6 +63,7 @@
<field name="number"/>
<field name="partner_id"/>
<field name="dunning_date"/>
+ <field name="notification" readonly="1"/>
</group>
<group>
<field name="is_validated" readonly="1"/>