From 0c86591d95f07734aee5cc13ac13974a9243c5cc Mon Sep 17 00:00:00 2001 From: jke-openerp Date: Fri, 14 Feb 2014 16:28:12 +0100 Subject: [PATCH 1/5] [IMP] Remove default filter on "My meetings" in calendar bzr revid: jke@openerp.com-20140214152812-a7lws77lgycf5cuq --- addons/calendar/calendar_view.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/calendar/calendar_view.xml b/addons/calendar/calendar_view.xml index 01c4b596592..20ede6752d2 100644 --- a/addons/calendar/calendar_view.xml +++ b/addons/calendar/calendar_view.xml @@ -267,8 +267,7 @@ calendar.event calendar,tree,form,gantt - - {"search_default_mymeetings": 1} +

Click to schedule a new meeting. From b6656e26f1e4d59156601ceb0728dab1dee86aa5 Mon Sep 17 00:00:00 2001 From: jke-openerp Date: Mon, 17 Feb 2014 08:05:55 -0900 Subject: [PATCH 2/5] [IMP] Remove second demo user bzr revid: jke@openerp.com-20140217170555-etlc139o3c2x028b --- addons/calendar/calendar_demo.xml | 32 ++++--------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) diff --git a/addons/calendar/calendar_demo.xml b/addons/calendar/calendar_demo.xml index 6880754cc56..9e0b44c89cb 100644 --- a/addons/calendar/calendar_demo.xml +++ b/addons/calendar/calendar_demo.xml @@ -6,20 +6,7 @@ --> - - Arshaw - - - fullcalendar@example.com - - - Second Demo User - Second Demo User - - - - - + @@ -105,8 +92,8 @@ - - + + Presentation of the new Calendar @@ -114,18 +101,7 @@ draft - - - - - - Discuss about the module : Calendar - - - - - draft - + From d1ac6987a9c217e3b9ce327130664f02d739a9e1 Mon Sep 17 00:00:00 2001 From: jke-openerp Date: Tue, 18 Feb 2014 12:11:38 +0100 Subject: [PATCH 3/5] [FIX] Fix bug with timezone for allday event bzr revid: jke@openerp.com-20140218111138-cci4jdam0se883pp --- addons/calendar/calendar.py | 14 +++++++------- addons/calendar/calendar_view.xml | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index a8efc343420..f5bb558e7fd 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -19,13 +19,13 @@ # ############################################################################## -import hashlib import pytz import re import time import openerp import openerp.service.report import uuid +from werkzeug.exceptions import BadRequest from datetime import datetime, timedelta from dateutil import parser from dateutil import rrule @@ -34,7 +34,6 @@ from openerp import tools, SUPERUSER_ID from openerp.osv import fields, osv from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT from openerp.tools.translate import _ -from openerp import http from openerp.http import request from operator import itemgetter @@ -870,6 +869,7 @@ class calendar_event(osv.Model): ] def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=False, allday=False, context=None): + """Returns duration and/or end date based on values passed @param ids: List of calendar event's IDs. @param start_date: Starting date @@ -888,14 +888,14 @@ class calendar_event(osv.Model): value['duration'] = duration if allday: # For all day event - start = datetime.strptime(start_date.split(' ')[0].split('T')[0], "%Y-%m-%d") - duration = 24.0 - value['duration'] = duration + start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S") user = self.pool['res.users'].browse(cr, uid, uid) tz = pytz.timezone(user.tz) if user.tz else pytz.utc - start = pytz.utc.localize(start).astimezone(tz) # convert start in user's timezone + start = pytz.utc.localize(datetime.strptime(start)).astimezone(tz) # convert start in user's timezone start = start.astimezone(pytz.utc) # convert start back to utc - value['date'] = start.strftime("%Y-%m-%d") + ' 00:00:00' + + value['duration'] = 24.0 + value['date'] = datetime.strftime(start, "%Y-%m-%d %H:%M:%S") else: start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S") diff --git a/addons/calendar/calendar_view.xml b/addons/calendar/calendar_view.xml index 20ede6752d2..b9db3b279cb 100644 --- a/addons/calendar/calendar_view.xml +++ b/addons/calendar/calendar_view.xml @@ -57,15 +57,15 @@

