[IMP]: Accept is button is not visible once attendee accept event and vice versa
bzr revid: aja@tinyerp.com-20130723125034-l7e6fuzmwk21cz4l
This commit is contained in:
parent
53521121dd
commit
dffe4174b3
|
@ -52,7 +52,7 @@ class crm_meeting(base_state, osv.Model):
|
|||
if user['partner_id'][0] == attendee_pool.read(cr,uid,attendee.id,['partner_id'],context)['partner_id'][0]:
|
||||
return attendee
|
||||
return False
|
||||
|
||||
|
||||
def _check_attendee(self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
res[ids[0]] = False
|
||||
|
@ -60,6 +60,14 @@ class crm_meeting(base_state, osv.Model):
|
|||
res[ids[0]] = True
|
||||
return res
|
||||
|
||||
def _compute_status(self, cr, uid, ids, name, arg, context=None):
|
||||
res = {}
|
||||
res[ids[0]] = 'needs-action'
|
||||
attendee = self._check_status(cr, uid, ids, context)
|
||||
if attendee:
|
||||
res[ids[0]] = attendee.state
|
||||
return res
|
||||
|
||||
_columns = {
|
||||
# base_state required fields
|
||||
'create_date': fields.datetime('Creation Date', readonly=True),
|
||||
|
@ -79,6 +87,8 @@ class crm_meeting(base_state, osv.Model):
|
|||
'event_id', 'attendee_id', 'Invited People', states={'done': [('readonly', True)]}),
|
||||
'is_attendee': fields.function(_check_attendee, string='Attendee', \
|
||||
type="boolean"),
|
||||
'attendee_status': fields.function(_compute_status, string='Attendee Status', \
|
||||
type="selection"),
|
||||
}
|
||||
_defaults = {
|
||||
'state': 'open',
|
||||
|
|
|
@ -34,13 +34,14 @@
|
|||
<form string="Meetings" version="7.0">
|
||||
<header>
|
||||
<button name="do_accept" type="object"
|
||||
string="Accept" attrs="{'invisible':[('is_attendee','=',False)]}"/>
|
||||
string="Accept" attrs="{'invisible':['|',('is_attendee','=',False),('attendee_status','=','accepted')]}"/>
|
||||
<button name="do_decline" type="object"
|
||||
string="Decline" attrs="{'invisible':[('is_attendee','=',False)]}"/>
|
||||
string="Decline" attrs="{'invisible':['|',('is_attendee','=',False),('attendee_status','=','declined')]}"/>
|
||||
<field name="state" invisible="True"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<field name="is_attendee" invisible="1"/>
|
||||
<field name="attendee_status" invisible="1"/>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
<label for="name"/>
|
||||
|
|
Loading…
Reference in New Issue