[IMP] meetings forms and features

bzr revid: fp@openerp.com-20120714153350-tr9dkw5f4pxpf5ev
This commit is contained in:
Fabien Pinckaers 2012-07-14 17:33:50 +02:00
parent 734d54a3f5
commit b2609bd3c7
9 changed files with 162 additions and 212 deletions

View File

@ -1031,10 +1031,10 @@ class calendar_event(osv.osv):
'duration': fields.float('Duration', states={'done': [('readonly', True)]}),
'description': fields.text('Description', states={'done': [('readonly', True)]}),
'class': fields.selection([('public', 'Public'), ('private', 'Private'), \
('confidential', 'Public for Employees')], 'Mark as', states={'done': [('readonly', True)]}),
('confidential', 'Public for Employees')], 'Privacy', states={'done': [('readonly', True)]}),
'location': fields.char('Location', size=264, help="Location of Event", states={'done': [('readonly', True)]}),
'show_as': fields.selection([('free', 'Free'), ('busy', 'Busy')], \
'Show as', states={'done': [('readonly', True)]}),
'Show Time as', states={'done': [('readonly', True)]}),
'base_calendar_url': fields.char('Caldav URL', size=264),
'state': fields.selection([('tentative', 'Tentative'),
('cancelled', 'Cancelled'),
@ -1051,7 +1051,7 @@ rule or repeating pattern of time to exclude from the recurring rule."),
('yearly', 'Yearly'),],
'Recurrency', states={'done': [('readonly', True)]},
help="Let the event automatically repeat at that interval"),
'alarm_id': fields.many2one('res.alarm', 'Alarm', states={'done': [('readonly', True)]},
'alarm_id': fields.many2one('res.alarm', 'Reminder', states={'done': [('readonly', True)]},
help="Set an alarm at this time, before the event occurs" ),
'base_calendar_alarm_id': fields.many2one('calendar.alarm', 'Alarm'),
'recurrent_uid': fields.integer('Recurrent ID'),

View File

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
@ -50,15 +50,14 @@ class crm_meeting(base_state, osv.Model):
'write_date': fields.datetime('Write Date', readonly=True),
'date_open': fields.datetime('Confirmed', readonly=True),
'date_closed': fields.datetime('Closed', readonly=True),
'partner_id': fields.many2one('res.partner', 'Partner', states={'done': [('readonly', True)]}),
'email_from': fields.char('Email', size=128, states={'done': [('readonly', True)]},
help="These people will receive email."),
'partner_ids': fields.many2many('res.partner', string='Attendees', states={'done': [('readonly', True)]}),
'state': fields.selection(
[('draft', 'Unconfirmed'), ('open', 'Confirmed'), ('cancel', 'Cancelled'), ('done', 'Done')],
string='Status', size=16, readonly=True),
# Meeting fields
'name': fields.char('Summary', size=128, required=True, states={'done': [('readonly', True)]}),
'categ_id': fields.many2one('crm.meeting.type', 'Meeting Type'),
'name': fields.char('Meeting Subject', size=128, required=True, states={'done': [('readonly', True)]}),
'categ_ids': fields.many2many('crm.meeting.type', 'meeting_category_rel',
'event_id', 'type_id', 'Tags'),
'attendee_ids': fields.many2many('calendar.attendee', 'meeting_attendee_rel',\
'event_id', 'attendee_id', 'Attendees', states={'done': [('readonly', True)]}),
}

View File

