[IMP] account: useability... removed the role 'period', and added group 'account / managers' on the button to reopen a closed period
bzr revid: qdp-launchpad@tinyerp.com-20100827092012-61i93xb9ia0upqe5
This commit is contained in:
parent
dc9cea6820
commit
ba8241deb4
|
@ -883,13 +883,10 @@ class account_period(osv.osv):
|
|||
return ids
|
||||
|
||||
def action_draft(self, cr, uid, ids, *args):
|
||||
users_roles = self.pool.get('res.users').browse(cr, uid, uid).roles_id
|
||||
for role in users_roles:
|
||||
if role.name=='Period':
|
||||
mode = 'draft'
|
||||
for id in ids:
|
||||
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
|
||||
cr.execute('update account_period set state=%s where id=%s', (mode, id))
|
||||
mode = 'draft'
|
||||
for id in ids:
|
||||
cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id))
|
||||
cr.execute('update account_period set state=%s where id=%s', (mode, id))
|
||||
return True
|
||||
|
||||
def name_search(self, cr, user, name, args=None, operator='ilike', context={}, limit=80):
|
||||
|
|
|
@ -85,11 +85,6 @@
|
|||
Period
|
||||
-->
|
||||
|
||||
<record id="res_role_period" model="res.roles">
|
||||
<field eval=""""Period"""" name="name"/>
|
||||
<field name="description">Assign this role to the persons that should have the rights to re-open a closed period.</field>
|
||||
</record>
|
||||
|
||||
<record id="view_account_period_form" model="ir.ui.view">
|
||||
<field name="name">account.period.form</field>
|
||||
<field name="model">account.period</field>
|
||||
|
@ -105,7 +100,7 @@
|
|||
<field name="special"/>
|
||||
<separator colspan="4" string="States"/>
|
||||
<field name="state" select="1"/>
|
||||
<button name="action_draft" states="done" string="Set to Draft" type="object" icon="gtk-convert"/>
|
||||
<button name="action_draft" states="done" string="Set to Draft" type="object" icon="gtk-convert" groups="account.group_account_manager"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
|
Loading…
Reference in New Issue