Browse Source

include work from Yannick on qweb ledger, rearrange

pull/367/head
Simone Orsi 9 years ago
committed by Jordi Ballester
parent
commit
ac38b3efc1
  1. 9
      account_financial_report_qweb/__openerp__.py
  2. 27
      account_financial_report_qweb/menuitems.xml
  3. 2
      account_financial_report_qweb/models/__init__.py
  4. 15
      account_financial_report_qweb/models/account.py
  5. 8
      account_financial_report_qweb/report/__init__.py
  6. 113
      account_financial_report_qweb/report/common.py
  7. 210
      account_financial_report_qweb/report/general_ledger.py
  8. 293
      account_financial_report_qweb/report/templates/general_ledger.xml
  9. 15
      account_financial_report_qweb/reports.xml
  10. 52
      account_financial_report_qweb/wizard/general_ledger_wizard.xml
  11. 4
      account_financial_report_qweb/wizard/ledger_report_wizard.py
  12. 54
      account_financial_report_qweb/wizard/partner_ledger_wizard.xml

9
account_financial_report_qweb/__openerp__.py

@ -24,13 +24,14 @@
'report_menus.xml', 'report_menus.xml',
'wizard/balance_common_wizard_view.xml', 'wizard/balance_common_wizard_view.xml',
'views/report_menus.xml', 'views/report_menus.xml',
'menuitems.xml',
'reports.xml',
'wizard/general_ledger_wizard.xml',
# 'wizard/partner_ledger_wizard.xml',
'report/templates/ledger_general.xml',
], ],
'test': [ 'test': [
], ],
'demo': [
],
'qweb': [
],
'installable': True, 'installable': True,
'application': True, 'application': True,
'auto_install': False, 'auto_install': False,

27
account_financial_report_qweb/menuitems.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- TEMP main menu item -->
<menuitem
parent="account.menu_finance_reports"
id="menu_oca_reports"
name="OCA reports"
/>
<menuitem
parent="menu_oca_reports"
action="action_ledger_report_wizard"
id="menu_ledger_report_wizard"
/>
<menuitem
parent="menu_oca_reports"
id='account.menu_aged_partner_balance'
parent='account.menu_finance_legal_statement'
action='action_account_aged_trial_balance_wizard'
/>
</data>
</openerp>

2
account_financial_report_qweb/models/__init__.py

@ -2,3 +2,5 @@
# Author: Damien Crier # Author: Damien Crier
# Copyright 2016 Camptocamp SA # Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account

15
account_financial_report_qweb/models/account.py

@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# © 2011 Guewen Baconnier (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-
from openerp import models, fields
class AccountAccount(models.Model):
_inherit = 'account.account'
centralized = fields.Boolean(
'Centralized',
default=False,
help="If flagged, no details will be displayed in "
"the General Ledger report (the webkit one only), "
"only centralized amounts per period.")

8
account_financial_report_qweb/report/__init__.py

@ -1,4 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Author: Damien Crier
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# © 2015 Yannick Vaucher (Camptocamp)
# © 2016 Damien Crier (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-
from . import common
from . import general_ledger

113
account_financial_report_qweb/report/common.py

