summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-05-17 14:22:43 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-05-17 14:22:43 +0700
commitb7387d281425da2a72f202aac78c5800866a7117 (patch)
tree1dcbacda554cb8eb30b5263a466d05cb6434915e /indoteknik_custom/models
parent9b0ab52b8c1240664567eb8c555dd5d4f3ece677 (diff)
parent3e7913ef03dc46a902f14d29e00c92eaed6bdf9d (diff)
Merge branch 'origin/feature/raja-ongkir' into release
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/sale_order.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 69e96968..14c87641 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -73,6 +73,7 @@ class SaleOrder(models.Model):
gross_amount = fields.Float(string='Gross Amount', help='Jumlah pembayaran yang dilakukan dengan Midtrans')
notification = fields.Char(string='Notification', help='Dapat membantu error dari approval')
delivery_service_type = fields.Char(string='Delivery Service Type', help='data dari rajaongkir')
+ grand_total = fields.Monetary(string='Grand Total', help='Amount total + amount delivery', compute='_compute_grand_total')
@api.model
def _generate_so_access_token(self, limit=50):
@@ -362,6 +363,10 @@ class SaleOrder(models.Model):
for line in self.order_line:
line.product_id_change()
+ def _compute_grand_total(self):
+ for order in self:
+ order.grand_total = order.delivery_amt + order.amount_total
+
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'