From 2067297b8c6c093609d84f9e372452c97ae7c503 Mon Sep 17 00:00:00 2001 From: Haresh Chavda Date: Tue, 26 Jun 2018 14:50:06 +0530 Subject: [PATCH] [IMP] Improve code of prepare invoice vals and increase width of div --- .../account_discount/report/custom_invoice_report.xml | 2 +- addons/sales_discount/models/sale.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/account_discount/report/custom_invoice_report.xml b/addons/account_discount/report/custom_invoice_report.xml index acc8ed8b..d4b1a7be 100644 --- a/addons/account_discount/report/custom_invoice_report.xml +++ b/addons/account_discount/report/custom_invoice_report.xml @@ -4,7 +4,7 @@
-
+
diff --git a/addons/sales_discount/models/sale.py b/addons/sales_discount/models/sale.py index 98b2d170..d42e6504 100644 --- a/addons/sales_discount/models/sale.py +++ b/addons/sales_discount/models/sale.py @@ -145,13 +145,11 @@ class SaleOrder(models.Model): @api.multi def _prepare_invoice(self): - sale_order = self.env['sale.order'].browse( - self._context.get('active_ids', [])) invoice_vals = super(SaleOrder, self)._prepare_invoice() invoice_vals.update({ - 'discount_method': sale_order.discount_method, - 'discount_amount': sale_order.discount_amount, - 'discount_per': sale_order.discount_per, - 'discount': sale_order.discount, + 'discount_method': self.discount_method, + 'discount_amount': self.discount_amount, + 'discount_per': self.discount_per, + 'discount': self.discount, }) return invoice_vals
Gross Amount