@ -0,0 +1,113 @@
# -*- encoding: utf-8 -*-
# © 2015 Yannick Vaucher
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class FinancialReportLine(models.AbstractModel):
"""Rappresentation of a report line."""
_name = 'financial.report.line'
_description = "Financial report line"
_order = 'account_id, date'
# TODO order by account_id.code
name = fields.Char()
ref = fields.Char()
date = fields.Date()
month = fields.Char()
partner_name = fields.Char()
partner_ref = fields.Char()
account_id = fields.Many2one('account.account')
account_code = fields.Char()
journal_id = fields.Many2one('account.journal')
currency_id = fields.Many2one('res.currency')
currency_code = fields.Char()
init_credit = fields.Float()
init_debit = fields.Float()
debit = fields.Float()
credit = fields.Float()
balance = fields.Float()
amount_currency = fields.Float()
cumul_credit = fields.Float()
cumul_debit = fields.Float()
cumul_balance = fields.Float()
cumul_balance_curr = fields.Float()
init_credit = fields.Float()
init_debit = fields.Float()
init_balance = fields.Float()
init_balance_curr = fields.Float()
debit_centralized = fields.Float()
credit_centralized = fields.Float()
balance_centralized = fields.Float()
balance_curr_centralized = fields.Float()
init_credit_centralized = fields.Float()
init_debit_centralized = fields.Float()
init_balance_centralized = fields.Float()
init_balance_curr_centralized = fields.Float()
move_name = fields.Char()
move_state = fields.Char()
invoice_number = fields.Char()
centralized = fields.Boolean()
class CommonFinancialReport(models.AbstractModel):
_name = 'account.report.common'
start_date = fields.Date()
end_date = fields.Date()
fiscalyear = fields.Many2one('account.fiscalyear')
centralize = fields.Boolean()
target_move = fields.Char()
filter = fields.Selection(
[('filter_no', 'No Filters'),
('filter_date', 'Date'),
('filter_opening', 'Opening Only')],
"Filter by",
required=False,
help='Filter by date: no opening balance will be displayed. '
'(opening balance can only be computed based on period to be '
'correct).'
)
@api.multi
def _get_moves_from_dates_domain(self):
""" Prepare domain for `_get_moves_from_dates` """
domain = []
if self.centralize:
domain = [('centralized', '=', False)]
start_date = self.start_date
end_date = self.end_date
if self.fiscalyear:
start_date = self.fiscalyear.start_date
end_date = self.fiscalyear.end_date
if start_date:
domain += [('date', '>=', start_date)]
if end_date:
domain += [('date', '<=', end_date)]
if self.target_move == 'posted':
domain += [('move_state', '=', 'posted')]
if self.account_ids:
domain += [('account_id', 'in', self.account_ids.ids)]
domain += [('journal_id', 'in', self.journal_ids.ids)]
return domain
@api.multi
def _get_moves_from_fiscalyear(self, account, fiscalyear,
target_move):
return self._get_moves_from_dates(
account, fiscalyear.date_start, fiscalyear.date_end, target_move)

210
account_financial_report_qweb/report/general_ledger.py

