[fix] l10n_ch_chart_c2c_pcg: migrate to res.config-based initial configuration
bzr revid: xmo@tinyerp.com-20091215111912-zoejxzwq1cnp7m39
This commit is contained in:
parent
0002fb427e
commit
109999463e
|
@ -111,7 +111,7 @@ class Journal(osv.osv_memory):
|
|||
)
|
||||
return {}
|
||||
|
||||
def execute(self,cr,uid,ids,context={}):
|
||||
def execute(self,cr,uid,ids,context=None):
|
||||
jids = self.pool.get('account.journal').search(cr, uid, [])
|
||||
if self._inner_steps < len(jids)-1:
|
||||
self._inner_steps += 1
|
||||
|
|
|
@ -11,38 +11,38 @@
|
|||
<field name="name">account.tax.template.todo</field>
|
||||
<field name="model">account.tax.template.todo</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Account tax template">
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
</group>
|
||||
<separator colspan="4" string="The accounts linked to the tax template"/>
|
||||
<field name="account_collected_id"
|
||||
on_change="on_change_collected(name, account_collected_id)" select="1"/>
|
||||
<field name="account_paid_id"
|
||||
on_change="on_change_paid(name, account_paid_id)" select="1"/>
|
||||
<group col="4" colspan="4">
|
||||
<button icon="gtk-cancel" name="action_cancel" string="Cancel" type="object"/>
|
||||
<button icon="gtk-ok" name="action_new" string="Next" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
<data>
|
||||
<form position="attributes"><attribute name="string">
|
||||
Account tax template
|
||||
</attribute></form>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<label colspan="4" align="0.0" string="
|
||||
Set account on financial taxes defined by
|
||||
Camptocamp l10n_ch_c2c_pcg module"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1"/>
|
||||
</group>
|
||||
<separator colspan="4" string="The accounts linked to the tax template"/>
|
||||
<field name="account_collected_id"
|
||||
on_change="on_change_collected(name, account_collected_id)" select="1"/>
|
||||
<field name="account_paid_id"
|
||||
on_change="on_change_paid(name, account_paid_id)" select="1"/>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_config_tax" model="ir.actions.act_window">
|
||||
<field name="name">Configure Journal</field>
|
||||
<record id="action_config_tax" model="ir.actions.act_window">
|
||||
<field name="name">Finalize your tax configuration</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">account.tax.template.todo</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_tax_template_form_todo"/>
|
||||
<field name="view_id" ref="view_tax_template_form_todo"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_config_tax_todo" model="ir.actions.todo">
|
||||
<field name="name">Finalize your tax configuration</field>
|
||||
<field name="note">Set account on financial taxes defined by
|
||||
Camptocamp l10n_ch_c2c_pcg module</field>
|
||||
<field name="action_id" ref="action_config_tax"/>
|
||||
<field name="sequence">5</field>
|
||||
</record>
|
||||
|
|
|
@ -7,10 +7,11 @@
|
|||
#
|
||||
from osv import fields, osv
|
||||
|
||||
class Tax_template(osv.osv):
|
||||
class Tax_template(osv.osv_memory):
|
||||
"""Creat account.journal.todo class in order
|
||||
to add configuration wizzard"""
|
||||
_name ="account.tax.template.todo"
|
||||
_inherit = 'res.config'
|
||||
|
||||
def _ensure_step(self):
|
||||
if getattr(self, '_inner_steps', None) is None:
|
||||
|
@ -80,16 +81,7 @@ class Tax_template(osv.osv):
|
|||
return self._on_change(
|
||||
cr, uid, ids, tax, vals={'account_paid_id': account})
|
||||
|
||||
def action_cancel(self,cr,uid,ids,context=None):
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
def action_new(self,cr,uid,ids,context={}):
|
||||
def execute(self,cr,uid,ids,context={}):
|
||||
jids = self.pool.get('account.tax.template').search(cr, uid, [])
|
||||
if self._inner_steps < len(jids)-1 :
|
||||
self._inner_steps += 1
|
||||
|
@ -100,10 +92,7 @@ class Tax_template(osv.osv):
|
|||
"view_mode": 'form',
|
||||
'res_model': 'account.tax.template.todo',
|
||||
'view_id':self.pool.get('ir.ui.view').search(
|
||||
cr,
|
||||
uid,
|
||||
[('name','=','view_account_journal_form_todo')]
|
||||
),
|
||||
cr, uid, [('name','=','account.tax.template.todo')]),
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue