[IMP] Show button google cal only on crm meeting model

bzr revid: jke@openerp.com-20131217121808-miv2zlo2guuxrt1r
This commit is contained in:
jke-openerp 2013-12-17 13:18:08 +01:00
parent 08f00af5ab
commit 7eda17615b
5 changed files with 38 additions and 25 deletions

View File

@ -145,6 +145,9 @@ openerp.base_calendar = function(instance) {
});
}
};

View File

@ -1,7 +1,3 @@
/*---------------------------------------------------------
* OpenERP web_calendar
*---------------------------------------------------------*/
openerp.google_calendar = function(instance) {
var _t = instance.web._t,
_lt = instance.web._lt;
@ -46,5 +42,16 @@ openerp.google_calendar = function(instance) {
}).always(function(o) { $('div.oe_cal_sync_button').prop('disabled',false); });
}
});
instance.web_calendar.FullCalendarView.include({
extraSideBar: function() {
this._super();
if (this.dataset.model == "crm.meeting") {
var button = QWeb.render('GoogleCalendar.buttonSynchro');
this.$el.find('.oe_calendar_filter').prepend(button);
console.log("added");
}
}
});
};

View File

@ -1,17 +1,14 @@
<template>
<t t-extend="CalendarView.sidebar">
<t t-jquery="div.oe_calendar_mini" t-operation="after">
<div id="sync" class="oe_cal_sync_button cal_tab " >
<center>
<br/>
<button class="oe_button">
<span>
<img src="/google_calendar/static/src/img/calendar_32.png"/> Sync with <b>Google</b>
</span>
</button>
</center>
</div>
</t>
</t>
<t t-name="GoogleCalendar.buttonSynchro">
<div id="sync" class="oe_cal_sync_button cal_tab " >
<center>
<br/>
<button class="oe_button">
<span>
<img src="/google_calendar/static/src/img/calendar_32.png"/> Sync with <b>Google</b>
</span>
</button>
</center>
</div>
</t>
</template>

View File

@ -65,8 +65,10 @@ openerp.hr_holidays = function(instance) {
var name = this.$el.find(".qc_name").val();
var type = this.$el.find(".qc_type").val();
if (/^\s*$/.test(name)) { return; }
this.quick_create({'name': name,'holiday_status_id':parseInt(type)});
if (/^\s*$/.test(name)) {
return false;
}
return this.quick_create({'name': name,'holiday_status_id':parseInt(type)}).always(function() { return true; });
},

View File

@ -1,9 +1,13 @@
<template>
<div t-name="hr_holidays.QuickCreate" class="oe_calendar_quick_create openerp">
<input name='name' class="qc_name"/>
<select name='holiday_status_id' class="qc_type">
</select>
<div class="form-group">
<label for='name' class=' control-label'>Description:</label>
<input name='name' class=" qc_name form-control"/>
</div>
<div class="form-group">
<label for='holiday_status_id' class=' control-label'>Type:</label>
<select name='holiday_status_id' class="qc_type form-control"></select>
</div>
<t t-if="widget._buttons">
<div class="oe_calendar_quick_create_buttons">
<button class="oe_button oe_calendar_quick_create_add ">Add</button>