@ -0,0 +1,210 @@
# -*- coding: utf-8 -*-
# © 2015 Yannick Vaucher (Camptocamp)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from openerp import tools
class FinancialReportLine(models.Model):
_inherit = 'financial.report.line'
_name = 'general.ledger.line'
_description = "General Ledger report"
_auto = False
_order = 'account_id, date'
@api.depends('invoice_number', 'name')
def _get_label(self):
for rec in self:
invoice_number = ''
if rec.invoice_number:
invoice_number = ' (rec.invoice_number)'
rec.label = u'%(line_name)s%(invoice_number)s' % {
'line_name': rec.name,
'invoice_number': invoice_number}
label = fields.Char(compute='_get_label', readonly=True, store=False)
def init(self, cr):
report_name = self._name.replace('.', '_')
tools.drop_view_if_exists(cr, report_name)
query = """
CREATE OR REPLACE VIEW %(report_name)s AS (
SELECT
acc.id AS account_id,
acc.code AS account_code,
acc.centralized,
ml.id,
ml.name,
ml.ref,
ml.date,
date_part('year', ml.date) || '-' || date_part('month', ml.date)
AS month,
part.ref AS partner_ref,
part.name AS partner_name,
ml.journal_id,
ml.currency_id,
cur.name AS currency_code,
ml.debit,
ml.credit,
ml.debit - ml.credit AS balance,
ml.amount_currency,
SUM(amount_currency) OVER w_account AS balance_curr,
SUM(debit) OVER w_account AS cumul_debit,
SUM(credit) OVER w_account AS cumul_credit,
SUM(debit - credit) OVER w_account AS cumul_balance,
SUM(amount_currency) OVER w_account AS cumul_balance_curr,
SUM(debit) OVER w_account - debit AS init_debit,
SUM(credit) OVER w_account - credit AS init_credit,
SUM(debit - credit) OVER w_account - (debit - credit) AS init_balance,
SUM(amount_currency) OVER w_account - (amount_currency)
AS init_balance_curr,
SUM(debit) OVER w_account_centralized AS debit_centralized,
SUM(credit) OVER w_account_centralized AS credit_centralized,
SUM(debit - credit) OVER w_account_centralized AS balance_centralized,
SUM(amount_currency) OVER w_account_centralized
AS balance_curr_centralized,
SUM(debit) OVER w_account - SUM(debit)
OVER w_account_centralized AS init_debit_centralized,
SUM(credit) OVER w_account - SUM(credit)
OVER w_account_centralized AS init_credit_centralized,
SUM(debit - credit) OVER w_account - SUM(debit - credit)
OVER w_account_centralized AS init_balance_centralized,
SUM(amount_currency) OVER w_account - SUM(amount_currency)
OVER w_account_centralized AS init_balance_curr_centralized,
m.name AS move_name,
m.state AS move_state,
i.number AS invoice_number
FROM
account_account AS acc
LEFT JOIN account_move_line AS ml ON (ml.account_id = acc.id)
INNER JOIN res_partner AS part ON (ml.partner_id = part.id)
INNER JOIN account_move AS m ON (ml.move_id = m.id)
LEFT JOIN account_invoice AS i ON (m.id = i.move_id)
LEFT JOIN res_currency AS cur ON (ml.currency_id = cur.id)
WINDOW w_account AS (PARTITION BY acc.code ORDER BY ml.date, ml.id),
w_account_centralized AS (
PARTITION BY acc.code,
date_part('year', ml.date),
date_part('month', ml.date),
ml.journal_id,
ml.partner_id
ORDER BY ml.date, ml.journal_id, ml.id)
)
""" % {'report_name': report_name}
cr.execute(query)
class GeneralLedgerReport(models.TransientModel):
_name = 'report.account.report_generalledger_qweb'
_inherit = 'account.report.common'
@api.multi
def _get_account_ids(self):
res = False
context = self.env.context
if (context.get('active_model') == 'account.account' and
context.get('active_ids')):
res = context['active_ids']
return res
name = fields.Char()
initial_balance = fields.Integer()
account_ids = fields.Many2many(
'account.account',
string='Filter on accounts',
default=_get_account_ids,
help="Only selected accounts will be printed. Leave empty to "
"print all accounts.")
journal_ids = fields.Many2many(
'account.journal',
string='Filter on jourvals',
help="Only selected journals will be printed. Leave empty to "
"print all journals.")
balance_mode = fields.Selection(
[('initial_balance', 'Initial balance'),
('opening_balance', 'Opening balance')]
)
display_account = fields.Char()
display_ledger_lines = fields.Boolean()
display_initial_balance = fields.Boolean()
MAPPING = {
'date_from': 'start_date',
'date_to': 'end_date',
}
@api.model
def _get_values_from_wizard(self, data):
""" Get values from wizard """
values = {}
for key, val in data.iteritems():
if key in self.MAPPING:
values[self.MAPPING[key]] = val
elif key == 'fiscalyear':
if val:
values[key] = val[0]
elif key == 'journal_ids':
if val:
values[key] = [(6, 0, val)]
else:
values[key] = val
return values
@api.multi
def _get_centralized_move_ids(self, domain):
""" Get last line of each selected centralized accounts """
# inverse search on centralized boolean to finish the search to get the
# ids of last lines of centralized accounts
# XXX USE DISTINCT to speed up ?
domain = domain[:]
centralize_index = domain.index(('centralized', '=', False))
domain[centralize_index] = ('centralized', '=', True)
gl_lines = self.env['general.ledger.line'].search(domain)
accounts = gl_lines.mapped('account_id')
line_ids = []
for acc in accounts:
acc_lines = gl_lines.filtered(lambda rec: rec.account_id == acc)
line_ids.append(acc_lines[-1].id)
return line_ids
@api.multi
def _get_moves_from_dates(self):
domain = self._get_moves_from_dates_domain()
if self.centralize:
centralized_ids = self._get_centralized_move_ids(domain)
if centralized_ids:
domain.insert(0, '|')
domain.append(('id', 'in', centralized_ids))
return self.env['general.ledger.line'].search(domain)
@api.multi
def render_html(self, data=None):
report_name = 'account.report_generalledger_qweb'
if data is None:
return
values = self._get_values_from_wizard(data['form'])
report = self.create(values)
report_lines = report._get_moves_from_dates()
# TODO warning if no report_lines
self.env['report']._get_report_from_name(report_name)
docargs = {
'doc_ids': report.ids,
'doc_model': self._name,
'report_lines': report_lines,
'docs': report,
# XXX
'has_currency': True
}
return self.env['report'].render(report_name, docargs)