@ -75,7 +75,7 @@
<header>
<button name="case_open" string="Confirm" type="object" class="oe_highlight"
states="draft"/>
<button name="case_close" string="Done" type="object" class="oe_highlight"
<button name="case_close" string="Done" type="object"
states="open"/>
<button name="case_reset" string="Reset to Unconfirmed" type="object"
states="cancel,done"/>
@ -86,163 +86,160 @@
<sheet>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name" string="Title"/>
(<field name="allday" on_change="onchange_dates(date,False,False,allday)" class="oe_inline"/>
<label for="allday" string="All Day?"/>)
<label for="name"/>
</div>
<h1>
<field name="name"/>
</h1>
<label for="partner_ids" class="oe_edit_only"/>
<h2>
<label for="date" string="Starting at"/>
<field name="date" required="1" class="oe_inline"/>
<label for="location" string="in" class="oe_inline" attrs="{'invisible': [('location', '=', False)]}"/>
<field name="location" placeholder="Specify the location here" class="oe_inline"/>
</h2>
<h2>
<label for="duration" string="Duration" />
<field name="duration" widget="float_time"
on_change="onchange_dates(date,duration,False,allday)"
class="oe_inline"/> (
<field name="date_deadline"
string="End Date" required="1"
on_change="onchange_dates(date,False,date_deadline)"
class="oe_inline"/> )
<field name="partner_ids" widget="many2many_tags"/>
</h2>
</div>
<group>
<group>
<field name="user_id" />
<field name="organizer"/>
</group>
<group>
<field name="alarm_id" string="Reminder" widget="selection" />
<field name="class" string="Privacy"/>
<field name="show_as" string="Show Time as"/>
<field name="recurrency" string="Recurrence" attrs="{'readonly': ['|', ('recurrent_uid','!=',False), ('state','=','done')]}"/>
</group>
<group>
<field name="partner_id" string="Partner"
on_change="onchange_partner_id(partner_id)" />
<field name="email_from"/>
</group>
<group>
<field name="categ_id" widget="selection"/>
<field name="rrule" invisible="1" readonly="1"/>
<field name="recurrent_id" invisible="1"/>
<field name="recurrent_uid" invisible="1"/>
</group>
</group>
<separator string="Description"/>
<field name="description"/>
<notebook>
<page string="Invitation Detail">
<button string="Invite People"
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
icon="terp-partner" type="action"
attrs="{'readonly': [('state', '=', 'done')]}"
context="{'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}" colspan="2"/>
<field name="attendee_ids" widget="one2many" mode="tree">
<tree string="Invitation details" editable="top">
<field name="sent_by_uid" string="From"/>
<field name="user_id" string="To"/>
<field name="email" string="Mail To"/>
<field name="role" />
<field name="state" />
<button name="do_tentative"
states="needs-action,declined,accepted"
string="Uncertain" type="object"
icon="terp-crm" />
<button name="do_accept" string="Accept"
states="needs-action,tentative,declined"
type="object" icon="gtk-apply" />
<button name="do_decline" string="Decline"
states="needs-action,tentative,accepted"
type="object" icon="gtk-cancel" />
<button
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
string="Delegate" type="action"
icon="gtk-sort-descending"
states="needs-action,tentative,declined,accepted"
context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
</tree>
<form string="Invitation details" version="7.0">
<header>
<button name="do_tentative" type="object"
states="needs-action,declined,accepted"
string="Uncertain" icon="terp-crm" />
<button name="do_accept" type="object"
states="needs-action,tentative,declined"
string="Accept" icon="gtk-apply" />
<button name="do_decline" type="object"
states="needs-action,tentative,accepted"
string="Decline" icon="gtk-cancel" />
<button name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d" type="action"
states="needs-action,tentative,declined,accepted"
string="Delegate" icon="gtk-sort-descending"
context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
<field name="state" widget="statusbar" statusbar_visible="draft,open,done"/>
</header>
<group>
<group>
<field name="email" />
<field name="rsvp" />
<field name="cutype" />
<field name="role" />
</group>
<group>
<field name="user_id"/>
</group>
</group>
</form>
</field>
</page>
<page string="Recurrence Options"><!-- attrs="{'invisible': [('recurrency','=',False)], 'readonly': ['|', ('recurrent_uid','!=',False), ('state','=','done')]}">-->
<group col="4" colspan="4" name="rrule">
<group col="4" colspan="4">
<field name="rrule_type" string=" Recurrence Pattern" />
<field name="interval" />
<field name="end_type" />
<label string=" " colspan="2" />
<newline />
<field name="count" attrs="{'invisible' : [('end_type', '!=', 'count')] }"/>
<label string=" " colspan="2" />
<newline />
<field name="end_date" attrs="{'invisible' : [('end_type', '!=', 'end_date')], 'required': [('end_type', '=', 'end_date')]}"/>
<newline />
</group>
<group col="8" colspan="4" name="Select weekdays" attrs="{'invisible' :[('rrule_type','not in', ['weekly'])]}">
<separator string="Choose day where repeat the meeting" colspan="8"/>
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<newline/>
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
</group>
<group col="10" colspan="4"
attrs="{'invisible' : [('rrule_type','!=','monthly')]}">
<separator string="Choose day in the month where repeat the meeting" colspan="12"/>
<group col="2" colspan="1">
<field name="select1" />
</group>
<group col="2" colspan="1">
<field name="day"
attrs="{'required' : [('select1','=','date'), ('rrule_type','=','monthly')],
'invisible' : [('select1','=','day')]}" />
</group>
<group col="3" colspan="1">
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day'), ('rrule_type','=','monthly')], 'invisible' : [('select1','=','date')]}" />
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day'), ('rrule_type','=','monthly')], 'invisible' : [('select1','=','date')]}" />
</group>
</group>
<page string="Meeting Detail">
<group>
<group>
<field name="user_id" />
<field name="categ_ids" widget="many2many_tags"/>
<field name="location"/>
<field name="organizer" groups="base.group_no_one"/>
</group>
</page>
<group>
<label for="date" string="Starting at"/>
<div>
<field name="date"/>
<span attrs="{'invisible': [('allday','=',True)]}">
(<field name="duration" widget="float_time"
on_change="onchange_dates(date,duration,False,allday)"
class="oe_inline"/> hours)
</span>
</div>
<label for="date_deadline" />
<div>
<field name="date_deadline"
string="End Date" attrs="{'invisible': [('allday','=',True)]}"
on_change="onchange_dates(date,False,date_deadline)"/>
(<field name="allday" on_change="onchange_dates(date,False,False,allday)" class="oe_inline"/>
<label for="allday" string="All Day?"/>)
</div>
<field name="recurrency"
attrs="{'readonly': ['|', ('recurrent_uid','!=',False), ('state','=','done')]}"/>
</group>
<group>
<field name="alarm_id" widget="selection" />
<field name="class"/>
<field name="show_as"/>
<field name="rrule" invisible="1" readonly="1"/>
<field name="recurrent_id" invisible="1"/>
<field name="recurrent_uid" invisible="1"/>
</group>
<group attrs="{'invisible': [('recurrency','=',False)]}">
<label for="interval"/>
<div>
<field name="interval" class="oe_inline"/>
<field name="rrule_type" class="oe_inline"/>
</div>
<label string="Until" for="end_type"/>
<div>
<field name="end_type" class="oe_inline"/>
<field name="count" attrs="{'invisible' : [('end_type', '!=', 'count')] }" class="oe_inline"/>
<field name="end_date" attrs="{'invisible' : [('end_type', '!=', 'end_date')], 'required': [('end_type', '=', 'end_date')]}" class="oe_inline"/>
</div>
<label string="Select Weekdays" attrs="{'invisible' :[('rrule_type','not in', ['weekly'])]}"/>
<group col="4" colspan="1" name="weekdays" attrs="{'invisible' :[('rrule_type','not in', ['weekly'])]}">
<field name="mo" />
<field name="tu" />
<field name="we" />
<field name="th" />
<field name="fr" />
<field name="sa" />
<field name="su" />
</group>
<label string="Day of Month"
attrs="{'invisible' : [('rrule_type','!=','monthly')]}"/>
<div attrs="{'invisible' : [('rrule_type','!=','monthly')]}">
<field name="select1" />
<field name="day"
attrs="{'required' : [('select1','=','date'), ('rrule_type','=','monthly')],
'invisible' : [('select1','=','day')]}" />
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day'), ('rrule_type','=','monthly')], 'invisible' : [('select1','=','date')]}" />
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day'), ('rrule_type','=','monthly')], 'invisible' : [('select1','=','date')]}" />
</div>
</group>
</group>
<label for="description"/>
<field name="description"/>
</page>
<page string="Invitation Detail">
<button string="Invite People"
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
icon="terp-partner" type="action"
attrs="{'readonly': [('state', '=', 'done')]}"
context="{'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}" colspan="2"/>
<field name="attendee_ids" widget="one2many" mode="tree">
<tree string="Invitation details" editable="top">
<field name="sent_by_uid" string="From"/>
<field name="user_id" string="To"/>
<field name="email" string="Mail To"/>
<field name="role" />
<field name="state" />
<button name="do_tentative"
states="needs-action,declined,accepted"
string="Uncertain" type="object"
icon="terp-crm" />
<button name="do_accept" string="Accept"
states="needs-action,tentative,declined"
type="object" icon="gtk-apply" />
<button name="do_decline" string="Decline"
states="needs-action,tentative,accepted"
type="object" icon="gtk-cancel" />
<button
name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
string="Delegate" type="action"
icon="gtk-sort-descending"
states="needs-action,tentative,declined,accepted"
context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
</tree>
<form string="Invitation details" version="7.0">
<header>
<button name="do_tentative" type="object"
states="needs-action,declined,accepted"
string="Uncertain" icon="terp-crm" />
<button name="do_accept" type="object"
states="needs-action,tentative,declined"
string="Accept" icon="gtk-apply" />
<button name="do_decline" type="object"
states="needs-action,tentative,accepted"
string="Decline" icon="gtk-cancel" />
<button name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d" type="action"
states="needs-action,tentative,declined,accepted"
string="Delegate" icon="gtk-sort-descending"
context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
<field name="state" widget="statusbar" statusbar_visible="draft,open,done"/>
</header>
<group>
<group>
<field name="email" />
<field name="rsvp" />
<field name="cutype" />
<field name="role" />
</group>
<group>
<field name="user_id"/>
</group>
</group>
</form>
</field>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
@ -266,9 +263,6 @@
<field name="date"/>
<field name="state"/>
<field name="duration" />
<field name="partner_id" string="Partner" />
<field name="location" />
<field name="categ_id"/>
<field name="needaction_pending" invisible="1"/>
</tree>
</field>
@ -284,7 +278,7 @@
<field name="arch" type="xml">
<calendar string="Meetings" date_start="date" color="user_id" date_stop="date_deadline" date_delay="duration">
<field name="name"/>
<field name="partner_id"/>
<field name="user_id"/>
</calendar>
</field>
</record>
@ -309,8 +303,8 @@
<field name="arch" type="xml">
<search string="Search Meetings">
<group>
<field name="name" string="Meeting / Partner"
filter_domain="['|',('name','ilike',self),('partner_id','ilike', self)]"/>
<field name="name" string="Meeting"
filter_domain="[('name','ilike',self)]"/>
<filter string="Inbox" help="Unread messages" icon="terp-mail-message-new"
name="needaction_pending" domain="[('needaction_pending','=',True)]"/>
<separator orientation="vertical"/>
@ -318,7 +312,7 @@
domain="[('user_id','=',uid)]"/>
<separator orientation="vertical"/>
<field name="user_id"/>
<field name="partner_id"/>
<field name="partner_ids"/>
</group>
</search>
</field>

