diff --git a/addons/account/account.py b/addons/account/account.py
index 31ad948360e..a95e6107a68 100644
--- a/addons/account/account.py
+++ b/addons/account/account.py
@@ -1608,8 +1608,8 @@ class account_model_line(osv.osv):
}
_order = 'sequence'
_sql_constraints = [
- ('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model !'),
- ('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model !'),
+ ('credit_debit1', 'CHECK (credit*debit=0)', 'Wrong credit or debit value in model (Credit Or Debit Must Be "0")!'),
+ ('credit_debit2', 'CHECK (credit+debit>=0)', 'Wrong credit or debit value in model (Credit + Debit Must Be greater "0")!'),
]
account_model_line()
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 87874c0a1b2..c2024c86eb3 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -29,17 +29,17 @@ from mx.DateTime import RelativeDateTime
from tools import config
from tools.translate import _
-class fiscalyear_seq(osv.osv):
- _name = "fiscalyear.seq"
- _description = "Maintains Invoice sequences with Fiscal Year"
- _rec_name = 'fiscalyear_id'
- _columns = {
- 'journal_id': fields.many2one('account.journal', 'Journal'),
- 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year',required=True),
- 'sequence_id':fields.many2one('ir.sequence', 'Sequence',required=True),
- }
-
-fiscalyear_seq()
+#class fiscalyear_seq(osv.osv):
+# _name = "fiscalyear.seq"
+# _description = "Maintains Invoice sequences with Fiscal Year"
+# _rec_name = 'fiscalyear_id'
+# _columns = {
+# 'journal_id': fields.many2one('account.journal', 'Journal'),
+# 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year',required=True),
+# 'sequence_id':fields.many2one('ir.sequence', 'Sequence',required=True),
+# }
+#
+#fiscalyear_seq()
class account_invoice(osv.osv):
def _amount_all(self, cr, uid, ids, name, args, context=None):
diff --git a/addons/account/security/ir.model.access.csv b/addons/account/security/ir.model.access.csv
index 3d135317b71..bb7ffbae946 100644
--- a/addons/account/security/ir.model.access.csv
+++ b/addons/account/security/ir.model.access.csv
@@ -82,7 +82,6 @@
"access_account_fiscal_position","account.fiscal.position all","model_account_fiscal_position","base.group_user",1,0,0,0
"access_account_fiscal_position_tax","account.fiscal.position.tax all","model_account_fiscal_position_tax","base.group_user",1,0,0,0
"access_account_fiscal_position_account","account.fiscal.position all","model_account_fiscal_position_account","base.group_user",1,0,0,0
-"access_fiscalyear_seq","fiscalyear.seq","model_fiscalyear_seq","account.group_account_invoice",1,1,1,1
"access_account_fiscal_position_template","account.fiscal.position.template","model_account_fiscal_position_template","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_tax_template","account.fiscal.position.tax.template","model_account_fiscal_position_tax_template","account.group_account_manager",1,1,1,1
"access_account_fiscal_position_account_template","account.fiscal.position.account.template","model_account_fiscal_position_account_template","account.group_account_manager",1,1,1,1
diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml
index b5735d7075b..b01e19a4a84 100644
--- a/addons/base_setup/base_setup_installer.xml
+++ b/addons/base_setup/base_setup_installer.xml
@@ -33,10 +33,10 @@
-
+
-
-
+
+
diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py
index 4371badf1ac..ec0a98d8af5 100644
--- a/addons/caldav/calendar.py
+++ b/addons/caldav/calendar.py
@@ -127,6 +127,16 @@ class CalDAV(object):
if not model:
continue
uidval = common.openobjectid2uid(cr, data[map_field], model)
+ cr.execute('select id from %s where recurrent_uid=%s'
+ % (model.replace('.', '_'), data[map_field]))
+ r_ids = map(lambda x: x[0], cr.fetchall())
+ if r_ids:
+ rdata = self.pool.get(model).read(cr, uid, r_ids)
+ rcal = self.export_ical(cr, uid, rdata, context=context)
+ for revents in rcal.contents['vevent']:
+ ical.contents['vevent'].append(revents)
+ if data.get('recurrent_uid', None):
+ uidval = common.openobjectid2uid(cr, data['recurrent_uid'], model)
vevent.add('uid').value = uidval
elif field == 'attendee' and data[map_field]:
attendee_obj = self.pool.get('basic.calendar.attendee')
@@ -236,7 +246,7 @@ class Event(CalDAV, osv.osv_memory):
'duration': None, # Use: O-1, Type: DURATION, Specifies a positive duration of time.
'dtend': None, # Use: O-1, Type: DATE-TIME, Specifies the date and time that a calendar component ends.
}
- def export_ical(self, cr, uid, datas, context={}):
+ def export_ical(self, cr, uid, datas, vobj='vevent', context={}):
return super(Event, self).export_ical(cr, uid, datas, 'vevent', context=context)
Event()
@@ -279,7 +289,7 @@ class ToDo(CalDAV, osv.osv_memory):
'rrule': None,
}
- def export_ical(self, cr, uid, datas, context={}):
+ def export_ical(self, cr, uid, datas, vobj='vevent', context={}):
return super(ToDo, self).export_ical(cr, uid, datas, 'vtodo', context=context)
ToDo()
diff --git a/addons/crm/crm_claim.py b/addons/crm/crm_claim.py
index 5f278ba9dca..1577ff97799 100644
--- a/addons/crm/crm_claim.py
+++ b/addons/crm/crm_claim.py
@@ -56,7 +56,7 @@ class crm_claim(osv.osv):
}
_defaults = {
- 'priority': lambda *a: AVAILABLE_PRIORITIES[2][0],
+ 'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
}
def onchange_categ_id(self, cr, uid, ids, categ, context={}):
if not categ:
diff --git a/addons/crm/crm_fundraising.py b/addons/crm/crm_fundraising.py
index ba69b092df2..88832a57d71 100644
--- a/addons/crm/crm_fundraising.py
+++ b/addons/crm/crm_fundraising.py
@@ -65,7 +65,7 @@ class crm_fundraising(osv.osv):
}
_defaults = {
- 'priority': lambda *a: AVAILABLE_PRIORITIES[2][0],
+ 'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
}
def onchange_categ_id(self, cr, uid, ids, categ, context={}):
if not categ:
diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py
index fcf16d3ec25..2cb1adbd1f4 100644
--- a/addons/crm/crm_meeting.py
+++ b/addons/crm/crm_meeting.py
@@ -26,8 +26,6 @@ from osv import fields, osv
from tools.translate import _
import base64
import re
-import time
-import tools
class crm_meeting(osv.osv):
@@ -53,8 +51,7 @@ class crm_meeting(osv.osv):
'transp': {'field': 'transparent', 'type': 'text'},
'uid': {'field': 'id', 'type': 'text'},
'url': {'field': 'caldav_url', 'type': 'text'},
- 'recurid': None,
-# 'attach': {'field': 'attachment_ids', 'sub-field': 'datas', 'type': 'list'},
+ 'recurrence-id': {'field': 'recurrent_id', 'type': 'datetime'},
'attendee': {'field': 'attendee_ids', 'type': 'many2many', 'object': 'calendar.attendee'},
'categories': {'field': 'categ_id', 'type': 'many2one', 'object': 'crm.meeting.categ'},
'comment': None,
@@ -89,13 +86,13 @@ class crm_meeting(osv.osv):
where id=%s"% (end.strftime("%Y-%m-%d %H:%M:%S"), id))
return True
- def onchange_rrule_type(self, cr, uid, ids, type, *args, **argv):
- if type == 'none':
+ def onchange_rrule_type(self, cr, uid, ids, rtype, *args, **argv):
+ if rtype == 'none' or not rtype:
return {'value': {'rrule': ''}}
- if type == 'custom':
+ if rtype == 'custom':
return {}
rrule = self.pool.get('calendar.custom.rrule')
- rrulestr = rrule.compute_rule_string(cr, uid, {'freq': type.upper(), \
+ rrulestr = rrule.compute_rule_string(cr, uid, {'freq': rtype.upper(), \
'interval': 1})
return {'value': {'rrule': rrulestr}}
@@ -119,7 +116,6 @@ account for mail gateway.'),
help='Category related to the section.Subdivide the CRM cases \
independently or section-wise.'),
'description': fields.text('Your action'),
- 'user_id': fields.many2one('res.users', 'Responsible'),
'class': fields.selection([('public', 'Public'), ('private', 'Private'), \
('confidential', 'Confidential')], 'Mark as'),
'location': fields.char('Location', size=264, help="Location of Meeting"),
@@ -138,6 +134,8 @@ rule or repeating pattern for anexception to a recurrence set"),
'attendee_ids': fields.many2many('calendar.attendee', 'crm_attendee_rel', 'case_id', 'attendee_id', 'Attendees'),
'alarm_id': fields.many2one('res.alarm', 'Alarm'),
'caldav_alarm_id': fields.many2one('calendar.alarm', 'Alarm'),
+ 'recurrent_uid': fields.integer('Recurrent ID'),
+ 'recurrent_id': fields.datetime('Recurrent ID date'),
}
_defaults = {
@@ -162,7 +160,7 @@ rule or repeating pattern for anexception to a recurrence set"),
crm_data = self.read(cr, uid, ids)
event_obj = self.pool.get('basic.calendar.event')
event_obj.__attribute__.update(self.__attribute__)
- ical = event_obj.export_ical(cr, uid, crm_data, {'model': self._name})
+ ical = event_obj.export_ical(cr, uid, crm_data, context={'model': self._name})
cal_val = ical.serialize()
cal_val = cal_val.replace('"', '').strip()
return cal_val
@@ -267,6 +265,18 @@ rule or repeating pattern for anexception to a recurrence set"),
return ids and ids[0] or False
return ids
+ def modify_this(self, cr, uid, ids, defaults, context=None, *args):
+ datas = self.read(cr, uid, ids[0], context=context)
+ date = datas.get('date')
+ defaults.update({
+ 'recurrent_uid': common.caldav_id2real_id(datas['id']),
+ 'recurrent_id': defaults.get('date'),
+ 'rrule_type': 'none',
+ 'rrule': ''
+ })
+ new_id = self.copy(cr, uid, ids[0], default=defaults, context=context)
+ return new_id
+
def search(self, cr, uid, args, offset=0, limit=100, order=None,
context=None, count=False):
args_without_date = []
@@ -356,11 +366,13 @@ rule or repeating pattern for anexception to a recurrence set"),
else:
ids = map(lambda x: common.caldav_id2real_id(x), ids)
res = super(crm_meeting, self).unlink(cr, uid, common.caldav_id2real_id(ids))
- self.do_alarm_unlink(cr, uid, ids)
+ alarm_obj = self.pool.get('res.alarm')
+ alarm_obj.do_alarm_unlink(cr, uid, ids, self._name)
else:
ids = map(lambda x: common.caldav_id2real_id(x), ids)
res = super(crm_meeting, self).unlink(cr, uid, ids)
- self.do_alarm_unlink(cr, uid, ids)
+ alarm_obj = self.pool.get('res.alarm')
+ alarm_obj.do_alarm_unlink(cr, uid, ids, self._name)
return res
def create(self, cr, uid, vals, context={}):
diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml
index 58b4051f38a..0f625fa1af7 100644
--- a/addons/crm/crm_meeting_view.xml
+++ b/addons/crm/crm_meeting_view.xml
@@ -23,7 +23,7 @@
-
+
@@ -46,8 +46,7 @@
context="{'model' : 'crm.meeting'}" colspan="2"/>
-
+
@@ -63,7 +62,7 @@
-
+
@@ -76,9 +75,17 @@
-
+
+
+
+
+
+
+
diff --git a/addons/crm/crm_meeting_wizard.xml b/addons/crm/crm_meeting_wizard.xml
index 8fb19bd622a..82b3e7d624f 100644
--- a/addons/crm/crm_meeting_wizard.xml
+++ b/addons/crm/crm_meeting_wizard.xml
@@ -9,9 +9,12 @@
name="caldav.crm.subscribe" id="wizard_crm_cal_subscribe" multi="True"
/>
-
+
+
+
diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py
index 21820b12044..7bb691ad6ad 100644
--- a/addons/crm/crm_phonecall.py
+++ b/addons/crm/crm_phonecall.py
@@ -57,9 +57,8 @@ class crm_phonecall(osv.osv):
def onchange_categ_id(self, cr, uid, ids, categ, context={}):
if not categ:
return {'value':{}}
- cat = self.pool.get('crm.case.categ').browse(cr, uid, categ, context).probability
- return {'value':{'probability':cat}}
-
+ cat = self.pool.get('crm.phonecall.categ').browse(cr, uid, categ, context).probability
+ return {'value':{'probability':cat}}
crm_phonecall()
diff --git a/addons/crm/wizard/__init__.py b/addons/crm/wizard/__init__.py
index 68fe0f06e8d..35952efe73c 100644
--- a/addons/crm/wizard/__init__.py
+++ b/addons/crm/wizard/__init__.py
@@ -22,6 +22,7 @@
import crm_opportunity_wizard
import crm_lead_wizard
import crm_phonecall_wizard
+import crm_meeting_edit_wizard
import wizard_crm_send_email
diff --git a/addons/crm/wizard/crm_meeting_edit_wizard.py b/addons/crm/wizard/crm_meeting_edit_wizard.py
new file mode 100644
index 00000000000..dbb25f499c1
--- /dev/null
+++ b/addons/crm/wizard/crm_meeting_edit_wizard.py
@@ -0,0 +1,85 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+import wizard
+import pooler
+
+class meeting_edit_this(wizard.interface):
+ case_form = """
+ """
+
+ case_fields = {
+ 'name': {'string': 'Title', 'type': 'char', 'size': 64},
+ 'date': {'string': 'Start Date', 'type': 'datetime'},
+ 'date_deadline': {'string': 'End Date', 'type': 'datetime'},
+ 'location': {'string': 'Location', 'type': 'char', 'size': 124},
+ 'categ_id': {'string': 'Category', 'type': 'many2one', 'relation': 'crm.meeting.categ'},
+ 'alarm_id': {'string': 'Reminder', 'type': 'many2one', 'relation': 'res.alarm'},
+ }
+
+ def _default_values(self, cr, uid, data, context):
+ case_obj = pooler.get_pool(cr.dbname).get('crm.meeting')
+ case = case_obj.read(cr, uid, data['id'], ['name', 'location', 'date',\
+ 'date_deadline', 'categ_id', 'alarm_id'])
+ return case
+
+ def _modify_this(self, cr, uid, datas, *args):
+ case_obj = pooler.get_pool(cr.dbname).get('crm.meeting')
+ new_id = case_obj.modify_this(cr, uid, [datas['id']], datas['form'])
+ value = {
+ 'name': 'New event',
+ 'view_type': 'form',
+ 'view_mode': 'form,tree',
+ 'res_model': 'crm.meeting',
+ 'res_id': new_id,
+ 'view_id': False,
+ 'type': 'ir.actions.act_window',
+ }
+ return value
+
+ states = {
+ 'init': {
+ 'actions': [_default_values],
+ 'result': {'type': 'form', 'arch': case_form, 'fields': case_fields,
+ 'state': [('end', 'Cancel', 'gtk-cancel'), ('edit', '_Save', 'gtk-save')]}
+ },
+ 'edit': {
+ 'actions': [],
+ 'result': {'type': 'action', 'action': _modify_this, 'state': 'end'}
+ }
+ }
+
+meeting_edit_this('crm.meeting.edit.this')
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project/project.py b/addons/project/project.py
index 555f4c65f4d..8bd78c1c80f 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -508,11 +508,10 @@ class message(osv.osv):
message()
def _project_get(self, cr, uid, context={}):
- obj = self.pool.get('project.project')
- ids = obj.search(cr, uid, [])
- res = obj.read(cr, uid, ids, ['id','name'], context)
- res = [(str(r['id']),r['name']) for r in res]
- return res
+ cr.execute("""SELECT to_char(id, '99999'),name FROM project_project where manager=%s OR
+ id IN (SELECT project_id from project_user_rel where uid=%s)""" % (uid, uid))
+ projects = cr.fetchall()
+ return projects
class users(osv.osv):
_inherit = 'res.users'
diff --git a/addons/project/security/project_security.xml b/addons/project/security/project_security.xml
index 064b9bec27a..6d862a8dbc6 100644
--- a/addons/project/security/project_security.xml
+++ b/addons/project/security/project_security.xml
@@ -44,7 +44,7 @@
- ['|',('project_id','=',False),('project_id','=',user.context_project_id)]
+ ['|',('project_id','=',False),('project_id','in',[user.context_project_id])]
@@ -54,7 +54,7 @@
- ['|',('task_id.project_id','=',False),('task_id.project_id','=',user.context_project_id)]
+ ['|',('task_id.project_id','=',False),('task_id.project_id','in',[user.context_project_id])]
@@ -64,7 +64,7 @@
- ['|',('id','=',False),('id','=',user.context_project_id)]
+ ['|',('id','=',False),('id','in',[user.context_project_id])]
@@ -74,7 +74,7 @@
- ['|',('project_id','=',False),('project_id','=',user.context_project_id)]
+ ['|',('project_id','=',False),('project_id','in',[user.context_project_id])]
diff --git a/addons/project_messages/messages.py b/addons/project_messages/messages.py
index dc505f9073f..422bdb3675c 100644
--- a/addons/project_messages/messages.py
+++ b/addons/project_messages/messages.py
@@ -28,6 +28,7 @@ class messages(osv.osv):
logger = netsvc.Logger()
_columns = {
+ 'from_id':fields.many2one('res.users', 'From', ondelete="CASCADE"),
'to_id':fields.many2one('res.users', 'To', ondelete="CASCADE"),
'project_id':fields.many2one('project.project', 'Project',
required=True, ondelete="CASCADE"),