[TYPO] Typo and go in edit mode by default and not view mode when editing an event

bzr revid: jke@openerp.com-20131217140719-3nh6pmwmg716d9jh
This commit is contained in:
jke-openerp
2013-12-17 15:07:19 +01:00
parent e97db06cbe
commit 00d43cd601
2 changed files with 13 additions and 4 deletions
@@ -802,10 +802,11 @@ openerp.web_calendar = function(instance) {
return false;
},
open_event: function(id,title) {
var self = this;
if (! this.open_popup_action) {
var index = this.dataset.get_id_index(id);
this.dataset.index = index;
this.do_switch_view('form');
this.do_switch_view('form', null, { mode: "edit" });
}
else {
@@ -823,7 +824,7 @@ openerp.web_calendar = function(instance) {
var form_controller = pop.view_form;
form_controller.on("load_record", self, function(){
button_delete = _.str.sprintf("<button class='oe_button oe_bold delme'><span> %s </span></button>",_t("Delete"));
button_edit = _.str.sprintf("<button class='oe_button oe_bold editme oe_highlight'><span> %s </span></button>",_t("Edit event &gt;&gt;"));
button_edit = _.str.sprintf("<button class='oe_button oe_bold editme oe_highlight'><span> %s </span></button>",_t("Edit Event"));
pop.$el.closest(".ui-dialog").find(".ui-dialog-buttonpane").prepend(button_delete)
@@ -837,6 +838,7 @@ openerp.web_calendar = function(instance) {
);
$('.editme').click(
function() {
/*
var action = {
type: 'ir.actions.act_window',
res_model: 'crm.meeting',
@@ -845,9 +847,16 @@ openerp.web_calendar = function(instance) {
views: [[false, 'form']],
res_id: id,
context: {},
mode:"edit",
};
$('.oe_form_button_cancel').trigger('click');
self.do_action(action);
*/
$('.oe_form_button_cancel').trigger('click');
var index = self.dataset.get_id_index(id);
self.dataset.index = index;
self.do_switch_view('form', null, { mode: "edit" });
}
);
@@ -63,7 +63,7 @@
<t t-if="widget._buttons">
<div class="oe_calendar_quick_create_buttons">
<button class="openerp oe_button oe_highlight oe_calendar_quick_create_add ">Create event</button>
<button class="oe_button oe_form_button oe_link oe_calendar_quick_create_edit" ><span>Edit event <![CDATA[>>]]></span></button>
<button class="oe_button oe_form_button oe_link oe_calendar_quick_create_edit" ><span>Edit Event <![CDATA[]]></span></button>
<!--or <a href="#" class="oe_calendar_quick_create_close">Cancel</a>-->
</div>
</t>