View File

@ -32,8 +32,6 @@ class crm_meeting(osv.Model):
""" Model for CRM meetings """
_inherit = 'crm.meeting'
_columns = {
'section_id': fields.many2one('crm.case.section', 'Sales Team', states={'done': [('readonly', True)]},
select=True, groups='base.group_sale_salesman', help='Sales team to which Case belongs to.'),
'phonecall_id': fields.many2one ('crm.phonecall', 'Phonecall'),
'opportunity_id': fields.many2one ('crm.lead', 'Opportunity', domain="[('type', '=', 'opportunity')]"),
}

View File

@ -8,11 +8,9 @@
<!--For Meetings-->
<record id="crm_case_followuponproposal0" model="crm.meeting">
<field eval="1" name="active"/>
<field name="partner_id" ref="base.res_partner_maxtor"/>
<field name="user_id" ref="base.user_root"/>
<field eval="&quot;Meeting to discuss project plan and hash out the details of implementation &quot;" name="description"/>
<field eval="&quot;open&quot;" name="state"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="time.strftime('%Y-%m-03 10:20:03')" name="date"/>
<field name="categ_id" ref="crm.categ_meet2"/>
<field eval="&quot;Follow-up on proposal&quot;" name="name"/>
@ -23,10 +21,8 @@
<record id="crm_case_initialdiscussion0" model="crm.meeting">
<field eval="1" name="active"/>
<field eval="7.0" name="duration"/>
<field name="partner_id" ref="base.res_partner_10"/>
<field name="user_id" ref="base.user_root"/>
<field eval="&quot;draft&quot;" name="state"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="time.strftime('%Y-%m-05 12:01:01')" name="date"/>
<field name="categ_id" ref="crm.categ_meet3"/>
<field eval="&quot;Initial discussion&quot;" name="name"/>
@ -37,11 +33,9 @@
<record id="crm_case_discusspricing0" model="crm.meeting">
<field eval="1" name="active"/>
<field eval="3.0" name="duration"/>
<field name="partner_id" ref="base.res_partner_3"/>
<field name="user_id" ref="base.user_root"/>
<field eval="&quot;Meeting to discuss project plan and hash out the details of implementation &quot;" name="description"/>
<field eval="&quot;done&quot;" name="state"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="time.strftime('%Y-%m-12 15:55:05')" name="date"/>
<field name="categ_id" ref="crm.categ_meet1"/>
<field eval="&quot;Discuss pricing&quot;" name="name"/>
@ -51,10 +45,8 @@
<record id="crm_case_reviewneeds0" model="crm.meeting">
<field eval="1" name="active"/>
<field eval="6.0" name="duration"/>
<field name="partner_id" ref="base.res_partner_11"/>
<field name="user_id" ref="base.user_demo"/>
<field eval="&quot;open&quot;" name="state"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="time.strftime('%Y-%m-20 10:02:02')" name="date"/>
<field name="categ_id" ref="crm.categ_meet3"/>
<field eval="&quot;Review needs&quot;" name="name"/>
@ -64,10 +56,8 @@
<record id="crm_case_changesindesigning0" model="crm.meeting">
<field eval="1" name="active"/>
<field eval="05" name="duration"/>
<field name="partner_id" ref="base.res_partner_9"/>
<field name="user_id" ref="base.user_demo"/>
<field eval="&quot;draft&quot;" name="state"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="time.strftime('%Y-%m-22 11:05:05')" name="date"/>
<field name="categ_id" ref="crm.categ_meet2"/>
<field eval="&quot;Changes in Designing&quot;" name="name"/>
@ -77,10 +67,8 @@
<record id="crm_case_updatethedata0" model="crm.meeting">
<field eval="1" name="active"/>
<field name="partner_id" ref="base.res_partner_4"/>
<field name="user_id" ref="base.user_root"/>
<field eval="&quot;done&quot;" name="state"/>
<field name="section_id" ref="crm.section_sales_department"/>
<field eval="time.strftime('%Y-%m-18 13:12:49')" name="date"/>
<field name="categ_id" ref="crm.categ_meet2"/>
<field eval="&quot;Update the data&quot;" name="name"/>

