[IMP] Improve code of prepare invoice vals and increase width of div

This commit is contained in:
Haresh Chavda 2018-06-26 14:50:06 +05:30
parent 259da26efd
commit 2067297b8c
2 changed files with 5 additions and 7 deletions

View File

@ -4,7 +4,7 @@
<xpath expr="//div/div[hasclass('clearfix')]" position="replace">
<div class="clearfix">
<div id="total" class="row">
<div class="col-xs-4 pull-right">
<div class="col-xs-5 pull-right">
<table class="table table-condensed" style="min-width: 250px;max-width: 400px;">
<tr>
<td><strong>Gross Amount</strong></td>

View File

@ -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