293
account_financial_report_qweb/report/templates/general_ledger.xml

@ -0,0 +1,293 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="assets_specific" inherit_id="report.assets_common">
<xpath expr="." position="inside">
<link href="/account_financial_report_qweb/static/src/css/report.css" rel="stylesheet"/>
</xpath>
</template>
<template id="account.report_generalledger_qweb">
<t t-call="report.html_container">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-foreach="docs" t-as="o">
<t t-call="report.internal_layout">
<div class="page">
<div class="act_as_table data_table" style="width: 1205px">
<div class="act_as_row labels">
<!--<div class="act_as_cell">Chart of Account</div>-->
<div class="act_as_cell">Fiscal Year</div>
<t t-if="o.fiscalyear or o.start_date or o.end_date">
<div class="act_as_cell">
<t t-if="not o.fiscalyear">
Dates Filter
</t>
<t t-if="o.fiscalyear">
Fiscal Year Filter
</t>
</div>
</t>
<div class="act_as_cell">Accounts Filter</div>
<div class="act_as_cell">Journal Filter</div>
<div class="act_as_cell">Target Moves</div>
</div>
<div class="act_as_row">
<div class="act_as_cell"><span t-field="o.fiscalyear.name"/></div>
<t t-if="o.fiscalyear or o.start_date or o.end_date">
<div class="act_as_cell">
From:
<span t-field="o.start_date"/>
To:
<span t-field="o.end_date"/>
</div>
</t>
<div class="act_as_cell">
<t t-if="o.account_ids">
<t t-raw="', '.join(o.account_ids.mapped('code'))"/>
</t>
<t t-if="not o.account_ids">
All
</t>
</div>
<div class="act_as_cell">
<t t-if="o.journal_ids">
<t t-raw="', '.join(o.journal_ids.mapped('code'))"/>
</t>
<t t-if="not o.journal_ids">
All
</t>
</div>
<div class="act_as_cell"><span t-field="o.target_move"/></div>
</div>
<t t-set="account" t-value="False"/>
<!-- we use div with css instead of table for tabular data because div do not cut rows at half at page breaks -->
<t t-foreach="report_lines" t-as="line">
<t t-if="account != line.account_id">
<t t-set="account" t-value="line.account_id"/>
&lt;div class="act_as_table list_table" style="margin-top: 10px;"&gt;
<div class="act_as_caption account_title">
<span t-field="account.code"/> - <span t-field="account.name"/>
</div>
<div class="act_as_thead">
<div class="act_as_row labels">
<!--## date-->
<div class="act_as_cell first_column" style="width: 50px;">Date</div>
<!--## move-->
<div class="act_as_cell" style="width: 100px;">Entry</div>
<!--## journal-->
<div class="act_as_cell" style="width: 70px;">Journal</div>
<!--## account code-->
<div class="act_as_cell" style="width: 65px;">Account</div>
<!--## partner-->
<div class="act_as_cell" style="width: 140px;">Partner</div>
<!--## move reference-->
<div class="act_as_cell" style="width: 140px;">Reference</div>
<!--## label-->
<div class="act_as_cell" style="width: 160px;">Label</div>
<!--## debit-->
<div class="act_as_cell amount" style="width: 75px;">Debit</div>
<!--## credit-->
<div class="act_as_cell amount" style="width: 75px;">Credit</div>
<!--## balance cumulated-->
<div class="act_as_cell amount" style="width: 75px;">Cumul. Bal.</div>
<t t-if="has_currency">
<!--## currency balance-->
<div class="act_as_cell amount sep_left" style="width: 75px;">Curr. Balance</div>
<!--## curency code-->
<div class="act_as_cell amount" style="width: 30px; text-align: right;">Curr.</div>
</t>
</div>
</div>
<t t-if="not account.user_type_id.include_initial_balance">
<t t-set="cumul_debit" t-value="0"/>
<t t-set="cumul_credit" t-value="0"/>
<t t-set="cumul_balance" t-value="0"/>
</t>
<!-- # init balance -->
<t t-if="account.user_type_id.include_initial_balance">
<div class="act_as_tbody">
<div class="act_as_row initial_balance">
<!--## date-->
<div class="act_as_cell first_column"></div>
<!--## move-->
<div class="act_as_cell"></div>
<!--## journal-->
<div class="act_as_cell"></div>
<!--## account code-->
<div class="act_as_cell"></div>
<!--## partner-->
<div class="act_as_cell"></div>
<!--## move reference-->
<div class="act_as_cell"></div>
<!--## label-->
<div class="act_as_cell">Initial Balance</div>
<!--## debit-->
<div class="act_as_cell amount">
<t t-if="not line.centralized">
<span t-field="line.init_debit"/>
</t>
<t t-if="line.centralized">
<span t-field="line.init_debit_centralized"/>
</t>
</div>
<!--## credit-->
<div class="act_as_cell amount">
<t t-if="not line.centralized">
<span t-field="line.init_credit"/>
</t>
<t t-if="line.centralized">
<span t-field="line.init_credit_centralized"/>
</t>
</div>
<!--## balance cumulated-->
<div class="act_as_cell amount" style="padding-right: 1px;">
<t t-if="not line.centralized">
<span t-field="line.init_balance"/>
</t>
<t t-if="line.centralized">
<span t-field="line.init_balance"/>
</t>
</div>
<t t-if="has_currency">
<!--## currency balance-->
<div class="act_as_cell amount sep_left">
<t t-if="not line.centralized and account.currency_id">
<span t-field="line.init_balance_curr"/>
</t>
<t t-if="line.centralized and account.currency_id">
<span t-raw="line.init_balance_curr_centralized"/>
</t>
</div>
<!--## curency code-->
<div class="act_as_cell amount"></div>
</t>
</div>
</div>
</t>
</t>
<!-- # lines or centralized lines -->
<div class="act_as_row lines">
<t t-if="not line.centralized">
<!--## date-->
<div class="act_as_cell first_column"><span t-field="line.date"/></div>
<!--## move-->
<div class="act_as_cell"><span t-raw="line.move_name or ''"/></div>
<!--## journal-->
<div class="act_as_cell"><span t-field="line.journal_id.code"/></div>
<!--## account code-->
<div class="act_as_cell"><span t-field="account.code"/></div>
<!--## partner-->
<div class="act_as_cell overflow_ellipsis"><span t-field="line.partner_name"/></div>
<!--## move reference-->
<div class="act_as_cell"><span t-field="line.ref"/></div>
<!--## label-->
<div class="act_as_cell"><span t-field="line.label"/></div>
<!--## debit-->
<div class="act_as_cell amount"><span t-field="line.debit"/></div>
<!--## credit-->
<div class="act_as_cell amount"><span t-field="line.credit"/></div>
<!--## balance cumulated-->
<div class="act_as_cell amount" style="padding-right: 1px;">
<t t-if="not account.user_type_id.include_initial_balance">
<t t-set="cumul_debit" t-value="cumul_debit + line.debit"/>
<t t-set="cumul_credit" t-value="cumul_credit + line.credit"/>
<t t-set="cumul_balance" t-value="cumul_balance + line.balance"/>
<span t-raw="cumul_balance"/>
</t>
<t t-if="account.user_type_id.include_initial_balance">
<span t-field="line.cumul_balance"/>
</t>
</div>
<t t-if="has_currency">
<!--## currency balance-->
<div class="act_as_cell amount" style="padding-right: 1px;">
<span t-field="line.amount_currency"/>
</div>
<!--## curency code-->
<div class="act_as_cell amount" style="text-align: right;"><span t-field="line.currency_code"/></div>
</t>
</t>
<t t-if="line.centralized and line.period_last">
<!--## date-->
<div class="act_as_cell first_column"><span t-field="line.month"/></div>
<!--## move-->
<div class="act_as_cell">Month centralization</div>
<!--## journal-->
<div class="act_as_cell"><span t-field="line.journal_id.code"/></div>
<!--## account code-->
<div class="act_as_cell"><span t-field="account.code"/></div>
<!--## partner-->
<div class="act_as_cell overflow_ellipsis"><span t-field="line.partner_name"/> <span t-if="line.partner_ref" t-field="line.partner_ref"/></div>
<!--## move reference-->
<div class="act_as_cell"></div>
<!--## label-->
<div class="act_as_cell"></div>
<!--## debit-->
<div class="act_as_cell amount"><span t-field="line.debit_centralized"/></div>
<!--## credit-->
<div class="act_as_cell amount"><span t-field="line.credit_centralized"/></div>
<!--## balance cumulated-->
<div class="act_as_cell amount" style="padding-right: 1px;"><span t-field="line.cumul_balance"/></div>
<t t-if="has_currency">
<!--## currency balance-->
<div class="act_as_cell amount sep_left"><span t-if="account.currency_id" t-field="line.balance_curr_centralized"/></div>
<!--## curency code-->
<div class="act_as_cell amount" style="text-align: right;"><span t-field="line.currency_code"/></div>
</t>
</t>
</div>
<!-- # Total -->
<t t-if="(line_index + 1) == len(report_lines) or line.account_id != report_lines[line_index + 1].account_id">
<div class="act_as_table list_table">
<div class="act_as_row labels" style="font-weight: bold;">
<!--## date-->
<div class="act_as_cell first_column" style="width: 425;"><span t-field="account.code"/> - <span t-field="account.name"/></div>
<div class="act_as_cell" style="width: 300px;">Cumulated Balance on Account</div>
<!--## debit-->
<div class="act_as_cell amount" style="width: 75px;">
<t t-if="account.user_type_id.include_initial_balance">
<span t-field="line.cumul_debit"/>
</t>
<t t-if="not account.user_type_id.include_initial_balance">
<span t-raw="cumul_debit"/>
</t>
</div>
<!--## credit-->
<div class="act_as_cell amount" style="width: 75px;">
<t t-if="account.user_type_id.include_initial_balance">
<span t-field="line.cumul_credit"/>
</t>
<t t-if="not account.user_type_id.include_initial_balance">
<span t-raw="cumul_credit"/>
</t>
</div>
<!--## balance cumulated-->
<div class="act_as_cell amount" style="width: 75px; padding-right: 1px;">
<t t-if="account.user_type_id.include_initial_balance">
<span t-field="line.cumul_balance"/>
</t>
<t t-if="not account.user_type_id.include_initial_balance">
<span t-raw="cumul_balance"/>
</t>
</div>
<t t-if="has_currency">
<!--## currency balance-->
<div class="act_as_cell amount sep_left" style="width: 75px;"><t t-if="account.currency_id"><span t-field="line.cumul_balance_curr"/></t></div>
<!--## curency code-->
<div class="act_as_cell amount" style="width: 30px; text-align: right;"></div>
</t>
</div>
&lt;/div&gt;
</div>
</t>
</t>
</div>
</div>
</t>
</t>
</t>
</template>
</odoo>