View File

@ -2,35 +2,6 @@
<openerp>
<data>
<!-- CRM Meetings Form View -->
<record model="ir.ui.view" id="view_crm_meeting_form">
<field name="name">CRM - Meetings Form</field>
<field name="model">crm.meeting</field>
<field name="type">form</field>
<field name="inherit_id" ref="base_calendar.view_crm_meeting_form"/>
<field name="arch" type="xml">
<field name="organizer" position="after">
<field name="section_id" widget="selection"/>
</field>
</field>
</record>
<!-- CRM Meeting Calendar -->
<record model="ir.ui.view" id="view_crm_meeting_calendar">
<field name="name">CRM - Meetings Calendar</field>
<field name="model">crm.meeting</field>
<field name="type">calendar</field>
<field name="inherit_id" ref="base_calendar.view_crm_meeting_calendar"/>
<field name="priority" eval="2"/>
<field name="arch" type="xml">
<field name="partner_id" position="after">
<field name="section_id" widget="selection"/>
</field>
</field>
</record>
<!-- Calendar Attendee Form View -->
<record id="attendee_form_view_inherit" model="ir.ui.view">

View File

@ -38,7 +38,7 @@ class res_partner(osv.osv):
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
'opportunity_ids': fields.one2many('crm.lead', 'partner_id',\
'Leads and Opportunities', domain=[('state','in', ('draft','open','pending'))]),
'meeting_ids': fields.one2many('crm.meeting', 'partner_id',\
'meeting_ids': fields.one2many('crm.meeting', 'partner_ids',\
'Meetings'),
'phonecall_ids': fields.one2many('crm.phonecall', 'partner_id',\
'Phonecalls'),

View File

@ -51,7 +51,7 @@
<field name="src_model">res.partner</field>
<field name="res_model">crm.meeting</field>
<field name="view_mode">calendar,tree,form,gantt</field>
<field name="context">{'search_default_partner_id': active_id}</field>
<field name="context">{'search_default_partner_ids': active_id}</field>
</record>
<!-- open opportunities related to given partner -->
@ -128,7 +128,7 @@
<button type="action"
string="Schedule a Meeting"
name="%(base_calendar.action_crm_meeting)d"
context="{'search_default_partner_id': active_id, 'default_duration': 4.0}"/>
context="{'search_default_partner_ids': active_id}"/>
<button type="action" string="Schedule a Call"
name="%(crm.crm_case_categ_phone_create_partner)d"
context="{'search_default_partner_id': active_id, 'default_duration': 1.0}" />

View File

@ -267,7 +267,7 @@ class hr_holidays(osv.osv):
meeting_obj = self.pool.get('crm.meeting')
meeting_vals = {
'name': record.name,
'categ_id': record.holiday_status_id.categ_id.id,
'categ_ids': [(6,0,[record.holiday_status_id.categ_id.id])],
'duration': record.number_of_days_temp * 8,
'description': record.notes,
'user_id': record.user_id.id,