diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index a8de84f2cdc..a76a7c015a6 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -327,7 +327,7 @@ - + @@ -335,7 +335,12 @@ - + + + + + + diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 8be310245ac..709009f8481 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -873,7 +873,7 @@ - +
diff --git a/addons/account/i18n/it.po b/addons/account/i18n/it.po index 58ad4f5346d..f10931214ac 100644 --- a/addons/account/i18n/it.po +++ b/addons/account/i18n/it.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2010-01-29 14:02+0000\n" -"Last-Translator: Carlo \n" +"PO-Revision-Date: 2010-02-03 19:01+0000\n" +"Last-Translator: Davide Corio \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-01-30 04:39+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account @@ -288,6 +288,11 @@ msgid "" "date empty, it means direct payment. The payment term may compute several " "due dates, for example 50% now, 50% in one month." msgstr "" +"Se vengono utilizzati i termini di pagamento, la data di scadenza verrà " +"calcolata automaticamente alla generazione dei movimenti contabili. Se i " +"termini di pagamento e la data di scadenza non vengono valorizzati, equivale " +"al pagamento diretto. Il termine di pagamento può essere calcolato a fronte " +"di diverse scadenze, per esempio 50% subito e 50% dopo un mese." #. module: account #: selection:account.tax,type:0 @@ -321,7 +326,7 @@ msgstr "Origine" #. module: account #: rml:account.analytic.account.journal:0 msgid "Move Name" -msgstr "" +msgstr "Nome Movimento" #. module: account #: xsl:account.transfer:0 @@ -353,7 +358,7 @@ msgstr "Tassa" #. module: account #: rml:account.general.journal:0 msgid "Debit Trans." -msgstr "" +msgstr "Debito Trans." #. module: account #: field:account.analytic.line,account_id:0 diff --git a/addons/account_analytic_analysis/account_analytic_analysis_menu.xml b/addons/account_analytic_analysis/account_analytic_analysis_menu.xml index 6dafe28af8e..2862f7b7657 100644 --- a/addons/account_analytic_analysis/account_analytic_analysis_menu.xml +++ b/addons/account_analytic_analysis/account_analytic_analysis_menu.xml @@ -1,5 +1,6 @@ + diff --git a/addons/account_analytic_analysis/i18n/nl.po b/addons/account_analytic_analysis/i18n/nl.po index c3f12aef08c..e9332b8394f 100644 --- a/addons/account_analytic_analysis/i18n/nl.po +++ b/addons/account_analytic_analysis/i18n/nl.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-02 04:48+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_analytic_analysis diff --git a/addons/account_anglo_saxon/i18n/pl.po b/addons/account_anglo_saxon/i18n/pl.po index aab9ded1466..e945c85b380 100644 --- a/addons/account_anglo_saxon/i18n/pl.po +++ b/addons/account_anglo_saxon/i18n/pl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-03 04:47+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:48+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_anglo_saxon diff --git a/addons/account_followup/i18n/nl.po b/addons/account_followup/i18n/nl.po index d756121ab3b..c0a481b6cbc 100644 --- a/addons/account_followup/i18n/nl.po +++ b/addons/account_followup/i18n/nl.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-02 04:48+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_followup diff --git a/addons/account_reporting/i18n/ru.po b/addons/account_reporting/i18n/ru.po index 0fac8e23859..091a5087244 100644 --- a/addons/account_reporting/i18n/ru.po +++ b/addons/account_reporting/i18n/ru.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-03 04:47+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: account_reporting diff --git a/addons/auction/i18n/pt_BR.po b/addons/auction/i18n/pt_BR.po index c6a12f8f1aa..8b92024b5fd 100644 --- a/addons/auction/i18n/pt_BR.po +++ b/addons/auction/i18n/pt_BR.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-02 04:48+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: auction diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 31b2d7f7cc8..9849a5b012d 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -30,9 +30,14 @@ import pooler import pytz import re import tools -import vobject import time + +try: + import vobject +except ImportError: + raise osv.except_osv('vobject Import Error!','Please install python-vobject from http://vobject.skyhouseconsulting.com/') + # O-1 Optional and can come only once # O-n Optional and can come more than once # R-1 Required and can come only once @@ -66,33 +71,33 @@ def openobjectid2uid(cr, uidval, oomodel): return value def get_attribute_mapping(cr, uid, calname, context={}): - if not context: - context = {} - pool = pooler.get_pool(cr.dbname) - field_obj = pool.get('basic.calendar.fields') - type_obj = pool.get('basic.calendar.lines') - domain = [('object_id.model', '=', context.get('model'))] - if context.get('calendar_id'): - domain.append(('calendar_id', '=', context.get('calendar_id'))) - type_id = type_obj.search(cr, uid, domain) - fids = field_obj.search(cr, uid, [('type_id', '=', type_id[0])]) - res = {} - for field in field_obj.browse(cr, uid, fids): - attr = field.name.name - res[attr] = {} - res[attr]['field'] = field.field_id.name - res[attr]['type'] = field.field_id.ttype - if field.fn == 'hours': - res[attr]['type'] = "timedelta" - if res[attr]['type'] in ('one2many', 'many2many', 'many2one'): - res[attr]['object'] = field.field_id.relation - elif res[attr]['type'] in ('selection') and field.mapping: - res[attr]['mapping'] = eval(field.mapping) - if not res.get('uid', None): - res['uid'] = {} - res['uid']['field'] = 'id' - res['uid']['type'] = "integer" - return res + if not context: + context = {} + pool = pooler.get_pool(cr.dbname) + field_obj = pool.get('basic.calendar.fields') + type_obj = pool.get('basic.calendar.lines') + domain = [('object_id.model', '=', context.get('model'))] + if context.get('calendar_id'): + domain.append(('calendar_id', '=', context.get('calendar_id'))) + type_id = type_obj.search(cr, uid, domain) + fids = field_obj.search(cr, uid, [('type_id', '=', type_id[0])]) + res = {} + for field in field_obj.browse(cr, uid, fids): + attr = field.name.name + res[attr] = {} + res[attr]['field'] = field.field_id.name + res[attr]['type'] = field.field_id.ttype + if field.fn == 'hours': + res[attr]['type'] = "timedelta" + if res[attr]['type'] in ('one2many', 'many2many', 'many2one'): + res[attr]['object'] = field.field_id.relation + elif res[attr]['type'] in ('selection') and field.mapping: + res[attr]['mapping'] = eval(field.mapping) + if not res.get('uid', None): + res['uid'] = {} + res['uid']['field'] = 'id' + res['uid']['type'] = "integer" + return res def map_data(cr, uid, obj): vals = {} @@ -345,13 +350,13 @@ class Calendar(CalDAV, osv.osv): _columns = { 'name': fields.char("Name", size=64), 'line_ids': fields.one2many('basic.calendar.lines', 'calendar_id', 'Calendar Lines'), - 'active': fields.boolean('Active'), + 'active': fields.boolean('Active'), 'create_date': fields.datetime('Created Date'), 'write_date': fields.datetime('Modifided Date'), } _defaults = { - 'active': lambda *a: True, + 'active': lambda *a: True, } def export_cal(self, cr, uid, ids, vobj='vevent', context={}): @@ -413,7 +418,7 @@ class basic_calendar_line(osv.osv): } _defaults = { - 'domain': lambda *a: '[]', + 'domain': lambda *a: '[]', } basic_calendar_line() @@ -422,11 +427,11 @@ class basic_calendar_attribute(osv.osv): _name = 'basic.calendar.attributes' _description = 'Calendar attributes' _columns = { - 'name': fields.char("Name", size=64, required=True), + 'name': fields.char("Name", size=64, required=True), 'type': fields.selection([('vevent', 'Event'), ('vtodo', 'TODO'), \ ('alarm', 'Alarm'), \ ('attendee', 'Attendee')], \ - string="Type", size=64, required=True), + string="Type", size=64, required=True), } basic_calendar_attribute() @@ -436,20 +441,20 @@ class basic_calendar_fields(osv.osv): _description = 'Calendar fields' _columns = { - 'field_id': fields.many2one('ir.model.fields', 'OpenObject Field'), - 'name': fields.many2one('basic.calendar.attributes', 'Name', required=True), + 'field_id': fields.many2one('ir.model.fields', 'OpenObject Field'), + 'name': fields.many2one('basic.calendar.attributes', 'Name', required=True), 'type_id': fields.many2one('basic.calendar.lines', 'Type', \ - required=True, ondelete='cascade'), - 'expr': fields.char("Expression", size=64), - 'fn': fields.selection( [('field', 'Use the field'), - ('const', 'Expression as constant'), - ('hours', 'Interval in hours'), - ],'Function'), + required=True, ondelete='cascade'), + 'expr': fields.char("Expression", size=64), + 'fn': fields.selection([('field', 'Use the field'), + ('const', 'Expression as constant'), + ('hours', 'Interval in hours'), + ], 'Function'), 'mapping': fields.text('Mapping'), } _defaults = { - 'fn': lambda *a: 'field', + 'fn': lambda *a: 'field', } def check_line(self, cr, uid, vals, name, context=None): @@ -471,7 +476,7 @@ class basic_calendar_fields(osv.osv): name = cr.fetchone() name = name[0] if name in ('valarm', 'attendee'): - self.check_line(cr, uid, vals, name, context=context) + self.check_line(cr, uid, vals, name, context=context) cr.execute("Select count(id) from basic_calendar_fields \ where name=%s and type_id=%s" % (vals.get('name'), vals.get('type_id'))) res = cr.fetchone() @@ -487,7 +492,7 @@ class basic_calendar_fields(osv.osv): field = self.browse(cr, uid, id, context=context) name = field.name.name if name in ('valarm', 'attendee'): - self.check_line(cr, uid, vals, name, context=context) + self.check_line(cr, uid, vals, name, context=context) qry = "Select count(id) from basic_calendar_fields \ where name=%s and type_id=%s" % (field.name.id, field.type_id.id) cr.execute(qry) diff --git a/addons/base_calendar/base_calendar_data.xml b/addons/base_calendar/base_calendar_data.xml index b15cd72874e..7ebab73aca5 100644 --- a/addons/base_calendar/base_calendar_data.xml +++ b/addons/base_calendar/base_calendar_data.xml @@ -1,6 +1,6 @@ - + @@ -54,7 +54,12 @@ valarm vevent - + + + vtimezone + vevent + + priority vevent @@ -172,7 +177,12 @@ seq vtodo - + + + vtimezone + vtodo + + url vtodo diff --git a/addons/base_contact/base_contact_view.xml b/addons/base_contact/base_contact_view.xml index 7f69d89661d..d4b99e11a85 100644 --- a/addons/base_contact/base_contact_view.xml +++ b/addons/base_contact/base_contact_view.xml @@ -419,6 +419,15 @@ res_model="res.partner.job" src_model="res.partner" /> + + + + diff --git a/addons/base_contact/i18n/nl.po b/addons/base_contact/i18n/nl.po index 21dacd2804b..7a20a160d31 100644 --- a/addons/base_contact/i18n/nl.po +++ b/addons/base_contact/i18n/nl.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-02 04:48+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base_contact diff --git a/addons/base_module_merge/i18n/ru.po b/addons/base_module_merge/i18n/ru.po index 0cb1fec8c32..016eb866788 100644 --- a/addons/base_module_merge/i18n/ru.po +++ b/addons/base_module_merge/i18n/ru.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-11-17 06:51+0000\n" -"Last-Translator: Fabien (Open ERP) \n" +"PO-Revision-Date: 2010-02-03 23:27+0000\n" +"Last-Translator: Artyom Packhomov \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-12-16 05:26+0000\n" +"X-Launchpad-Export-Date: 2010-02-05 05:01+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base_module_merge @@ -60,7 +60,7 @@ msgstr "Версия" #: wizard_view:base_module_merge.module_merge,info:0 #: wizard_view:base_module_merge.module_merge,save:0 msgid "Module Recording" -msgstr "" +msgstr "Запись модуля" #. module: base_module_merge #: wizard_view:base_module_merge.module_merge,save:0 diff --git a/addons/base_module_quality/i18n/pt_BR.po b/addons/base_module_quality/i18n/pt_BR.po index 88d7caaafbb..b799c63da63 100644 --- a/addons/base_module_quality/i18n/pt_BR.po +++ b/addons/base_module_quality/i18n/pt_BR.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: openobject-addons\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-08-28 16:01+0000\n" -"PO-Revision-Date: 2009-12-07 16:08+0000\n" -"Last-Translator: Pedro_Maschio \n" +"PO-Revision-Date: 2010-02-04 10:26+0000\n" +"Last-Translator: Holverat Bortolossi \n" "Language-Team: Brazilian Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-12-16 05:26+0000\n" +"X-Launchpad-Export-Date: 2010-02-05 05:01+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base_module_quality @@ -27,18 +27,18 @@ msgstr "Pontuação Final (%)" msgid "" "The Object name must start with x_ and not contain any special character !" msgstr "" -"O nome do objeto precisa iniciar com x_ e não conter nenhum caracter " +"O nome do Objeto deve começar com x_ e não deve conter nenhum caracter " "especial!" #. module: base_module_quality #: model:ir.module.module,shortdesc:base_module_quality.module_meta_information msgid "Base module quality" -msgstr "Qualidade do módulo base" +msgstr "Módulo base da qualidade" #. module: base_module_quality #: field:module.quality.check,name:0 msgid "Rated Module" -msgstr "Nota do Módulo" +msgstr "Módulo Avaliado" #. module: base_module_quality #: view:module.quality.detail:0 @@ -53,7 +53,7 @@ msgstr "Nota" #. module: base_module_quality #: field:module.quality.detail,state:0 msgid "State" -msgstr "Status" +msgstr "Estado" #. module: base_module_quality #: field:module.quality.detail,detail:0 diff --git a/addons/base_module_quality/i18n/ru.po b/addons/base_module_quality/i18n/ru.po index bd6fee8b068..4c567fde222 100644 --- a/addons/base_module_quality/i18n/ru.po +++ b/addons/base_module_quality/i18n/ru.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-03 04:47+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base_module_quality diff --git a/addons/base_report_creator/i18n/zh_CN.po b/addons/base_report_creator/i18n/zh_CN.po index 6b64eeb3280..a702b009170 100644 --- a/addons/base_report_creator/i18n/zh_CN.po +++ b/addons/base_report_creator/i18n/zh_CN.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-03 04:47+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base_report_creator diff --git a/addons/base_setup/i18n/ru.po b/addons/base_setup/i18n/ru.po index 853d609b31b..7a50baf7b14 100644 --- a/addons/base_setup/i18n/ru.po +++ b/addons/base_setup/i18n/ru.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-03 04:47+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base_setup diff --git a/addons/base_vat/i18n/ru.po b/addons/base_vat/i18n/ru.po index fc16d1b23f8..affbcdb6e83 100644 --- a/addons/base_vat/i18n/ru.po +++ b/addons/base_vat/i18n/ru.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-03 04:47+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base_vat diff --git a/addons/board_crm_configuration/i18n/it.po b/addons/board_crm_configuration/i18n/it.po index dad58efb8b1..956b3c2a9f0 100644 --- a/addons/board_crm_configuration/i18n/it.po +++ b/addons/board_crm_configuration/i18n/it.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-02-03 04:47+0000\n" +"X-Launchpad-Export-Date: 2010-02-04 04:47+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: board_crm_configuration diff --git a/addons/board_hr/__terp__.py b/addons/board_hr/__terp__.py index 80b00961dbe..182cd36e1ec 100644 --- a/addons/board_hr/__terp__.py +++ b/addons/board_hr/__terp__.py @@ -37,6 +37,5 @@ This module implements a dashboard for human resource management that includes: 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/board_project/board_project_manager_view.xml b/addons/board_project/board_project_manager_view.xml index 3f805115fd4..3baca91bce6 100644 --- a/addons/board_project/board_project_manager_view.xml +++ b/addons/board_project/board_project_manager_view.xml @@ -55,9 +55,9 @@ - + - + diff --git a/addons/board_project/board_project_view.xml b/addons/board_project/board_project_view.xml index f1e27da0839..e602b54d982 100644 --- a/addons/board_project/board_project_view.xml +++ b/addons/board_project/board_project_view.xml @@ -92,11 +92,12 @@ - + + + - diff --git a/addons/caldav/caldav.py b/addons/caldav/caldav.py index 1e2aa15b77a..d440902f9e2 100644 --- a/addons/caldav/caldav.py +++ b/addons/caldav/caldav.py @@ -67,52 +67,110 @@ def _links_get(self, cr, uid, context={}): return [(r['object'], r['name']) for r in res] html_invitation = """ + %(name)s -
- - + +
+ + + + + + + + + +
Hello,
You are invited for %(company)s Event.
Below are the details of event:
+ + + + + + + +

