[IMP] point_of_sale: remove custom account_statement report model

There's no point to it, as we can easily do what we need directly in the
report.
This commit is contained in:
Vipul Bhatt
2016-05-28 15:22:20 +02:00
committed by Joren Van Onder
parent 5d9f034b44
commit bc0c3579be
3 changed files with 1 additions and 44 deletions
-1
View File
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import account_statement
import pos_invoice
import pos_order_report
import pos_receipt
@@ -1,38 +0,0 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
from openerp.osv import osv
from openerp.report import report_sxw
class account_statement(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(account_statement, self).__init__(cr, uid, name, context=context)
self.total = 0.0
self.localcontext.update({
'time': time,
'get_total': self._get_total,
'get_data': self._get_data,
})
def _get_data(self, statement):
lines = []
for line in statement.line_ids:
lines.append(line)
return lines
def _get_total(self, statement_line_ids):
total = 0.0
for line in statement_line_ids:
total += line.amount
return total
class report_account_statement(osv.AbstractModel):
_name = 'report.point_of_sale.report_statement'
_inherit = 'report.abstract_report'
_template = 'point_of_sale.report_statement'
_wrapped_report_class = account_statement
@@ -32,10 +32,6 @@
<strong>Opening Date</strong>:<br/>
<span t-field="o.date"/>
</div>
<!-- <div class="col-xs-3">
<strong>Closing Date</strong>:<br/>
<span t-field="o.closing_date"/>
</div> -->
<div class="col-xs-3">
<strong>Starting Balance</strong>:<br/>
<span t-field="o.balance_start" t-field-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/>
@@ -71,7 +67,7 @@
<table class="table table-condensed">
<tr class="border-black">
<td><strong>Total</strong></td>
<td class="text-right"><span t-esc="formatLang(get_total(o.line_ids), currency_obj=res_company.currency_id)"/></td>
<td class="text-right"><span t-esc="sum([line.amount for line in o.line_ids])" t-esc-options='{"widget": "monetary", "display_currency": "res_company.currency_id"}'/></td>
</tr>
</table>
</div>