+ /> From cbf55efbd52fb251b56936fa91ecac8dfdb3bc57 Mon Sep 17 00:00:00 2001 From: jke-openerp Date: Tue, 18 Feb 2014 12:42:12 +0100 Subject: [PATCH 4/5] [TYPO] Remove strptime inserted by error in last commit bzr revid: jke@openerp.com-20140218114212-lbxfceagz51kj1eb --- addons/calendar/calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/calendar/calendar.py b/addons/calendar/calendar.py index f5bb558e7fd..d42096bbec9 100644 --- a/addons/calendar/calendar.py +++ b/addons/calendar/calendar.py @@ -891,7 +891,7 @@ class calendar_event(osv.Model): start = datetime.strptime(start_date, "%Y-%m-%d %H:%M:%S") user = self.pool['res.users'].browse(cr, uid, uid) tz = pytz.timezone(user.tz) if user.tz else pytz.utc - start = pytz.utc.localize(datetime.strptime(start)).astimezone(tz) # convert start in user's timezone + start = pytz.utc.localize(start).astimezone(tz) # convert start in user's timezone start = start.astimezone(pytz.utc) # convert start back to utc value['duration'] = 24.0 From 1435af64b5ab2615173a8a217c8fb719ac8a93be Mon Sep 17 00:00:00 2001 From: jke-openerp Date: Tue, 18 Feb 2014 14:11:59 +0100 Subject: [PATCH 5/5] [TYPO] Remove end whitespaces bzr revid: jke@openerp.com-20140218131159-8a5hj0i843m3r3dx --- .../calendar/static/src/js/base_calendar.js | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/addons/calendar/static/src/js/base_calendar.js b/addons/calendar/static/src/js/base_calendar.js index 0f5693eacbc..337895ee3d5 100644 --- a/addons/calendar/static/src/js/base_calendar.js +++ b/addons/calendar/static/src/js/base_calendar.js @@ -1,7 +1,7 @@ openerp.calendar = function(instance) { var _t = instance.web._t; var QWeb = instance.web.qweb; - instance.calendar = {} + instance.calendar = {}; instance.web.WebClient = instance.web.WebClient.extend({ @@ -11,8 +11,8 @@ openerp.calendar = function(instance) { get_next_notif: function() { var self= this; this.rpc("/calendar/notify") - .then( - function(result) { + .then( + function(result) { _.each(result, function(res) { setTimeout(function() { //If notification not already displayed, we add button and action on it @@ -21,25 +21,25 @@ openerp.calendar = function(instance) { res.message += QWeb.render("notify_footer"); a = self.do_notify(res.title,res.message,true); - $(".link2event").on('click', function() { + $(".link2event").on('click', function() { self.rpc("/web/action/load", { action_id: "calendar.action_calendar_event_notify", - }).then( function(r) { + }).then( function(r) { r.res_id = res.event_id; - return self.action_manager.do_action(r); - }); + return self.action_manager.do_action(r); + }); }); - a.element.find(".link2recall").on('click',function() { + a.element.find(".link2recall").on('click',function() { self.get_notif_box(this).find('.ui-notify-close').trigger("click"); - }); - a.element.find(".link2showed").on('click',function() { + }); + a.element.find(".link2showed").on('click',function() { self.get_notif_box(this).find('.ui-notify-close').trigger("click"); self.rpc("/calendar/notify_ack"); }); } //If notification already displayed in the past, we remove the css attribute which hide this notification else if (self.get_notif_box($.find(".eid_"+res.event_id)).attr("style") !== ""){ - self.get_notif_box($.find(".eid_"+res.event_id)).attr("style",""); + self.get_notif_box($.find(".eid_"+res.event_id)).attr("style",""); } },res.timer * 1000); }); @@ -48,7 +48,7 @@ openerp.calendar = function(instance) { }, check_notifications: function() { var self= this; - self.get_next_notif(); + self.get_next_notif(); setInterval(function(){ self.get_next_notif(); }, 5 * 60 * 1000 ); @@ -58,7 +58,7 @@ openerp.calendar = function(instance) { show_application: function() { this._super(); this.check_notifications(); - } + }, }); @@ -92,7 +92,7 @@ openerp.calendar = function(instance) { var reload_page = function(){ return location.replace(action_url); - } + }; reload_page(); }, @@ -108,7 +108,7 @@ openerp.calendar = function(instance) { }); }, map_tag: function(value){ - return _.map(value, function(el) {return {name: el[1], id:el[0], state: el[2]};}) + return _.map(value, function(el) {return {name: el[1], id:el[0], state: el[2]};}); }, get_render_data: function(ids){ var self = this; @@ -121,7 +121,7 @@ openerp.calendar = function(instance) { if (! self.get("effective_readonly")) { var tag_element = self.tags.tagElements(); _.each(data,function(value, key){ - $(tag_element[key]).find(".custom-edit").addClass(data[key][2]) + $(tag_element[key]).find(".custom-edit").addClass(data[key][2]); }); } } @@ -134,7 +134,7 @@ openerp.calendar = function(instance) { instance.session.session_bind(instance.session.origin).done(function () { new instance.calendar.invitation(null,db,action,id,view,attendee_data).appendTo($("body").addClass('openerp')); }); - } + };