Browse Source

[IMP] This branch addresses the issues that were signalled mainly by Frederic in https://code.launchpad.net/~agilebg/account-financial-report/adding_financial_reports_horizontal_7/+merge/176235.

Additionally, trivial changes to copyright notices and the OpenERP manifest file were made.
pull/7/merge
Lorenzo Battistini 11 years ago
parent
commit
7b41fc5612
  1. 8
      account_financial_report_horizontal/__openerp__.py
  2. 5
      account_financial_report_horizontal/report/account_balance_sheet.py
  3. 11
      account_financial_report_horizontal/report/account_balance_sheet_horizontal.rml
  4. 10
      account_financial_report_horizontal/report/account_profit_horizontal.rml
  5. 7
      account_financial_report_horizontal/report/account_profit_loss.py
  6. 10
      account_financial_report_horizontal/wizard/account_report_balance_sheet.py
  7. 1
      account_financial_report_horizontal/wizard/account_report_balance_sheet_view.xml
  8. 3
      account_financial_report_horizontal/wizard/account_report_profit_loss_view.xml

8
account_financial_report_horizontal/__openerp__.py

@ -2,7 +2,7 @@
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
# This module copyright (C) 2012 Therp BV (<http://therp.nl>).
# This module copyright (C) 2012 Therp BV (<http://therp.nl>),
# Copyright (C) 2013 Agile Business Group sagl # Copyright (C) 2013 Agile Business Group sagl
# (<http://www.agilebg.com>) (<lorenzo.battistini@agilebg.com>) # (<http://www.agilebg.com>) (<lorenzo.battistini@agilebg.com>)
# #
@ -27,10 +27,10 @@
"category": 'Accounting & Finance', "category": 'Accounting & Finance',
'complexity': "normal", 'complexity': "normal",
"description": """ "description": """
This is a port of the horizontal financial reports 'Balance sheet' and
'Profit and Loss' from OpenERP 6.1 to OpenERP 7.0
This is a port to OpenERP 7.0 of the horizontal financial reports
'Balance sheet' and 'Profit and Loss' as found in OpenERP 6.0.
""", """,
'website': 'http://therp.nl',
'website': 'https://launchpad.net/account-financial-report',
'images' : [], 'images' : [],
"depends" : ["account"], "depends" : ["account"],
'data': [ 'data': [

5
account_financial_report_horizontal/report/account_balance_sheet.py

@ -2,7 +2,10 @@
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# This module copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>),
# Copyright (C) 2012 Therp BV (<http://therp.nl>),
# Copyright (C) 2013 Agile Business Group sagl
# (<http://www.agilebg.com>) (<lorenzo.battistini@agilebg.com>)
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as

11
account_financial_report_horizontal/report/account_balance_sheet_horizontal.rml

@ -203,7 +203,10 @@
<para style="terp_default_9"><font color="white">[[ '. '*(a['level1']-1) ]]</font><font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]]</font></para> <para style="terp_default_9"><font color="white">[[ '. '*(a['level1']-1) ]]</font><font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name1'] ]]</font></para>
</td> </td>
<td> <td>
<para style="terp_default_Right_9"><font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(a['balance1']) ]] [[ company.currency_id.symbol ]]</font></para>
<para style="terp_default_Right_9">
<font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['code1'] and formatLang(a['balance1']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font>
</para>
</td> </td>
<td> <td>
<para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(get_lines(), 'a') ]]</font> <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font><font>[[ a['code'] ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para> <para style="terp_default_9"><font face="Times-Roman">[[ repeatIn(get_lines(), 'a') ]]</font> <font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]]</font><font>[[ a['code'] ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para>
@ -212,9 +215,11 @@
<para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para> <para style="terp_default_9"><font color="white">[[ '. '*(a['level']-1) ]]</font><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Bold_9'})) or removeParentNode('font') ]][[ a['name'] ]]</font><font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Bold_9'}) or removeParentNode('font') ]]</font></para>
</td> </td>
<td> <td>
<para style="terp_default_Right_9"><font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<para style="terp_default_Right_9">
<font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Right_9_Bold'}) or removeParentNode('font') ]]</font> <font>[[ a['name']=='Net Profit' and setTag('para','para',{'style':'terp_default_Right_9_Bold'}) or removeParentNode('font') ]]</font>
<font> [[(a['code'] and a['name']) and formatLang(a['balance']) or removeParentNode('font')]] [[ company.currency_id.symbol ]]</font></para>
<font>[[ a['code'] and formatLang(a['balance']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font>
</para>
</td> </td>
</tr> </tr>
</blockTable> </blockTable>

10
account_financial_report_horizontal/report/account_profit_horizontal.rml

@ -222,7 +222,10 @@
</para> </para>
</td> </td>
<td> <td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(a['balance']) ]] [[ company.currency_id.symbol ]]</font></para>
<para style="terp_default_Right_9">
<font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['code'] and formatLang(a['balance']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font>
</para>
</td> </td>
<td> <td>
<para style="terp_default_9"> <para style="terp_default_9">
@ -235,7 +238,10 @@
</para> </para>
</td> </td>
<td> <td>
<para style="terp_default_Right_9"><font>[[ a['level']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font><font>[[(a['code1'] and a['name1']) and formatLang(a['balance1']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font></para>
<para style="terp_default_Right_9">
<font>[[ a['level1']&lt;4 and ( setTag('para','para',{'style':'terp_default_Right_9_Bold'})) or removeParentNode('font') ]]</font>
<font>[[ a['code1'] and formatLang(a['balance1']) or removeParentNode('font') ]] [[ company.currency_id.symbol ]]</font>
</para>
</td> </td>
</tr> </tr>
</blockTable> </blockTable>

7
account_financial_report_horizontal/report/account_profit_loss.py

@ -1,7 +1,10 @@
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# This module copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>),
# Copyright (C) 2012 Therp BV (<http://therp.nl>),
# Copyright (C) 2013 Agile Business Group sagl
# (<http://www.agilebg.com>) (<lorenzo.battistini@agilebg.com>)
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as # it under the terms of the GNU Affero General Public License as
@ -113,7 +116,7 @@ class report_pl_account_horizontal(report_sxw.rml_parse, common_report_header):
elif data['form']['filter'] == 'filter_date': elif data['form']['filter'] == 'filter_date':
ctx['date_from'] = data['form'].get('date_from', False) ctx['date_from'] = data['form'].get('date_from', False)
ctx['date_to'] = data['form'].get('date_to', False) ctx['date_to'] = data['form'].get('date_to', False)
ctx['state'] = data['form'].get('target_move', 'all')
cal_list = {} cal_list = {}
account_id = data['form'].get('chart_account_id', False) account_id = data['form'].get('chart_account_id', False)
if account_id: if account_id:

10
account_financial_report_horizontal/wizard/account_report_balance_sheet.py

@ -34,12 +34,6 @@ class account_bs_report(orm.TransientModel):
_columns = { _columns = {
'display_type': fields.boolean("Landscape Mode"), 'display_type': fields.boolean("Landscape Mode"),
'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account',
required=True,
help='This Account is used for transfering Profit/Loss ' \
'(Profit: Amount will be added, Loss: Amount will be duducted), ' \
'which is calculated from Profilt & Loss Report',
domain = [('type','=','other')]),
} }
_defaults={ _defaults={
@ -50,9 +44,7 @@ class account_bs_report(orm.TransientModel):
def _print_report(self, cr, uid, ids, data, context=None): def _print_report(self, cr, uid, ids, data, context=None):
if context is None: if context is None:
context = {} context = {}
data['form'].update(self.read(cr, uid, ids, ['display_type','reserve_account_id'])[0])
if not data['form']['reserve_account_id']:
raise orm.except_orm(_('Warning'),_('Please define the Reserve and Profit/Loss account for current user company !'))
data['form'].update(self.read(cr, uid, ids, ['display_type'])[0])
data = self.pre_print_report(cr, uid, ids, data, context=context) data = self.pre_print_report(cr, uid, ids, data, context=context)
if data['form']['display_type']: if data['form']['display_type']:
return { return {

1
account_financial_report_horizontal/wizard/account_report_balance_sheet_view.xml

@ -21,7 +21,6 @@
</xpath> </xpath>
<xpath expr="//field[@name='target_move']" position="after"> <xpath expr="//field[@name='target_move']" position="after">
<field name="display_account"/> <field name="display_account"/>
<field name="reserve_account_id" required="1"/>
<field name="display_type"/> <field name="display_type"/>
<newline/> <newline/>
</xpath> </xpath>

3
account_financial_report_horizontal/wizard/account_report_profit_loss_view.xml

@ -9,9 +9,6 @@
<field name="inherit_id" ref="account_financial_report_horizontal.account_common_report_view" /> <field name="inherit_id" ref="account_financial_report_horizontal.account_common_report_view" />
<field name="arch" type="xml"> <field name="arch" type="xml">
<data> <data>
<xpath expr="//field[@name='target_move']" position="replace">
<field name="target_move" required="0" readonly="1"/>
</xpath>
<xpath expr="//field[@name='journal_ids']" position="replace"> <xpath expr="//field[@name='journal_ids']" position="replace">
<field name="journal_ids" required="0" colspan="4" nolabel="1" readonly="1"/> <field name="journal_ids" required="0" colspan="4" nolabel="1" readonly="1"/>
</xpath> </xpath>

Loading…
Cancel
Save