15
account_financial_report_qweb/reports.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="action_report_general_ledger_qweb"
model="report.account.report_generalledger_qweb"
string="General Ledger"
report_type="qweb-pdf"
name="account.report_generalledger_qweb"
file="account.report_generalledger_qweb"
/>
</data>
</openerp>

52
account_financial_report_qweb/wizard/general_ledger_wizard.xml

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- GENERAL LEDGER -->
<record id="ledger_general_wizard" model="ir.ui.view">
<field name="name">General Ledger</field>
<field name="model">ledger.report.wizard</field>
<field name="arch" type="xml">
<form>
<group name="main_info">
<field name="company_id"/>
</group>
<group name="date_currency_filter">
<group name="date_ranger">
<!-- <field name="date_range"/> -->
<field name="date_from"/>
<field name="date_to"/>
</group>
<group name="extra_info">
<field name="amount_currency"/>
<field name="centralize"/>
</group>
</group>
<group name="other_filters">
<group name="moves">
<field name="target_move" widget="radio"/>
</group>
</group>
<label for="account_ids"/>
<field name="account_ids" nolabel="1"/>
<footer>
<button name="button_print" string="Print" type="object" default_focus="1" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_ledger_report_wizard" model="ir.actions.act_window">
<field name="name">General Ledger</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ledger.report.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="ledger_general_wizard"/>
<field name="target">new</field>
</record>
</data>
</openerp>

