Browse Source

[fix] no more property_reserve_and_surplus_account field

pull/605/head
Lorenzo Battistini 12 years ago
committed by mreficent
parent
commit
5569a0b858
  1. 17
      account_financial_report_horizontal/wizard/account_report_balance_sheet.py
  2. 2
      account_financial_report_horizontal/wizard/account_report_balance_sheet_view.xml

17
account_financial_report_horizontal/wizard/account_report_balance_sheet.py

@ -30,13 +30,6 @@ class account_bs_report(osv.osv_memory):
_inherit = "account_financial_report_horizontal.common.account.report" _inherit = "account_financial_report_horizontal.common.account.report"
_description = 'Account Balance Sheet Report' _description = 'Account Balance Sheet Report'
def _get_def_reserve_account(self, cr, uid, context=None):
chart_id = self._get_account(cr, uid, context=context)
res = self.onchange_chart_id(cr, uid, [], chart_id, context=context)
if not res:
return False
return res['value']['reserve_account_id']
_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', 'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account',
@ -50,18 +43,8 @@ class account_bs_report(osv.osv_memory):
_defaults={ _defaults={
'display_type': True, 'display_type': True,
'journal_ids': [], 'journal_ids': [],
'reserve_account_id': _get_def_reserve_account,
} }
def onchange_chart_id(self, cr, uid, ids, chart_id, context=None):
if not chart_id:
return {}
account = self.pool.get('account.account').browse(cr, uid, chart_id , context=context)
if not account.company_id.property_reserve_and_surplus_account:
return {'value': {'reserve_account_id': False}}
return {'value': {'reserve_account_id': account.company_id.property_reserve_and_surplus_account.id}}
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 = {}

2
account_financial_report_horizontal/wizard/account_report_balance_sheet_view.xml

@ -10,7 +10,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<data> <data>
<xpath expr="//field[@name='chart_account_id']" position="replace"> <xpath expr="//field[@name='chart_account_id']" position="replace">
<field name="chart_account_id" widget="selection" on_change="onchange_chart_id(chart_account_id)"/>
<field name="chart_account_id" widget="selection" />
</xpath> </xpath>
<xpath expr="//field[@name='journal_ids']" position="replace"> <xpath expr="//field[@name='journal_ids']" position="replace">
<field name="journal_ids" colspan="4" nolabel="1" required="0" readonly="1"/> <field name="journal_ids" colspan="4" nolabel="1" required="0" readonly="1"/>

Loading…
Cancel
Save