[FIX] Fixe according to aprs review
bzr revid: jke@openerp.com-20131220145028-2vy4t19uxgrh9jw4
This commit is contained in:
parent
e4469e0aeb
commit
698a74c0a2
|
@ -5,7 +5,7 @@ class web_calendar_contacts(osv.osv):
|
|||
|
||||
_columns = {
|
||||
'user_id': fields.many2one('res.users','Me'),
|
||||
'partner_id': fields.many2one('res.partner','Contact',required=True),
|
||||
'partner_id': fields.many2one('res.partner','Employee',required=True, domain=[('customer','=',True)]),
|
||||
'active':fields.boolean('active'),
|
||||
}
|
||||
_defaults = {
|
||||
|
|
|
@ -19,10 +19,9 @@
|
|||
<field name="view_id" ref="view_calendar_contacts" />
|
||||
<field name="help" type="html">
|
||||
<p class="oe_view_nocontent_create">
|
||||
Click to add your first contact.
|
||||
Click on "<b>create</b>" to select colleagues you want to see meetings.
|
||||
</p><p>
|
||||
Add your contacts here to see the events which are created by them.<br/>
|
||||
Each contact will have it own color on calendar, to see easily who is busy...
|
||||
Your colleagues will appear in the right list to see them in the calendar view. You will easily manage collaboration and meeting with them.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_web_calendar_contacts_all,access_web_calendar_contacts_all,model_web_calendar_contacts,,1,0,0,0
|
||||
access_web_calendar_contacts_all,access_web_calendar_contacts_all,model_web_calendar_contacts,,1,1,1,1
|
||||
access_web_calendar_contacts,access_web_calendar_contacts,model_web_calendar_contacts,base.group_system,1,1,1,1
|
||||
|
|
|
|
@ -144,6 +144,7 @@ openerp.web_calendar = function(instance) {
|
|||
else
|
||||
this.colorIsAttendee = true;
|
||||
|
||||
/*
|
||||
if (isNull(attrs.avatar_model)) {
|
||||
this.avatar_model = 'res.partner';
|
||||
}
|
||||
|
@ -154,7 +155,15 @@ openerp.web_calendar = function(instance) {
|
|||
else {
|
||||
this.avatar_model = attrs.avatar_model;
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (isNull(attrs.avatar_model)) {
|
||||
this.avatar_model = null;
|
||||
}
|
||||
else {
|
||||
this.avatar_model = attrs.avatar_model;
|
||||
}
|
||||
|
||||
|
||||
if (isNull(attrs.avatar_title)) {
|
||||
this.avatar_title = this.avatar_model;
|
||||
|
@ -310,13 +319,15 @@ openerp.web_calendar = function(instance) {
|
|||
var filter_item = {
|
||||
value: filter_value,
|
||||
label: result.partner_id[1] + " [Me]",
|
||||
color: self.get_color(filter_value)
|
||||
color: self.get_color(filter_value),
|
||||
avatar_model: self.avatar_model
|
||||
};
|
||||
sidebar_items[filter_value] = filter_item ;
|
||||
filter_item = {
|
||||
value: -1,
|
||||
label: "All...",
|
||||
color: self.get_color(-1)
|
||||
color: self.get_color(-1),
|
||||
avatar_model: self.avatar_model
|
||||
};
|
||||
sidebar_items[-1] = filter_item ;
|
||||
|
||||
|
@ -326,7 +337,8 @@ openerp.web_calendar = function(instance) {
|
|||
filter_item = {
|
||||
value: filter_value,
|
||||
label: item.partner_id[1],
|
||||
color: self.get_color(filter_value)
|
||||
color: self.get_color(filter_value),
|
||||
avatar_model: self.avatar_model
|
||||
};
|
||||
sidebar_items[filter_value] = filter_item ;
|
||||
});
|
||||
|
@ -349,7 +361,6 @@ openerp.web_calendar = function(instance) {
|
|||
return $.when();
|
||||
},
|
||||
extraSideBar: function() {
|
||||
console.log("In extra Side bar from fullcalendar");
|
||||
},
|
||||
|
||||
open_quick_create: function(data_template) {
|
||||
|
@ -713,7 +724,8 @@ openerp.web_calendar = function(instance) {
|
|||
filter_item = {
|
||||
value: filter_value,
|
||||
label: e[self.color_field][1],
|
||||
color: self.get_color(filter_value)
|
||||
color: self.get_color(filter_value),
|
||||
avatar_model: self.avatar_model
|
||||
};
|
||||
if (!now_filters[e[self.color_field][0]])
|
||||
now_filters[e[self.color_field][0]] = filter_item;
|
||||
|
@ -1493,9 +1505,9 @@ openerp.web_calendar = function(instance) {
|
|||
},
|
||||
addUpdateButton: function() {
|
||||
var self=this;
|
||||
var button = "<button class='oe_button oe_form_button oe_link' style='margin-top:10px'><span class='add_contacts_link' >Manage coworker's calendar</span></button>";
|
||||
var button = "<button class='oe_button oe_form_button oe_link add_contacts_link_btn' style='margin-top:10px'><span class='add_contacts_link'>See Employee's Meeting</span></button>";
|
||||
this.$('div.oe_calendar_all_responsibles').append(button);
|
||||
this.$(".add_contacts_link").on('click', function() {
|
||||
this.$(".add_contacts_link_btn").on('click', function() {
|
||||
self.rpc("/web/action/load", {
|
||||
action_id: "web_calendar.action_calendar_contacts"
|
||||
}).then( function(result) { return self.do_action(result); });
|
||||
|
|
|
@ -26,16 +26,17 @@
|
|||
</t>
|
||||
<t t-name="CalendarView.sidebar.responsible">
|
||||
<div class="oe_calendar_all_responsibles">
|
||||
<div t-foreach="filters" class="oe_calendar_responsible" >
|
||||
<input type="checkbox" name="selection" t-att-value="filters_value.value" checked="checked" />
|
||||
<t t-if="filters_value.value == -1">
|
||||
<span><i t-attf-class="fa fa-users fa-fw cal_avatar" ></i></span>
|
||||
<div t-foreach="filters" class="oe_calendar_responsible" >
|
||||
<t t-if="filters_value.value>=-1"> <!-- don't display if no it given -->
|
||||
<input type="checkbox" name="selection" t-att-value="filters_value.value" checked="checked" />
|
||||
<t t-if="filters_value.value == -1">
|
||||
<span><i t-attf-class="fa fa-users fa-fw cal_avatar" ></i></span>
|
||||
</t>
|
||||
<t t-if="(filters_value.value != -1) && filters_value.avatar_model ">
|
||||
<img t-att-src="'/web/binary/image?model=' + filters_value.avatar_model + '&field=image_small&id=' + filters_value.value" class="cal_avatar"/>
|
||||
</t>
|
||||
<span t-attf-class="cal_opacity underline_color_#{filters_value.color}" ><t t-esc="filters_value.label" /></span>
|
||||
</t>
|
||||
<t t-if="filters_value.value != -1">
|
||||
<img t-att-src="'/web/binary/image?model=res.partner&field=image_small&id=' + filters_value.value" class="cal_avatar"/>
|
||||
</t>
|
||||
<span t-attf-class="cal_opacity underline_color_#{filters_value.color}" ><t t-esc="filters_value.label" /></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
|
Loading…
Reference in New Issue