diff options
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 5 |
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' |
