diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-15 16:22:21 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-05-15 16:22:21 +0700 |
| commit | f4f150ec2492b048886e1965a0a650864295c76c (patch) | |
| tree | 37386674983c542d6730e993e09337505dfc415e /indoteknik_custom/models | |
| parent | 6364f3d0bec6e75e3056caa928bbe11d39cc145f (diff) | |
grand total field, compute grand total, sale order print for website, fix sale order download pdf api
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' |
