diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2023-02-21 13:07:57 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2023-02-21 13:07:57 +0700 |
| commit | c2105f6b0efdd0bb74b934205bb0acc43b297bdc (patch) | |
| tree | e2c13ffe06ca980cae399318e699d5d90bdbb1cc | |
| parent | e4158dc69c7d6bca17970dfbc838d9c29a76bd2b (diff) | |
sale order set midtrans status and others
| -rw-r--r-- | indoteknik_custom/models/midtrans.py | 8 | ||||
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/indoteknik_custom/models/midtrans.py b/indoteknik_custom/models/midtrans.py index df14c129..11b10292 100644 --- a/indoteknik_custom/models/midtrans.py +++ b/indoteknik_custom/models/midtrans.py @@ -25,8 +25,6 @@ class MidtransNotification(models.Model): ('authorize', 'Authorize'), ], string='Payment Status', help='Payment Gateway Status / Midtrans / Web, https://docs.midtrans.com/en/after-payment/status-cycle') - payment_type = fields.Char(string='Payment Type', help='Jenis pembayaran dengan Midtrans') - gross_amount = fields.Float(string='Gross Amount', help='Jumlah pembayaran yang dilakukan dengan Midtrans') def _parse_notification(self): query = [ @@ -44,10 +42,12 @@ class MidtransNotification(models.Model): sale_order = self.env['sale.order'].search([('name', '=', order)], limit=1) notif.payment_status = payment_status - notif.payment_type = payment_type - notif.gross_amount = gross_amount notif.sale_order_id = sale_order.id + sale_order.payment_type = payment_type + sale_order.gross_amount = gross_amount + sale_order.payment_status = payment_status + _logger.info('Success Parsing Midtrans Notification %s' % notif.id) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 519e55ce..35f1af8e 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -67,6 +67,8 @@ class SaleOrder(models.Model): ('authorize', 'Authorize'), ], string='Payment Status', help='Payment Gateway Status / Midtrans / Web, https://docs.midtrans.com/en/after-payment/status-cycle') date_doc_kirim = fields.Datetime(string='Tanggal Kirim di SJ', help="Tanggal Kirim di cetakan SJ yang terakhir, tidak berpengaruh ke Accounting") + payment_type = fields.Char(string='Payment Type', help='Jenis pembayaran dengan Midtrans') + gross_amount = fields.Float(string='Gross Amount', help='Jumlah pembayaran yang dilakukan dengan Midtrans') def calculate_line_no(self): line_no = 0 |