%(name)s

- +
- + - - + + - - + + + - + + - + + -
-
Start Date
+
+
Start Date
: %(start_date)s -
End Date
+
+
End Date
%(end_date)s:%(end_date)s
Description
Description: %(description)s
-
Location
+
Location
: %(location)s
-
Event Attendees
+
Event Attendees
:
%(attendees)s
""" +
Are you coming?: +
    +
  • YES
  • +
  • NO
  • +
  • MAYBE
  • +
+
+ + + + + + + + + + + + + + + + + + + +
Note: If you are interested please reply this + mail and keep only your response from options YES, NO + and MAYBE.
From:
%(user)s
--------------------------
%(sign)s
+ + +""" class calendar_attendee(osv.osv): _name = 'calendar.attendee' @@ -130,13 +188,6 @@ class calendar_attendee(osv.osv): name = name[0] result = {} - def get_delegate_data(user): - if not user.address_id.email: - raise osv.except_osv(_('Error!'), \ - ("User does not have an email Address")) - email = (user.address_id and ('MAILTO:' + user.address_id.email)) or '' - return email - for attdata in self.browse(cr, uid, ids, context=context): id = attdata.id result[id] = {} @@ -155,13 +206,10 @@ class calendar_attendee(osv.osv): else: result[id][name] = self._get_address(None, attdata.email) if name == 'delegated_to': - user_obj = self.pool.get('res.users') - todata = map(get_delegate_data, attdata.del_to_user_ids) + todata = map(lambda x:('MAILTO:' + x.email) or '', attdata.del_to_user_ids) result[id][name] = ', '.join(todata) if name == 'delegated_from': - dstring = [] - user_obj = self.pool.get('res.users') - fromdata = map(get_delegate_data, attdata.del_from_user_ids) + fromdata = map(lambda x:('MAILTO:' + x.email) or '', attdata.del_from_user_ids) result[id][name] = ', '.join(fromdata) if name == 'event_date': if attdata.ref: @@ -189,7 +237,7 @@ class calendar_attendee(osv.osv): result[id][name] = uid if name == 'language': user_obj = self.pool.get('res.users') - lang = user_obj.read(cr, uid, uid, ['context_lang']) ['context_lang'] + lang = user_obj.read(cr, uid, uid, ['context_lang'])['context_lang'] result[id][name] = lang.replace('_', '-') return result @@ -230,17 +278,17 @@ class calendar_attendee(osv.osv): string='Delegated To', type="char", size=124, store=True, \ multi='delegated_to', help="The users that the original \ request was delegated to"), - 'del_to_user_ids': fields.many2many('res.users', 'att_del_to_user_rel', + 'del_to_user_ids': fields.many2many('calendar.attendee', 'att_del_to_user_rel', 'attendee_id', 'user_id', 'Users'), 'delegated_from': fields.function(_compute_data, method=True, string=\ 'Delegated From', type="char", store=True, size=124, multi='delegated_from'), - 'del_from_user_ids': fields.many2many('res.users', 'att_del_from_user_rel', \ + 'del_from_user_ids': fields.many2many('calendar.attendee', 'att_del_from_user_rel', \ 'attendee_id', 'user_id', 'Users'), 'sent_by': fields.function(_compute_data, method=True, string='Sent By', type="char", multi='sent_by', store=True, size=124, help="Specify the user that is acting on behalf of the calendar user"), - 'sent_by_uid': fields.function(_compute_data, method=True, string='Sent By User', type="many2one", relation="res.users", multi='sent_by_uid'), + 'sent_by_uid': fields.function(_compute_data, method=True, string='Sent By User', type="many2one", relation="res.users", multi='sent_by_uid'), 'cn': fields.function(_compute_data, method=True, string='Common name', type="char", size=124, multi='cn', store=True), 'dir': fields.char('URI Reference', size=124, help="Reference to the URI that points to the directory information corresponding to the attendee."), - 'language': fields.function(_compute_data, method=True, string='Language', type="selection", selection=_lang_get, multi='language', store=True, help="To specify the language for text values in a property or property parameter."), + 'language': fields.function(_compute_data, method=True, string='Language', type="selection", selection=_lang_get, multi='language', store=True, help="To specify the language for text values in a property or property parameter."), 'user_id': fields.many2one('res.users', 'User'), 'partner_address_id': fields.many2one('res.partner.address', 'Contact'), 'partner_id':fields.related('partner_address_id', 'partner_id', type='many2one', relation='res.partner', string='Partner'), @@ -253,6 +301,30 @@ request was delegated to"), _defaults = { 'state': lambda *x: 'needs-action', } + + response_re = response_re = re.compile("Are you coming\?.*(YES|NO|MAYBE).*", re.UNICODE) + + def msg_new(self, cr, uid, msg): + return False + + def msg_act_get(self, msg): + mailgate_obj = self.pool.get('mail.gateway') + body = mailgate_obj.msg_body_get(msg) + actions = {} + res = self.response_re.findall(body['body']) + if res: + actions['state'] = res[0] + return actions + + def msg_update(self, cr, uid, ids, msg, data={}, default_act='None'): + msg_actions = self.msg_act_get(msg) + if msg_actions.get('state'): + if msg_actions['state'] in ['YES', 'NO', 'MAYBE']: + mapping = {'YES': 'accepted', 'NO': 'declined', 'MAYBE': 'tentative'} + status = mapping[msg_actions['state']] + print 'Got response for invitation id: %s as %s' % (ids, status) + self.write(cr, uid, ids, {'state': status}) + return True def onchange_user_id(self, cr, uid, ids, user_id, *args, **argv): if not user_id: @@ -278,7 +350,7 @@ request was delegated to"), vals['cn'] = vals.get("cn") res = super(calendar_attendee, self).create(cr, uid, vals, context) return res - + calendar_attendee() class res_alarm(osv.osv): @@ -352,7 +424,7 @@ are both optional, but if one occurs, so MUST the other"""), model_obj = self.pool.get(model) for datas in model_obj.browse(cr, uid, ids): alarm_ids = alarm_obj.search(cr, uid, [('model_id', '=', model_id), ('res_id', '=', datas.id)]) - if alarm_ids and len(alarm_ids): + if alarm_ids: alarm_obj.unlink(cr, uid, alarm_ids) cr.execute('Update %s set caldav_alarm_id=NULL, alarm_id=NULL\ where id=%s' % (model_obj._table, datas.id)) @@ -414,7 +486,7 @@ or contains the text to be used for display"""), res = super(calendar_alarm, self).create(cr, uid, vals, context) return res - def do_run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, \ + def do_run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False,\ context=None): if not context: context = {} @@ -457,13 +529,13 @@ or contains the text to be used for display"""), %s """ % (alarm.name, alarm.trigger_date, alarm.description, \ - alarm.user_id.name, alarm.user_id.sign) + alarm.user_id.name, alarm.user_id.signature) mail_to = [alarm.user_id.address_id.email] for att in alarm.attendee_ids: mail_to.append(att.user_id.address_id.email) tools.email_send( - tools.confirm['from_mail'], + tools.config.get('email_from', False), mail_to, sub, body @@ -479,7 +551,7 @@ class calendar_event(osv.osv): _description = "Calendar Event" __attribute__ = {} - def _tz_get(self,cr,uid, context={}): + def _tz_get(self, cr, uid, context={}): return [(x.lower(), x) for x in pytz.all_timezones] def onchange_rrule_type(self, cr, uid, ids, rtype, *args, **argv): @@ -518,7 +590,7 @@ class calendar_event(osv.osv): 'name': fields.char('Description', size=64, required=True), 'date': fields.datetime('Date'), 'date_deadline': fields.datetime('Deadline'), - 'create_date': fields.datetime('Created' ,readonly=True), + 'create_date': fields.datetime('Created', readonly=True), 'duration': fields.function(_get_duration, method=True, \ fnct_inv=_set_duration, string='Duration'), 'description': fields.text('Your action'), @@ -541,7 +613,7 @@ rule or repeating pattern for anexception to a recurrence set"), 'caldav_alarm_id': fields.many2one('calendar.alarm', 'Alarm'), 'recurrent_uid': fields.integer('Recurrent ID'), 'recurrent_id': fields.datetime('Recurrent ID date'), - 'vtimezone': fields.selection(_tz_get, 'Timezone', size=64), + 'vtimezone': fields.selection(_tz_get, 'Timezone', size=64), 'user_id': fields.many2one('res.users', 'Responsible'), } @@ -565,8 +637,8 @@ rule or repeating pattern for anexception to a recurrence set"), def check_import(self, cr, uid, vals, context={}): ids = [] for val in vals: - exists, r_id = base_calendar.uid2openobjectid(cr, val['id'], self._name, \ - val.get('recurrent_id')) + exists, r_id = base_calendar.uid2openobjectid(cr, val['id'], \ + self._name, val.get('recurrent_id')) if val.has_key('create_date'): val.pop('create_date') val['caldav_url'] = context.get('url') or '' val.pop('id') @@ -680,8 +752,8 @@ rule or repeating pattern for anexception to a recurrence set"), start_date = arg[2] elif arg[1] in ('<', '<='): until_date = arg[2] - res = super(calendar_event, self).search(cr, uid, args_without_date, offset, - limit, order, context, count) + res = super(calendar_event, self).search(cr, uid, args_without_date, \ + offset, limit, order, context, count) return self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit) @@ -753,8 +825,7 @@ rule or repeating pattern for anexception to a recurrence set"), for record in self.read(cr, uid, [caldav_id2real_id(id)], \ ['date', 'rrule', 'exdate']): if record['rrule']: - exdate = (record['exdate'] and (record['exdate'] + ',') or '') + \ - ''.join((re.compile('\d')).findall(date_new)) + 'Z' + exdate = (record['exdate'] and (record['exdate'] + ',') or '') + ''.join((re.compile('\d')).findall(date_new)) + 'Z' if record['date'] == date_new: res = self.write(cr, uid, [caldav_id2real_id(id)], {'exdate': exdate}) else: @@ -795,14 +866,14 @@ class calendar_todo(osv.osv): return True _columns = { - 'date': fields.function(_get_date, method=True, fnct_inv=_set_date, \ - string='Duration', store=True, type='datetime'), + 'date': fields.function(_get_date, method=True, fnct_inv=_set_date, \ + string='Duration', store=True, type='datetime'), 'duration': fields.integer('Duration'), } __attribute__ = {} - def import_cal(self, cr, uid, data, data_id=None, context={}): + def import_cal(self, cr, uid, data, data_id=None, context={}): todo_obj = self.pool.get('basic.calendar.todo') vals = todo_obj.import_cal(cr, uid, data, context=context) return self.check_import(cr, uid, vals, context=context) @@ -882,7 +953,7 @@ class ir_values(osv.osv): new_model.append((data[0], caldav_id2real_id(data[1]))) else: new_model.append(data) - return super(ir_values, self).set(cr, uid, key, key2, name, new_model, \ + return super(ir_values, self).set(cr, uid, key, key2, name, new_model,\ value, replace, isobject, meta, preserve_user, company) def get(self, cr, uid, key, key2, models, meta=False, context={}, \ @@ -1087,6 +1158,9 @@ class invite_attendee_wizard(osv.osv_memory): } def do_invite(self, cr, uid, ids, context={}): + model2field = { + 'calendar.attendee': 'del_to_user_ids', + 'crm.meeting': 'attendee_ids'} datas = self.read(cr, uid, ids)[0] if not context or not context.get('model'): return {} @@ -1096,7 +1170,9 @@ class invite_attendee_wizard(osv.osv_memory): res_obj = obj.browse(cr, uid, context['active_id']) type = datas.get('type') att_obj = self.pool.get('calendar.attendee') - vals = {'ref': '%s,%s' % (model, caldav_id2real_id(context['active_id']))} + vals = {} + if not model == 'calendar.attendee': + vals = {'ref': '%s,%s' % (model, caldav_id2real_id(context['active_id']))} if type == 'internal': user_obj = self.pool.get('res.users') for user_id in datas.get('user_ids', []): @@ -1107,39 +1183,53 @@ class invite_attendee_wizard(osv.osv_memory): vals.update({'user_id': user_id, 'email': user.address_id.email}) att_id = att_obj.create(cr, uid, vals) - obj.write(cr, uid, res_obj.id, {'attendee_ids': [(4, att_id)]}) + obj.write(cr, uid, res_obj.id, {model2field[model]: [(4, att_id)]}) elif type == 'external' and datas.get('email'): vals.update({'email': datas['email']}) + company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.name + att_infos = [] + for att in res_obj.attendee_ids: + att_infos.append(((att.user_id and att.user_id.name) or \ + (att.partner_id and att.partner_id.name) or \ + att.email) + ' - Status: ' + att.state.title()) att_id = att_obj.create(cr, uid, vals) - obj.write(cr, uid, res_obj.id, {'attendee_ids': [(4, att_id)]}) - - sub = '[OpenERP Invitation] %s' % (res_obj.name) + obj.write(cr, uid, res_obj.id, {model2field[model]: [(4, att_id)]}) + sign = res_obj.user_id and res_obj.user_id.signature or '' + sign = '
'.join(sign and sign.split('\n') or []) + sub = '[%s Invitation][%d] %s' % (company, att_id, res_obj.name) body_vals = {'name': res_obj.name, 'start_date': res_obj.date, 'end_date': res_obj.date_deadline or None, - 'description': res_obj.description, + 'description': res_obj.description or '-', 'location': res_obj.location or '-', - 'attendees': '-' #Todo + 'attendees': '
'.join(att_infos), + 'user': res_obj.user_id and res_obj.user_id.name or 'OpenERP User', + 'sign': sign, + 'company': company } body = html_invitation % body_vals mail_to = [datas['email']] tools.email_send( - res_obj.user_id.name, + tools.config.get('email_from', False), mail_to, sub, body, - subtype='html' + subtype='html', + reply_to=tools.config.get('email_from', False) ) elif type == 'partner': add_obj = self.pool.get('res.partner.address') for contact in add_obj.browse(cr, uid, datas['contact_ids']): + if not contact.email: + raise osv.except_osv(_('Error!'), \ + ("Partner does not have an email Address")) vals.update({ 'partner_address_id': contact.id, 'email': contact.email}) att_id = att_obj.create(cr, uid, vals) - obj.write(cr, uid, res_obj.id, {'attendee_ids': [(4, att_id)]}) + obj.write(cr, uid, res_obj.id, {model2field[model]: [(4, att_id)]}) return {} diff --git a/addons/caldav/caldav_view.xml b/addons/caldav/caldav_view.xml index 4d10b9529f5..2d3a59892c7 100644 --- a/addons/caldav/caldav_view.xml +++ b/addons/caldav/caldav_view.xml @@ -95,21 +95,16 @@