[IMP] account: small improvements

*changed label of fiscalyear in draft state (from Draft to Open)
*put readonly of related fields company_id on account_period and account_journal_period + removed the default for it
*changed menuitem structure for templates

bzr revid: qdp-launchpad@tinyerp.com-20100818145219-sf1jk9z5csrvmwwh
This commit is contained in:
qdp-launchpad@tinyerp.com 2010-08-18 16:52:19 +02:00
parent 3d967d97d3
commit 7ddaee4694
2 changed files with 5 additions and 10 deletions

View File

@ -795,10 +795,8 @@ class account_fiscalyear(osv.osv):
'date_start': fields.date('Start Date', required=True),
'date_stop': fields.date('End Date', required=True),
'period_ids': fields.one2many('account.period', 'fiscalyear_id', 'Periods'),
'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True,
help='When fiscal year is created. The state is \'Draft\'. At the end of the year it is in \'Done\' state.'),
'state': fields.selection([('draft','Open'), ('done','Closed')], 'State', readonly=True),
}
_defaults = {
'state': lambda *a: 'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
@ -875,11 +873,10 @@ class account_period(osv.osv):
'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done':[('readonly',True)]}, select=True),
'state': fields.selection([('draft','Draft'), ('done','Done')], 'State', readonly=True,
help='When monthly periods are created. The state is \'Draft\'. At the end of monthly period it is in \'Done\' state.'),
'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True)
'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
}
_defaults = {
'state': lambda *a: 'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
_order = "date_start"
@ -1010,7 +1007,6 @@ class account_journal_period(osv.osv):
_defaults = {
'state': lambda *a: 'draft',
'active': lambda *a: True,
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
}
_order = "period_id"

View File

@ -2142,7 +2142,7 @@
<field name="view_mode">tree,form,search</field>
</record>
<menuitem action="action_account_chart_template_form" id="menu_action_account_chart_template_form" parent="account_template_accounts"/>
<menuitem action="action_account_chart_template_form" id="menu_action_account_chart_template_form" parent="account_template_accounts" sequence="1"/>
<!-- Account Tax Templates -->
@ -2326,8 +2326,7 @@
<attribute name='string'></attribute>
</xpath>
<group string="res_config_contents" position="replace">
<field name="company_id" widget="selection"
/>
<field name="company_id" widget="selection"/>
<field name ="code_digits" />
<field name="chart_template_id"/>
<field name ="seq_journal" />
@ -2428,7 +2427,7 @@
<menuitem
action="action_account_fiscal_position_template_form"
id="menu_action_account_fiscal_position_form_template"
parent="account_template_folder" sequence="20"/>
parent="account_template_taxes" sequence="20"/>
<!-- Cash Statement -->
<record id="view_cash_statement_tree" model="ir.ui.view">