4
account_financial_report_qweb/wizard/ledger_report_wizard.py

@ -8,7 +8,7 @@ from openerp import models, fields, api
class LedgerReportWizard(models.TransientModel): class LedgerReportWizard(models.TransientModel):
_name = "ledger.report.wizard" _name = "ledger.report.wizard"
_description = "Ledger Report"
_description = "Ledger Report Wizard"
company_id = fields.Many2one(comodel_name='res.company') company_id = fields.Many2one(comodel_name='res.company')
# date_range = ?? # date_range = ??
@ -40,5 +40,5 @@ class LedgerReportWizard(models.TransientModel):
) )
@api.multi @api.multi
def check_report(self):
def button_print(self):
return True return True

54
account_financial_report_qweb/wizard/ledger_report_wizard_view.xml → account_financial_report_qweb/wizard/partner_ledger_wizard.xml

@ -2,58 +2,6 @@
<openerp> <openerp>
<data> <data>
<!-- GENERAL LEDGER -->
<record id="ledger_report_wizard_view_form" model="ir.ui.view">
<field name="name">Ledger</field>
<field name="model">ledger.report.wizard</field>
<field name="arch" type="xml">
<form>
<group name="main_info">
<field name="company_id"/>
</group>
<group name="date_currency_filter">
<group name="date_ranger">
<!-- <field name="date_range"/> -->
<field name="date_from"/>
<field name="date_to"/>
</group>
<group name="extra_info">
<field name="amount_currency"/>
<field name="centralize"/>
</group>
</group>
<group name="other_filters">
<group name="moves">
<field name="target_move" widget="radio"/>
</group>
</group>
<label for="account_ids"/>
<field name="account_ids" nolabel="1"/>
<footer>
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_ledger_report_wizard" model="ir.actions.act_window">
<field name="name">Ledger</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">ledger.report.wizard</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="ledger_report_wizard_view_form"/>
<field name="target">new</field>
</record>
<menuitem
parent="account.menu_finance_legal_statement"
action="action_ledger_report_wizard"
id="menu_ledger_report_wizard"/>
<!-- PARTNER LEDGER --> <!-- PARTNER LEDGER -->
<record id="partner_ledger_report_wizard_view_form" model="ir.ui.view"> <record id="partner_ledger_report_wizard_view_form" model="ir.ui.view">
<field name="name">Partner Ledger</field> <field name="name">Partner Ledger</field>
@ -84,7 +32,7 @@
<label for="partner_ids"/> <label for="partner_ids"/>
<field name="partner_ids" nolabel="1"/> <field name="partner_ids" nolabel="1"/>
<footer> <footer>
<button name="check_report" string="Print" type="object" default_focus="1" class="oe_highlight"/>
<button name="button_print" string="Print" type="object" default_focus="1" class="oe_highlight"/>
or or
<button string="Cancel" class="oe_link" special="cancel" /> <button string="Cancel" class="oe_link" special="cancel" />
</footer> </footer>
Loading…
Cancel
Save