[IMP] caldav: Improve view
bzr revid: hmo@tinyerp.com-20100211095330-8o8xhdl5i9pcf7le
This commit is contained in:
parent
197f0b0135
commit
459fb2a5c1
|
@ -314,7 +314,7 @@ class calendar_attendee(osv.osv):
|
|||
obj = model_obj.read(cr, uid, res_id, ['date'])[0]
|
||||
result[id][name] = obj.get('date')
|
||||
else:
|
||||
result[id][name] = None
|
||||
result[id][name] = False
|
||||
if name == 'event_end_date':
|
||||
if attdata.ref:
|
||||
model, res_id = tuple(attdata.ref.split(','))
|
||||
|
@ -322,7 +322,7 @@ class calendar_attendee(osv.osv):
|
|||
obj = model_obj.read(cr, uid, res_id, ['date_deadline'])[0]
|
||||
result[id][name] = obj.get('date_deadline')
|
||||
else:
|
||||
result[id][name] = None
|
||||
result[id][name] = False
|
||||
if name == 'sent_by_uid':
|
||||
if attdata.ref:
|
||||
model, res_id = tuple(attdata.ref.split(','))
|
||||
|
@ -353,8 +353,8 @@ class calendar_attendee(osv.osv):
|
|||
_columns = {
|
||||
'cutype': fields.selection([('individual', 'Individual'), \
|
||||
('group', 'Group'), ('resource', 'Resource'), \
|
||||
('room', 'Room'), ('unknown', 'Unknown') ], \
|
||||
'User Type', help="Specify the type of calendar user"),
|
||||
('room', 'Room'), ('unknown', '') ], \
|
||||
'Invite Type', help="Specify the type of Invitation"),
|
||||
'member': fields.char('Member', size=124,
|
||||
help="Indicate the groups that the attendee belongs to"),
|
||||
'role': fields.selection([('req-participant', 'Participation required'), \
|
||||
|
@ -438,7 +438,7 @@ request was delegated to"),
|
|||
att2.email) + ' - Status: ' + att2.state.title())
|
||||
body_vals = {'name': res_obj.name,
|
||||
'start_date': res_obj.date,
|
||||
'end_date': res_obj.date_deadline or None,
|
||||
'end_date': res_obj.date_deadline or False,
|
||||
'description': res_obj.description or '-',
|
||||
'location': res_obj.location or '-',
|
||||
'attendees': '<br>'.join(att_infos),
|
||||
|
@ -737,7 +737,7 @@ defines the list of date/time exceptions for arecurring calendar component."),
|
|||
'exrule': fields.char('Exception Rule', size=352, help="defines a \
|
||||
rule or repeating pattern for anexception to a recurrence set"),
|
||||
'rrule': fields.char('Recurrent Rule', size=124),
|
||||
'rrule_type': fields.selection([('none', 'None'), ('daily', 'Daily'), \
|
||||
'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \
|
||||
('weekly', 'Weekly'), ('monthly', 'Monthly'), \
|
||||
('yearly', 'Yearly'), ('custom', 'Custom')], 'Recurrency'),
|
||||
'alarm_id': fields.many2one('res.alarm', 'Alarm'),
|
||||
|
@ -745,7 +745,7 @@ rule or repeating pattern for anexception to a recurrence set"),
|
|||
'recurrent_uid': fields.integer('Recurrent ID'),
|
||||
'recurrent_id': fields.datetime('Recurrent ID date'),
|
||||
'vtimezone': fields.selection(_tz_get, 'Timezone', size=64),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
'user_id': fields.many2one('res.users', 'Responsible'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<field name="model">calendar.attendee</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Atendee details">
|
||||
<form string="Invitation details">
|
||||
<field name="user_id"
|
||||
on_change="onchange_user_id(user_id)" readonly="1" />
|
||||
<field name="email" select="1" readonly="1" />
|
||||
|
@ -70,11 +70,11 @@
|
|||
<field name="partner_address_id" select="1" readonly="1" />
|
||||
<newline />
|
||||
<field name="role" select="1" readonly="1" string="Role" />
|
||||
<field name="cutype" select="1" readonly="1" string="Invitation type" />
|
||||
<field name="cutype" select="1" readonly="1" string="Invite type" />
|
||||
<newline />
|
||||
<field name="rsvp" readonly="1" />
|
||||
<notebook colspan="4">
|
||||
<page string="Details">
|
||||
<page string="Events">
|
||||
<field name="event_date" />
|
||||
<field name="event_end_date" />
|
||||
<newline />
|
||||
|
@ -117,10 +117,11 @@
|
|||
<field name="model">calendar.attendee</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Atendee details" editable="top">
|
||||
<field name="email" select="1" />
|
||||
<field name="role" select="1" />
|
||||
<field name="cutype" select="1" />
|
||||
<tree string="Invitation details" editable="top">
|
||||
<field name="email" />
|
||||
<field name="partner_id" string="Partner" />
|
||||
<field name="partner_address_id" string="Contact" />
|
||||
<field name="role" />
|
||||
<field name="state" />
|
||||
</tree>
|
||||
</field>
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<group col="6" colspan="4">
|
||||
<field name="name" select="1" string="Summary"
|
||||
colspan="4" />
|
||||
<field name="categ_id"/>
|
||||
<field name="categ_id" widget="selection" string="Meeting Type" domain="[('object_id.model', '=', 'crm.meeting')]"/>
|
||||
<field name="date" string="Start Date" required="1" />
|
||||
<field name="duration" widget="float_time" />
|
||||
<field name="date_deadline" string="End Date" required="1" />
|
||||
|
@ -75,11 +75,12 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree string="Meetings" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
|
||||
<field name="id" widget="char"/>
|
||||
<field name="name" string="Title"/>
|
||||
<field name="date" string="Meeting Date"/>
|
||||
<field name="name" string="Subject"/>
|
||||
<field name="partner_id" string="Partner"/>
|
||||
<field name="section_id" />
|
||||
<field name="priority"/>
|
||||
<field name="date" string="Meeting Date"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="priority"/>
|
||||
<field name="user_id"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
|
|
|
@ -29,11 +29,9 @@ class crm_meeting(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Category', \
|
||||
domain="[('section_id','=',section_id),\
|
||||
('object_id.model', '=', 'crm.meeting')]", \
|
||||
help='Category related to the section.Subdivide the CRM cases \
|
||||
independently or section-wise.'),
|
||||
'categ_id': fields.many2one('crm.case.categ', 'Meeting Type', \
|
||||
domain="[('object_id.model', '=', 'crm.meeting')]", \
|
||||
),
|
||||
'phonecall_id':fields.many2one ('crm.phonecall', 'Phonecall'),
|
||||
'opportunity_id':fields.many2one ('crm.opportunity', 'Opportunity'),
|
||||
'attendee_ids': fields.many2many('calendar.attendee', 'event_attendee_rel', 'event_id', 'attendee_id', 'Attendees'),
|
||||
|
@ -41,4 +39,28 @@ independently or section-wise.'),
|
|||
|
||||
crm_meeting()
|
||||
|
||||
class calendar_attendee(osv.osv):
|
||||
_inherit = 'calendar.attendee'
|
||||
|
||||
def _compute_data(self, cr, uid, ids, name, arg, context):
|
||||
name = name[0]
|
||||
result = super(calendar_attendee, self)._compute_data(cr, uid, ids, name, arg, context)
|
||||
|
||||
for attdata in self.browse(cr, uid, ids, context=context):
|
||||
id = attdata.id
|
||||
result[id] = {}
|
||||
if name == 'categ_id':
|
||||
if attdata.ref:
|
||||
model, res_id = tuple(attdata.ref.split(','))
|
||||
model_obj = self.pool.get(model)
|
||||
obj = model_obj.read(cr, uid, res_id, ['categ_id'])[0]
|
||||
result[id][name] = obj.get('categ_id')
|
||||
else:
|
||||
result[id][name] = False
|
||||
return result
|
||||
_columns = {
|
||||
'categ_id': fields.function(_compute_data, method=True, string='Event Type', type="many2one", relation="crm.case.categ", multi='categ_id'),
|
||||
}
|
||||
calendar_attendee()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -100,6 +100,31 @@
|
|||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="attendee_form_view_inherit" model="ir.ui.view">
|
||||
<field name="name">calendar.attendee.form.inherit</field>
|
||||
<field name="model">calendar.attendee</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="caldav.caldav_attendee_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="language" position="after">
|
||||
<field name="categ_id" string="Event Type"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="attendee_tree_view_inherit" model="ir.ui.view">
|
||||
<field name="name">calendar.attendee.tree.inherit</field>
|
||||
<field name="model">calendar.attendee</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="inherit_id" ref="caldav.caldav_attendee_tree_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="role" position="after">
|
||||
<field name="categ_id" string="Event Type"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue