[IMP] account_period:-remove the role and added the group 'account/manager' on 'Set to Draft button

bzr revid: mtr@mtr-20100827110133-bh05m92ll0q0733j
This commit is contained in:
mtr 2010-08-27 16:31:33 +05:30
parent 952bd239c7
commit 8026bd9279
2 changed files with 5 additions and 8 deletions

View File

@ -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):

View File

@ -104,7 +104,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>