Browse Source

[IMP] Open Invoices - Order accounts, partners and moves on report

pull/196/head
Francesco Apruzzese 9 years ago
committed by Leonardo Pistone
parent
commit
1f90a30b77
  1. 1
      account_financial_report_qweb/report/open_invoice.py
  2. 4
      account_financial_report_qweb/report/templates/open_invoice_report.xml
  3. 4
      account_financial_report_qweb/wizard/open_invoice_wizard.py

1
account_financial_report_qweb/report/open_invoice.py

@ -20,6 +20,7 @@ class OpenInvoiceReport(models.AbstractModel):
docargs = { docargs = {
'doc_model': 'account.move.line', 'doc_model': 'account.move.line',
'doc_ids': doc_ids, 'doc_ids': doc_ids,
'sorted': sorted,
} }
if data: if data:
docargs.update(data) docargs.update(data)

4
account_financial_report_qweb/report/templates/open_invoice_report.xml

@ -56,7 +56,7 @@
</div> </div>
<!-- Informations group by account --> <!-- Informations group by account -->
<t t-foreach="data" t-as="account">
<t t-foreach="sorted(data.keys())" t-as="account">
<t t-set="account_debit" t-value="0.0" /> <t t-set="account_debit" t-value="0.0" />
<t t-set="account_credit" t-value="0.0" /> <t t-set="account_credit" t-value="0.0" />
<t t-set="account_balance" t-value="0.0" /> <t t-set="account_balance" t-value="0.0" />
@ -64,7 +64,7 @@
<span t-esc="account"/> <span t-esc="account"/>
</div> </div>
<!-- Informations group by partner --> <!-- Informations group by partner -->
<t t-foreach="data[account]" t-as="partner">
<t t-foreach="sorted(data[account].keys())" t-as="partner">
<t t-set="partner_debit" t-value="0.0" /> <t t-set="partner_debit" t-value="0.0" />
<t t-set="partner_credit" t-value="0.0" /> <t t-set="partner_credit" t-value="0.0" />
<t t-set="partner_balance" t-value="0.0" /> <t t-set="partner_balance" t-value="0.0" />

4
account_financial_report_qweb/wizard/open_invoice_wizard.py

@ -66,7 +66,6 @@ class OpenInvoiceWizard(models.TransientModel):
elif data['result_selection'] == 'supplier': elif data['result_selection'] == 'supplier':
account_type = ('payable', ) account_type = ('payable', )
domain = [ domain = [
('reconciled', '=', False),
('company_id', '=', data['company_id'].id), ('company_id', '=', data['company_id'].id),
('move_id.date', '<=', data['at_date']), ('move_id.date', '<=', data['at_date']),
('account_id.user_type_id.type', 'in', account_type) ('account_id.user_type_id.type', 'in', account_type)
@ -100,7 +99,8 @@ class OpenInvoiceWizard(models.TransientModel):
@api.multi @api.multi
def print_report(self): def print_report(self):
self.ensure_one() self.ensure_one()
moves = self.env['account.move.line'].search(self._get_domain(self))
moves = self.env['account.move.line'].search(
self._get_domain(self), order='date asc')
if not moves: if not moves:
return True # ----- Show a message here return True # ----- Show a message here
datas = {} datas = {}

Loading…
Cancel
Save