diff --git a/addons/account/account.py b/addons/account/account.py
index b5f53c02c32..a33cb52aa87 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -708,6 +708,7 @@ class account_journal(osv.osv):
return self.name_get(cr, user, ids, context=context)
+
def onchange_type(self, cr, uid, ids, type, currency, context=None):
obj_data = self.pool.get('ir.model.data')
user_pool = self.pool.get('res.users')
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index b6d8fcb9de0..e6e07b8eb68 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -1313,7 +1313,6 @@ class account_invoice_line(osv.osv):
if context is None:
context = {}
company_id = context.get('company_id',False)
- tax_obj = self.pool.get('account.tax')
if not partner_id:
raise osv.except_osv(_('No Partner Defined !'),_("You must first select a partner !") )
if not product:
diff --git a/addons/account_analytic_plans/report/crossovered_analytic.py b/addons/account_analytic_plans/report/crossovered_analytic.py
index 74f268db168..e2ad9e05b04 100644
--- a/addons/account_analytic_plans/report/crossovered_analytic.py
+++ b/addons/account_analytic_plans/report/crossovered_analytic.py
@@ -65,8 +65,6 @@ class crossovered_analytic(report_sxw.rml_parse):
def _ref_lines(self,form):
result = []
res = {}
- acc_id = []
- final = []
acc_pool = self.pool.get('account.analytic.account')
line_pool = self.pool.get('account.analytic.line')
@@ -128,7 +126,6 @@ class crossovered_analytic(report_sxw.rml_parse):
line_pool = self.pool.get('account.analytic.line')
acc_id = []
final = []
- child_ids = []
self.list_ids = []
self.final_list = self.find_children(ids)
diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py
index 52819428dbc..b744a10b3d9 100644
--- a/addons/audittrail/audittrail.py
+++ b/addons/audittrail/audittrail.py
@@ -106,14 +106,16 @@ class audittrail_rule(osv.osv):
"""
obj_action = self.pool.get('ir.actions.act_window')
val_obj = self.pool.get('ir.values')
+ value=''
#start Loop
for thisrule in self.browse(cr, uid, ids):
if thisrule.id in self.__functions:
for function in self.__functions[thisrule.id]:
setattr(function[0], function[1], function[2])
w_id = obj_action.search(cr, uid, [('name', '=', 'View Log'), ('res_model', '=', 'audittrail.log'), ('src_model', '=', thisrule.object_id.model)])
- obj_action.unlink(cr, uid, w_id)
- value = "ir.actions.act_window" + ',' + str(w_id[0])
+ if w_id:
+ obj_action.unlink(cr, uid, w_id)
+ value = "ir.actions.act_window" + ',' + str(w_id[0])
val_id = val_obj.search(cr, uid, [('model', '=', thisrule.object_id.model), ('value', '=', value)])
if val_id:
res = ir.ir_del(cr, uid, val_id[0])
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index bf34c137b5a..d528aaae28e 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -29,6 +29,11 @@ import re
import time
import tools
+
+def get_datetime(date_field):
+ return datetime.strptime(date_field[:19], '%Y-%m-%d %H:%M:%S')
+
+
class base_action_rule(osv.osv):
""" Base Action Rules """
@@ -115,6 +120,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
help="Use a python expression to specify the right field on which one than we will use for the 'From' field of the header"),
'act_email_to' : fields.char('Email To', size=64, required=False,
help="Use a python expression to specify the right field on which one than we will use for the 'To' field of the header"),
+ 'last_run': fields.datetime('Last Run', readonly=1),
}
_defaults = {
@@ -145,7 +151,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
# Searching for action rules
cr.execute("SELECT model.model, rule.id FROM base_action_rule rule \
LEFT JOIN ir_model model on (model.id = rule.model_id) \
- where active")
+ WHERE active")
res = cr.fetchall()
# Check if any rule matching with current object
for obj_name, rule_id in res:
@@ -153,7 +159,10 @@ the rule to mark CC(mail to any other person defined in actions)."),
continue
else:
obj = self.pool.get(obj_name)
- self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context), context=context)
+ # If the rule doesn't involve a time condition, run it immediately
+ # Otherwise we let the scheduler run the action
+ if self.browse(cr, uid, rule_id, context=context).trg_date_type == 'none':
+ self._action(cr, uid, [rule_id], obj.browse(cr, uid, ids, context=context), context=context)
return True
def _create(self, old_create, model, context=None):
@@ -206,8 +215,50 @@ the rule to mark CC(mail to any other person defined in actions)."),
"""
rule_pool = self.pool.get('base.action.rule')
rule_ids = rule_pool.search(cr, uid, [], context=context)
- return self._register_hook(cr, uid, rule_ids, context=context)
-
+ self._register_hook(cr, uid, rule_ids, context=context)
+
+ rules = self.browse(cr, uid, rule_ids, context=context)
+ for rule in rules:
+ model = rule.model_id.model
+ model_pool = self.pool.get(model)
+ last_run = False
+ if rule.last_run:
+ last_run = get_datetime(rule.last_run)
+ now = datetime.now()
+ for obj_id in model_pool.search(cr, uid, [], context=context):
+ obj = model_pool.browse(cr, uid, obj_id, context=context)
+ # Calculate when this action should next occur for this object
+ base = False
+ if rule.trg_date_type=='create' and hasattr(obj, 'create_date'):
+ base = obj.create_date
+ elif (rule.trg_date_type=='action_last'
+ and hasattr(obj, 'create_date')):
+ if hasattr(obj, 'date_action_last') and obj.date_action_last:
+ base = obj.date_action_last
+ else:
+ base = obj.create_date
+ elif (rule.trg_date_type=='deadline'
+ and hasattr(obj, 'date_deadline')
+ and obj.date_deadline):
+ base = obj.date_deadline
+ elif (rule.trg_date_type=='date'
+ and hasattr(obj, 'date')
+ and obj.date):
+ base = obj.date
+ if base:
+ fnct = {
+ 'minutes': lambda interval: timedelta(minutes=interval),
+ 'day': lambda interval: timedelta(days=interval),
+ 'hour': lambda interval: timedelta(hours=interval),
+ 'month': lambda interval: timedelta(months=interval),
+ }
+ base = get_datetime(base)
+ delay = fnct[rule.trg_date_range_type](rule.trg_date_range)
+ action_date = base + delay
+ if (not last_run or (last_run <= action_date < now)):
+ self._action(cr, uid, [rule.id], [obj], context=context)
+ rule_pool.write(cr, uid, [rule.id], {'last_run': now},
+ context=context)
def format_body(self, body):
""" Foramat Action rule's body
@@ -391,7 +442,6 @@ the rule to mark CC(mail to any other person defined in actions)."),
if context is None:
context = {}
-
context.update({'action': True})
if not scrit:
scrit = []
@@ -403,41 +453,6 @@ the rule to mark CC(mail to any other person defined in actions)."),
if not ok:
continue
- base = False
- if action.trg_date_type=='create' and hasattr(obj, 'create_date'):
- base = datetime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S')
- elif action.trg_date_type=='action_last' and hasattr(obj, 'create_date'):
- if hasattr(obj, 'date_action_last') and obj.date_action_last:
- base = datetime.strptime(obj.date_action_last, '%Y-%m-%d %H:%M:%S')
- else:
- base = datetime.strptime(obj.create_date[:19], '%Y-%m-%d %H:%M:%S')
- elif action.trg_date_type=='deadline' and hasattr(obj, 'date_deadline') \
- and obj.date_deadline:
- base = datetime.strptime(obj.date_deadline, '%Y-%m-%d %H:%M:%S')
- elif action.trg_date_type=='date' and hasattr(obj, 'date') and obj.date:
- base = datetime.strptime(obj.date, '%Y-%m-%d %H:%M:%S')
- if base:
- fnct = {
- 'minutes': lambda interval: timedelta(minutes=interval),
- 'day': lambda interval: timedelta(days=interval),
- 'hour': lambda interval: timedelta(hours=interval),
- 'month': lambda interval: timedelta(months=interval),
- }
- d = base + fnct[action.trg_date_range_type](action.trg_date_range)
- dt = d.strftime('%Y-%m-%d %H:%M:%S')
- ok = False
- if hasattr(obj, 'date_action_last') and hasattr(obj, 'date_action_next'):
- ok = (dt <= time.strftime('%Y-%m-%d %H:%M:%S')) and \
- ((not obj.date_action_next) or \
- (dt >= obj.date_action_next and \
- obj.date_action_last < obj.date_action_next))
- if not ok:
- if not obj.date_action_next or dt < obj.date_action_next:
- obj.date_action_next = dt
- model_obj.write(cr, uid, [obj.id], {'date_action_next': dt}, context)
- else:
- ok = action.trg_date_type == 'none'
-
if ok:
self.do_action(cr, uid, action, model_obj, obj, context)
break
diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py
index fa85b242f6a..0e57c7cfb66 100644
--- a/addons/base_calendar/base_calendar.py
+++ b/addons/base_calendar/base_calendar.py
@@ -1024,45 +1024,43 @@ class calendar_event(osv.osv):
qry = "UPDATE \"%s\" set rrule_type=%%s " % self._table
qry_args = [ rrule_type, ]
+ new_val = val.copy()
+ for k, v in val.items():
+ if val['freq'] == 'weekly' and val.get('byday'):
+ for day in val['byday'].split(','):
+ new_val[day] = True
+ val.pop('byday')
- if rrule_type == 'custom':
- new_val = val.copy()
- for k, v in val.items():
- if val['freq'] == 'weekly' and val.get('byday'):
- for day in val['byday'].split(','):
- new_val[day] = True
- val.pop('byday')
+ if val.get('until'):
+ until = parser.parse(''.join((re.compile('\d')).findall(val.get('until'))))
+ new_val['end_date'] = until.strftime('%Y-%m-%d')
+ val.pop('until')
+ new_val.pop('until')
- if val.get('until'):
- until = parser.parse(''.join((re.compile('\d')).findall(val.get('until'))))
- new_val['end_date'] = until.strftime('%Y-%m-%d')
- val.pop('until')
- new_val.pop('until')
+ if val.get('bymonthday'):
+ new_val['day'] = val.get('bymonthday')
+ val.pop('bymonthday')
+ new_val['select1'] = 'date'
+ new_val.pop('bymonthday')
- if val.get('bymonthday'):
- new_val['day'] = val.get('bymonthday')
- val.pop('bymonthday')
- new_val['select1'] = 'date'
- new_val.pop('bymonthday')
+ if val.get('byday'):
+ d = val.get('byday')
+ if '-' in d:
+ new_val['byday'] = d[:2]
+ new_val['week_list'] = d[2:4].upper()
+ else:
+ new_val['byday'] = d[:1]
+ new_val['week_list'] = d[1:3].upper()
+ new_val['select1'] = 'day'
- if val.get('byday'):
- d = val.get('byday')
- if '-' in d:
- new_val['byday'] = d[:2]
- new_val['week_list'] = d[2:4].upper()
- else:
- new_val['byday'] = d[:1]
- new_val['week_list'] = d[1:3].upper()
- new_val['select1'] = 'day'
+ if val.get('bymonth'):
+ new_val['month_list'] = val.get('bymonth')
+ val.pop('bymonth')
+ new_val.pop('bymonth')
- if val.get('bymonth'):
- new_val['month_list'] = val.get('bymonth')
- val.pop('bymonth')
- new_val.pop('bymonth')
-
- for k, v in new_val.items():
- qry += ", %s=%%s" % k
- qry_args.append(v)
+ for k, v in new_val.items():
+ qry += ", %s=%%s" % k
+ qry_args.append(v)
qry = qry + " where id=%s"
qry_args.append(id)
@@ -1082,10 +1080,12 @@ class calendar_event(osv.osv):
for datas in self.read(cr, uid, ids, context=context):
event = datas['id']
if datas.get('rrule_type'):
+ if datas['rrule_type']=='daily_working':
+ datas.update({'rrule_type': 'weekly'})
if datas.get('rrule_type') == 'none':
result[event] = False
cr.execute("UPDATE %s set exrule=Null where id=%%s" % self._table,( event,))
- elif datas.get('rrule_type') == 'custom':
+ if datas.get('rrule_type') :
if datas.get('interval', 0) < 0:
raise osv.except_osv(_('Warning!'), _('Interval can not be Negative'))
if datas.get('count', 0) < 0:
@@ -1132,7 +1132,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=-1SU'),
'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \
('weekly', 'Weekly'), ('monthly', 'Monthly'), \
- ('yearly', 'Yearly'), ('custom', 'Custom')],
+ ('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)]},
@@ -1144,16 +1144,15 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
'user_id': fields.many2one('res.users', 'Responsible', states={'done': [('readonly', True)]}),
'organizer': fields.char("Organizer", size=256, states={'done': [('readonly', True)]}), # Map with Organizer Attribure of VEvent.
'organizer_id': fields.many2one('res.users', 'Organizer', states={'done': [('readonly', True)]}),
- 'freq': fields.selection([('None', 'No Repeat'), \
- ('hourly', 'Hours'), \
- ('daily', 'Days'), \
- ('weekly', 'Weeks'), \
- ('monthly', 'Months'), \
- ('yearly', 'Years'), \
- ('secondly', 'Seconds'), \
- ('minutely', 'Minutes') ], 'Frequency'),
- 'interval': fields.integer('Interval', help="Repeat every x"),
- 'count': fields.integer('Count', help="Repeat max that times"),
+ 'freq': fields.selection([('None', 'No Repeat'),
+ ('hourly', 'Hours'),
+ ('daily', 'Days'),
+ ('weekly', 'Weeks'),
+ ('monthly', 'Months'),
+ ('yearly', 'Years'), ], 'Frequency'),
+
+ 'interval': fields.integer('Interval', help="Repeat every (Days/Week/Month/Year)"),
+ 'count': fields.integer('Repeat', help="Repeat x times"),
'mo': fields.boolean('Mon'),
'tu': fields.boolean('Tue'),
'we': fields.boolean('Wed'),
@@ -1161,7 +1160,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
'fr': fields.boolean('Fri'),
'sa': fields.boolean('Sat'),
'su': fields.boolean('Sun'),
- 'select1': fields.selection([('date', 'Date of month'), \
+ 'select1': fields.selection([('date', 'Date of month'),
('day', 'Day of month')], 'Option'),
'day': fields.integer('Date of month'),
'week_list': fields.selection([('MO', 'Monday'), ('TU', 'Tuesday'), \
@@ -1177,7 +1176,9 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
'event_id', 'attendee_id', 'Attendees'),
'allday': fields.boolean('All Day', states={'done': [('readonly', True)]}),
'active': fields.boolean('Active', help="If the active field is set to \
-true, it will allow you to hide the event alarm information without removing it.")
+ true, it will allow you to hide the event alarm information without removing it."),
+ 'recurrency': fields.boolean('Recurrent', help="Recurrent Meeting"),
+ 'edit_all': fields.boolean('Edit All', help="Edit all Occurrences of recurrent Meeting."),
}
def default_organizer(self, cr, uid, context=None):
user_pool = self.pool.get('res.users')
@@ -1199,45 +1200,15 @@ true, it will allow you to hide the event alarm information without removing it.
'organizer': default_organizer,
}
- def open_event(self, cr, uid, ids, context=None):
- """
- Open Event From for Editing
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of event’s IDs
- @param context: A standard dictionary for contextual values
- @return: Dictionary value which open Crm Meeting form.
- """
- if context is None:
+ def onchange_edit_all(self, cr, uid, ids, rrule_type,edit_all, context=None):
+ if not context:
context = {}
-
data_obj = self.pool.get('ir.model.data')
-
value = {}
-
- id2 = data_obj._get_id(cr, uid, 'base_calendar', 'event_form_view')
- id3 = data_obj._get_id(cr, uid, 'base_calendar', 'event_tree_view')
- id4 = data_obj._get_id(cr, uid, 'base_calendar', 'event_calendar_view')
- if id2:
- id2 = data_obj.browse(cr, uid, id2, context=context).res_id
- if id3:
- id3 = data_obj.browse(cr, uid, id3, context=context).res_id
- if id4:
- id4 = data_obj.browse(cr, uid, id4, context=context).res_id
- for id in ids:
- value = {
- 'name': _('Event'),
- 'view_type': 'form',
- 'view_mode': 'form,tree',
- 'res_model': 'calendar.event',
- 'view_id': False,
- 'views': [(id2, 'form'), (id3, 'tree'), (id4, 'calendar')],
- 'type': 'ir.actions.act_window',
- 'res_id': base_calendar_id2real_id(id),
- 'nodestroy': True
- }
-
- return value
+ if edit_all and rrule_type:
+ for id in ids:
+ base_calendar_id2real_id(id)
+ return value
def modify_all(self, cr, uid, event_ids, defaults, context=None, *args):
"""
@@ -1367,15 +1338,13 @@ true, it will allow you to hide the event alarm information without removing it.
weekstring = ''
monthstring = ''
yearstring = ''
-
- freq = datas.get('freq')
- if freq == 'None':
+ freq=datas.get('rrule_type')
+ if freq == 'none':
return ''
-
+
interval_srting = datas.get('interval') and (';INTERVAL=' + str(datas.get('interval'))) or ''
if freq == 'weekly':
-
byday = map(lambda x: x.upper(), filter(lambda x: datas.get(x) and x in weekdays, datas))
if byday:
weekstring = ';BYDAY=' + ','.join(byday)
@@ -1388,16 +1357,7 @@ true, it will allow you to hide the event alarm information without removing it.
elif datas.get('select1')=='date':
monthstring = ';BYMONTHDAY=' + str(datas.get('day'))
- elif freq == 'yearly':
- if datas.get('select1')=='date' and (datas.get('day') < 1 or datas.get('day') > 31):
- raise osv.except_osv(_('Error!'), ("Please select proper Day of month"))
- bymonth = ';BYMONTH=' + str(datas.get('month_list'))
- if datas.get('select1')=='day':
- bystring = ';BYDAY=' + datas.get('byday') + datas.get('week_list')
- elif datas.get('select1')=='date':
- bystring = ';BYMONTHDAY=' + str(datas.get('day'))
- yearstring = bymonth + bystring
-
+
if datas.get('end_date'):
datas['end_date'] = ''.join((re.compile('\d')).findall(datas.get('end_date'))) + 'T235959Z'
enddate = (datas.get('count') and (';COUNT=' + str(datas.get('count'))) or '') +\
diff --git a/addons/base_calendar/base_calendar_view.xml b/addons/base_calendar/base_calendar_view.xml
index 2280b5454b3..a1bd8db9d54 100644
--- a/addons/base_calendar/base_calendar_view.xml
+++ b/addons/base_calendar/base_calendar_view.xml
@@ -241,62 +241,9 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
@@ -397,6 +344,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/base_calendar/test/base_calendar_test.yml b/addons/base_calendar/test/base_calendar_test.yml
index 8c5f7acaaa5..52888e02688 100644
--- a/addons/base_calendar/test/base_calendar_test.yml
+++ b/addons/base_calendar/test/base_calendar_test.yml
@@ -15,7 +15,7 @@
Now I will set recurrence for this event to occur monday and friday of week
-
!python {model: calendar.event}: |
- self.write(cr, uid, [ref("calendar_event_technicalpresentation0")], {'fr': 1, 'mo': 1, 'interval': 1, 'freq': 'weekly', 'rrule_type': 'custom'})
+ self.write(cr, uid, [ref("calendar_event_technicalpresentation0")], {'fr': 1, 'mo': 1, 'interval': 1, 'rrule_type': 'weekly'})
- |
In order to check that recurrent events are views successfully in calendar view,
I will open calendar view of events
diff --git a/addons/base_contact/base_contact_installer.py b/addons/base_contact/base_contact_installer.py
index 6d979da7a02..3936b336e9f 100644
--- a/addons/base_contact/base_contact_installer.py
+++ b/addons/base_contact/base_contact_installer.py
@@ -38,8 +38,6 @@ class base_contact_installer(osv.osv_memory):
obj = self.pool.get("base.contact.installer").browse(cr, uid, uid, context=context)
if obj.migrate:
cr.execute("""DROP TRIGGER IF EXISTS contactjob on res_partner_contact;
- DROP LANGUAGE IF EXISTS plpgsql CASCADE;
- CREATE LANGUAGE plpgsql ;
CREATE OR REPLACE FUNCTION add_to_job() RETURNS TRIGGER AS $contactjob$
DECLARE
new_name varchar;
@@ -57,7 +55,7 @@ class base_contact_installer(osv.osv_memory):
cr.execute("INSERT into res_partner_contact (name, title, email, first_name, website) (SELECT coalesce(name, 'Noname'), title, email, function , to_char(id, '99999999') from res_partner_address)")
cr.execute("DROP TRIGGER IF EXISTS contactjob on res_partner_contact")
- cr.execute("DROP LANGUAGE IF EXISTS plpgsql CASCADE;")
+
cr.execute("DROP FUNCTION IF EXISTS add_to_job()")
base_contact_installer()
diff --git a/addons/base_report_designer/base_report_designer.py b/addons/base_report_designer/base_report_designer.py
index 4bb86bba035..2371bc8e216 100644
--- a/addons/base_report_designer/base_report_designer.py
+++ b/addons/base_report_designer/base_report_designer.py
@@ -25,6 +25,7 @@ from StringIO import StringIO
import base64
import pooler
import addons
+import sys
class report_xml(osv.osv):
_inherit = 'ir.actions.report.xml'
@@ -59,6 +60,8 @@ class report_xml(osv.osv):
def report_get(self, cr, uid, report_id, context=None):
report = self.browse(cr, uid, report_id, context=context)
+ reload(sys)
+ sys.setdefaultencoding( "latin-1" )
return {
'file_type' : report.report_type,
'report_sxw_content': report.report_sxw_content and base64.encodestring(report.report_sxw_content) or False,
diff --git a/addons/base_report_designer/plugin/openerp_report_designer.zip b/addons/base_report_designer/plugin/openerp_report_designer.zip
index 3ee0260060f..50524b2e60d 100644
Binary files a/addons/base_report_designer/plugin/openerp_report_designer.zip and b/addons/base_report_designer/plugin/openerp_report_designer.zip differ
diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py
index e7269b7ed89..55d8fee4a24 100644
--- a/addons/caldav/calendar.py
+++ b/addons/caldav/calendar.py
@@ -579,8 +579,8 @@ class Calendar(CalDAV, osv.osv):
string="Type", size=64),
'line_ids': fields.one2many('basic.calendar.lines', 'calendar_id', 'Calendar Lines'),
'create_date': fields.datetime('Created Date', readonly=True),
- 'write_date': fields.datetime('Modifided Date', readonly=True),
- 'description': fields.text("description"),
+ 'write_date': fields.datetime('Write Date', readonly=True),
+ 'description': fields.text("Description"),
'calendar_color': fields.char('Color', size=20, help="For supporting clients, the color of the calendar entries"),
'calendar_order': fields.integer('Order', help="For supporting clients, the order of this folder among the calendars"),
'has_webcal': fields.boolean('WebCal', required=True, help="Also export a .ics entry next to the calendar folder, with WebCal content."),
@@ -818,6 +818,7 @@ class basic_calendar_fields(osv.osv):
_name = 'basic.calendar.fields'
_description = 'Calendar fields'
+ _order = 'name'
_columns = {
'field_id': fields.many2one('ir.model.fields', 'OpenObject Field'),
@@ -833,7 +834,7 @@ class basic_calendar_fields(osv.osv):
}
_defaults = {
- 'fn': lambda *a: 'field',
+ 'fn': 'field',
}
_sql_constraints = [
@@ -1164,11 +1165,16 @@ class Alarm(CalDAV, osv.osv_memory):
self.__attribute__ = get_attribute_mapping(cr, uid, self._calname, ctx)
for child in ical_data.getChildren():
if child.name.lower() == 'trigger':
- seconds = child.value.seconds
- days = child.value.days
- diff = (days * 86400) + seconds
- interval = 'days'
- related = 'before'
+ if isinstance(child.value, timedelta):
+ seconds = child.value.seconds
+ days = child.value.days
+ diff = (days * 86400) + seconds
+ interval = 'days'
+ related = 'before'
+ elif isinstance(child.value, datetime):
+ # TODO
+ # remember, spec says this datetime is in UTC
+ raise NotImplementedError("we cannot parse absolute triggers")
if not seconds:
duration = abs(days)
related = days > 0 and 'after' or 'before'
diff --git a/addons/caldav/wizard/calendar_event_import.py b/addons/caldav/wizard/calendar_event_import.py
index fc54d6e77df..6517fa42b31 100644
--- a/addons/caldav/wizard/calendar_event_import.py
+++ b/addons/caldav/wizard/calendar_event_import.py
@@ -82,8 +82,11 @@ class calendar_event_import(osv.osv_memory):
'msg': fields.text('', readonly=True),
}
+ def _get_msg(self, cr, uid, context):
+ return _('Import Sucessful')
+
_defaults = {
- 'msg':lambda *a:'Import Sucessful'
+ 'msg': _get_msg,
}
calendar_event_import()
diff --git a/addons/crm/board_crm_view.xml b/addons/crm/board_crm_view.xml
index 80e7fbfed0c..b8342709220 100644
--- a/addons/crm/board_crm_view.xml
+++ b/addons/crm/board_crm_view.xml
@@ -153,7 +153,7 @@
menu
-
+