diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index 57f16473b82..0508a7cadfe 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -185,6 +185,7 @@ class account_invoice(osv.osv):
_columns = {
'name': fields.char('Description', size=64, select=True, readonly=True, states={'draft':[('readonly',False)]}),
'origin': fields.char('Source Document', size=64, help="Reference of the document that produced this invoice.", readonly=True, states={'draft':[('readonly',False)]}),
+ 'supplier_invoice_number': fields.char('Supplier Invoice Number', size=64, help="The reference of this invoice as provided by the supplier.", readonly=True, states={'draft':[('readonly',False)]}),
'type': fields.selection([
('out_invoice','Customer Invoice'),
('in_invoice','Supplier Invoice'),
diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 1f0ce38a017..5ed373456f3 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -168,12 +168,15 @@
context="{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}"
domain="[('supplier', '=', True)]"/>
-
-
-
@@ -445,7 +448,7 @@
account.invoice
-
+
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index 1b614a1ee85..745795452d3 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -2414,32 +2414,6 @@
form
new
-
- ir.actions.server
- True
- code
-
-
-
-# check for unconfigured companies
-account_installer_obj = self.pool.get('account.installer')
-account_installer_obj.check_unconfigured_cmp(cr, uid, context=context)
-action_ids = []
-# fetch the act_window actions related to chart of account configuration
-# we use ir.actions.todo to enable the possibility for other modules to insert their own
-# wizards during the configuration process
-ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'action_wizard_multi_chart')
-if ref:
- action_ids += [ref[1]]
-ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'account', 'action_account_configuration_installer')
-if ref:
- action_ids += [ref[1]]
-todo_ids = pool.get('ir.actions.todo').search(cr, uid, [('action_id', 'in', action_ids)], context=context)
-pool.get('ir.actions.todo').write(cr, uid, todo_ids, {'state':'open'}, context=context)
-action = pool.get('res.config').next(cr, uid, [], context)
-
- New Company Financial Setting
-
account.account.graph
diff --git a/addons/account/installer.py b/addons/account/installer.py
index 6173ea9213e..05a0f6b455e 100644
--- a/addons/account/installer.py
+++ b/addons/account/installer.py
@@ -119,15 +119,6 @@ class account_installer(osv.osv_memory):
self.execute_simple(cr, uid, ids, context)
super(account_installer, self).execute(cr, uid, ids, context=context)
- def action_next(self, cr, uid, ids, context=None):
- next = self.execute(cr, uid, ids, context=context)
- for installer in self.browse(cr, uid, ids, context=context):
- if installer.charts == 'l10n_be':
- return {'type': 'ir.actions.act_window_close'}
- else :
- if next : return next
- return self.next(cr, uid, ids, context=context)
-
def execute_simple(self, cr, uid, ids, context=None):
if context is None:
context = {}
diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py
index 1ce483a26cd..5ea8c59b848 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/analytic.py
@@ -255,27 +255,27 @@ class account_analytic_account(osv.osv):
if context is None:
context={}
if context.get('current_model') == 'project.project':
- cr.execute("select analytic_account_id from project_project")
- project_ids = [x[0] for x in cr.fetchall()]
+ project_obj = self.pool.get("account.analytic.account")
+ project_ids = project_obj.search(cr, uid, args)
return self.name_get(cr, uid, project_ids, context=context)
if name:
- account = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)
- if not account:
+ account_ids = self.search(cr, uid, [('code', '=', name)] + args, limit=limit, context=context)
+ if not account_ids:
names=map(lambda i : i.strip(),name.split('/'))
for i in range(len(names)):
dom=[('name', operator, names[i])]
if i>0:
- dom+=[('id','child_of',account)]
- account = self.search(cr, uid, dom, limit=limit, context=context)
- newacc = account
+ dom+=[('id','child_of',account_ids)]
+ account_ids = self.search(cr, uid, dom, limit=limit, context=context)
+ newacc = account_ids
while newacc:
newacc = self.search(cr, uid, [('parent_id', 'in', newacc)], limit=limit, context=context)
- account += newacc
+ account_ids += newacc
if args:
- account = self.search(cr, uid, [('id', 'in', account)] + args, limit=limit, context=context)
+ account_ids = self.search(cr, uid, [('id', 'in', account_ids)] + args, limit=limit, context=context)
else:
- account = self.search(cr, uid, args, limit=limit, context=context)
- return self.name_get(cr, uid, account, context=context)
+ account_ids = self.search(cr, uid, args, limit=limit, context=context)
+ return self.name_get(cr, uid, account_ids, context=context)
def create(self, cr, uid, vals, context=None):
contract = super(account_analytic_account, self).create(cr, uid, vals, context=context)
diff --git a/addons/crm_claim/i18n/ru.po b/addons/crm_claim/i18n/ru.po
index 88435961627..cea6d33e47d 100644
--- a/addons/crm_claim/i18n/ru.po
+++ b/addons/crm_claim/i18n/ru.po
@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2012-02-08 00:36+0000\n"
-"PO-Revision-Date: 2011-03-16 00:04+0000\n"
-"Last-Translator: FULL NAME \n"
+"PO-Revision-Date: 2012-10-24 04:51+0000\n"
+"Last-Translator: Chertykov Denis \n"
"Language-Team: Russian \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-10-19 05:33+0000\n"
-"X-Generator: Launchpad (build 16165)\n"
+"X-Launchpad-Export-Date: 2012-10-24 04:55+0000\n"
+"X-Generator: Launchpad (build 16179)\n"
#. module: crm_claim
#: field:crm.claim.report,nbr:0
@@ -85,12 +85,12 @@ msgstr ""
#: code:addons/crm_claim/crm_claim.py:132
#, python-format
msgid "The claim '%s' has been opened."
-msgstr ""
+msgstr "Претензия '%s' была открыта"
#. module: crm_claim
#: view:crm.claim:0
msgid "Date Closed"
-msgstr ""
+msgstr "Дата закрытия"
#. module: crm_claim
#: view:crm.claim.report:0
@@ -151,12 +151,12 @@ msgstr "Ссылка"
#. module: crm_claim
#: view:crm.claim.report:0
msgid "Date of claim"
-msgstr ""
+msgstr "Дата претензии"
#. module: crm_claim
#: view:crm.claim:0
msgid "All pending Claims"
-msgstr ""
+msgstr "Все ожидающие претензии"
#. module: crm_claim
#: view:crm.claim.report:0
@@ -187,7 +187,7 @@ msgstr "Контрагент"
#. module: crm_claim
#: view:crm.claim.report:0
msgid "Month of claim"
-msgstr ""
+msgstr "Месяц претензии"
#. module: crm_claim
#: selection:crm.claim,type_action:0
@@ -227,7 +227,7 @@ msgstr "Отправить новое эл. письмо"
#: selection:crm.claim,state:0
#: view:crm.claim.report:0
msgid "New"
-msgstr ""
+msgstr "Новый"
#. module: crm_claim
#: view:crm.claim:0
@@ -254,7 +254,7 @@ msgstr "Следующее действие"
#. module: crm_claim
#: view:crm.claim.report:0
msgid "My Sales Team(s)"
-msgstr ""
+msgstr "Мои отделы продаж"
#. module: crm_claim
#: model:crm.case.stage,name:crm_claim.stage_claim3
@@ -321,7 +321,7 @@ msgstr "Контакт"
#. module: crm_claim
#: view:crm.claim.report:0
msgid "Month-1"
-msgstr ""
+msgstr "Месяц-1"
#. module: crm_claim
#: model:ir.actions.act_window,name:crm_claim.action_report_crm_claim
@@ -380,7 +380,7 @@ msgstr "Дата изменения"
#. module: crm_claim
#: view:crm.claim.report:0
msgid "Year of claim"
-msgstr ""
+msgstr "Год претензи"
#. module: crm_claim
#: view:crm.claim.report:0
@@ -402,7 +402,7 @@ msgstr "Значение претензии"
#. module: crm_claim
#: view:crm.claim:0
msgid "Responsible User"
-msgstr ""
+msgstr "Ответственный пользователь"
#. module: crm_claim
#: help:crm.claim,email_cc:0
diff --git a/addons/l10n_be/l10n_be_wizard.yml b/addons/l10n_be/l10n_be_wizard.yml
index 178009be7ff..0b16827225f 100644
--- a/addons/l10n_be/l10n_be_wizard.yml
+++ b/addons/l10n_be/l10n_be_wizard.yml
@@ -1,10 +1,6 @@
--
- !record {model: ir.actions.todo, id: config_call_account_template}:
- action_id: account.action_wizard_multi_chart
- type: automatic
-
!python {model: ir.actions.todo}: |
- install_todo = self.browse(cr, uid, ref('l10n_be.config_call_account_template'))
+ install_todo = self.browse(cr, uid, ref('account.action_wizard_multi_chart_todo'))
if install_todo.state == 'open':
wiz = self.pool.get('wizard.multi.charts.accounts')
values = {
diff --git a/addons/l10n_mx/i18n/es_MX.po b/addons/l10n_mx/i18n/es_MX.po
index eec525b5f53..305ec408af2 100644
--- a/addons/l10n_mx/i18n/es_MX.po
+++ b/addons/l10n_mx/i18n/es_MX.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: 2012-10-23 04:48+0000\n"
+"X-Launchpad-Export-Date: 2012-10-24 04:55+0000\n"
"X-Generator: Launchpad (build 16179)\n"
#. module: l10n_mx
diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml
index 9d1ae9eae8a..9e35377986a 100644
--- a/addons/mrp/mrp_view.xml
+++ b/addons/mrp/mrp_view.xml
@@ -668,7 +668,7 @@
-
+
diff --git a/addons/resource/i18n/ru.po b/addons/resource/i18n/ru.po
index 7a7f5e82dbd..a5192a83647 100644
--- a/addons/resource/i18n/ru.po
+++ b/addons/resource/i18n/ru.po
@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2012-02-08 00:37+0000\n"
-"PO-Revision-Date: 2012-05-10 18:26+0000\n"
+"PO-Revision-Date: 2012-10-23 18:55+0000\n"
"Last-Translator: Chertykov Denis \n"
"Language-Team: Russian \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2012-10-19 05:30+0000\n"
-"X-Generator: Launchpad (build 16165)\n"
+"X-Launchpad-Export-Date: 2012-10-24 04:55+0000\n"
+"X-Generator: Launchpad (build 16179)\n"
#. module: resource
#: help:resource.calendar.leaves,resource_id:0
@@ -107,7 +107,7 @@ msgstr "Рабочее время начнется с"
#. module: resource
#: constraint:resource.calendar.leaves:0
msgid "Error! leave start-date must be lower then leave end-date."
-msgstr ""
+msgstr "Ошибка! Дата начала отгула должна быть раньше даты завершения."
#. module: resource
#: model:ir.model,name:resource.model_resource_calendar
@@ -324,7 +324,7 @@ msgstr "(отпуск)"
#: code:addons/resource/resource.py:392
#, python-format
msgid "Configuration Error!"
-msgstr ""
+msgstr "Ошибка конфигурации!"
#. module: resource
#: selection:resource.resource,resource_type:0
diff --git a/addons/sale/i18n/ru.po b/addons/sale/i18n/ru.po
index b689b1b1946..a67f7c78b4c 100644
--- a/addons/sale/i18n/ru.po
+++ b/addons/sale/i18n/ru.po
@@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-09-20 07:29+0000\n"
-"PO-Revision-Date: 2012-09-10 14:56+0000\n"
+"PO-Revision-Date: 2012-10-23 18:53+0000\n"
"Last-Translator: Chertykov Denis \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: 2012-10-19 05:12+0000\n"
-"X-Generator: Launchpad (build 16165)\n"
+"X-Launchpad-Export-Date: 2012-10-24 04:55+0000\n"
+"X-Generator: Launchpad (build 16179)\n"
#. module: sale
#: code:addons/sale/wizard/sale_make_invoice_advance.py:215
@@ -235,7 +235,7 @@ msgstr "В счет"
#: view:sale.order.line:0
#: field:sale.report,product_uom:0
msgid "Unit of Measure"
-msgstr ""
+msgstr "Единицы измерения"
#. module: sale
#: help:sale.order,date_confirm:0
@@ -264,7 +264,7 @@ msgstr ""
#. module: sale
#: selection:sale.advance.payment.inv,advance_payment_method:0
msgid "Invoice the whole sale order"
-msgstr ""
+msgstr "Выставить счет на весь заказ продажи"
#. module: sale
#: field:sale.order,project_id:0
@@ -304,12 +304,12 @@ msgstr "Исключение счета"
#. module: sale
#: view:account.config.settings:0
msgid "0"
-msgstr ""
+msgstr "0"
#. module: sale
#: selection:sale.order,state:0
msgid "Draft Quotation"
-msgstr ""
+msgstr "Черновик предложения"
#. module: sale
#: code:addons/sale/wizard/sale_make_invoice_advance.py:124
@@ -359,23 +359,23 @@ msgstr "Вес"
#. module: sale
#: view:sale.config.settings:0
msgid "Warehouse Features"
-msgstr ""
+msgstr "Особенности склада"
#. module: sale
#: view:sale.order:0
msgid "Quotation "
-msgstr ""
+msgstr "Предложение "
#. module: sale
#: field:sale.order.line,product_uom:0
msgid "Unit of Measure "
-msgstr ""
+msgstr "Единица измерения "
#. module: sale
#: code:addons/sale/wizard/sale_make_invoice_advance.py:148
#, python-format
msgid "Incorrect Data"
-msgstr ""
+msgstr "Неверные данные"
#. module: sale
#: code:addons/sale/wizard/sale_make_invoice_advance.py:149
@@ -401,7 +401,7 @@ msgstr "Заказ"
#. module: sale
#: field:sale.order,message_ids:0
msgid "Messages"
-msgstr ""
+msgstr "Сообщения"
#. module: sale
#: selection:sale.report,month:0
@@ -422,7 +422,7 @@ msgstr "Сумма до налогов"
#. module: sale
#: field:sale.config.settings,module_project:0
msgid "Project"
-msgstr ""
+msgstr "Проект"
#. module: sale
#: code:addons/sale/sale.py:319
@@ -433,7 +433,7 @@ msgstr ""
#: code:addons/sale/wizard/sale_make_invoice_advance.py:123
#, python-format
msgid "Error!"
-msgstr ""
+msgstr "Ошибка!"
#. module: sale
#: report:sale.order:0
@@ -467,7 +467,7 @@ msgstr "Позиции заказа продаж относящиеся к мо
#. module: sale
#: selection:sale.order,state:0
msgid "Quotation Sent"
-msgstr ""
+msgstr "Предложение отправлено"
#. module: sale
#: help:sale.order,message_unread:0
@@ -528,12 +528,12 @@ msgstr "Налог"
#: code:addons/sale/sale.py:986
#, python-format
msgid "Invalid Action!"
-msgstr ""
+msgstr "Неверное действие!"
#. module: sale
#: view:sale.report:0
msgid "Reference Unit of Measure"
-msgstr ""
+msgstr "Базовая единица измерения"
#. module: sale
#: field:sale.report,date_confirm:0
@@ -572,7 +572,7 @@ msgstr "Факс :"
#. module: sale
#: view:sale.order:0
msgid "(update)"
-msgstr ""
+msgstr "(обновление)"
#. module: sale
#: help:sale.config.settings,group_discount_per_so_line:0
@@ -635,7 +635,7 @@ msgstr "Подтвердить"
#. module: sale
#: view:sale.order:0
msgid "Unread messages"
-msgstr ""
+msgstr "Непрочитанные сообщения"
#. module: sale
#: field:sale.order,partner_shipping_id:0
@@ -673,12 +673,12 @@ msgstr "Заказы продаж, которые еще не были подт
#. module: sale
#: field:sale.order,message_unread:0
msgid "Unread Messages"
-msgstr ""
+msgstr "Непрочитанные сообщения"
#. module: sale
#: view:sale.order:0
msgid "Print"
-msgstr ""
+msgstr "Печать"
#. module: sale
#: report:sale.order:0
@@ -793,12 +793,12 @@ msgstr "Год заказа в заказе продаж"
#. module: sale
#: field:sale.config.settings,module_sale_stock:0
msgid "Sale and Warehouse Management"
-msgstr ""
+msgstr "Управление продажами и складом"
#. module: sale
#: model:ir.model,name:sale.model_sale_config_settings
msgid "sale.config.settings"
-msgstr ""
+msgstr "sale.config.settings"
#. module: sale
#: field:sale.advance.payment.inv,qtty:0
@@ -842,7 +842,7 @@ msgstr ""
#. module: sale
#: view:sale.config.settings:0
msgid "Default Options"
-msgstr ""
+msgstr "Параметры по умолчанию"
#. module: sale
#: code:addons/sale/sale.py:963
@@ -850,12 +850,12 @@ msgstr ""
#: code:addons/sale/wizard/sale_make_invoice_advance.py:142
#, python-format
msgid "Configuration Error!"
-msgstr ""
+msgstr "Ошибка конфигурации!"
#. module: sale
#: field:account.config.settings,group_analytic_account_for_sales:0
msgid "Analytic accounting for sales"
-msgstr ""
+msgstr "Аналитический учет для продаж"
#. module: sale
#: view:sale.order:0
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index d01140092d4..b57f778a5cc 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -77,6 +77,7 @@ class survey(osv.osv):
'tot_comp_survey': lambda * a: 0,
'send_response': lambda * a: 1,
'response_user': lambda * a:1,
+ 'date_open': fields.datetime.now,
}
def survey_open(self, cr, uid, ids, arg):
@@ -151,8 +152,7 @@ class survey(osv.osv):
pages = sur['page_ids']
if not pages:
raise osv.except_osv(_('Warning!'), _('This survey has no question defined. Please define the questions and answers first.'))
- else:
- context.update({'active':False,'survey_id': ids[0]})
+ context.update({'active':False,'survey_id': ids[0]})
return {
'view_type': 'form',
'view_mode': 'form',
@@ -163,9 +163,12 @@ class survey(osv.osv):
'context': context
}
def test_survey(self, cr, uid, ids, context=None):
- sur_obj = self.read(cr, uid, ids,['title'], context=context)
+ sur_obj = self.read(cr, uid, ids,['title','page_ids'], context=context)
for sur in sur_obj:
name = sur['title']
+ pages = sur['page_ids']
+ if not pages:
+ raise osv.except_osv(_('Warning!'), _('This survey has no pages defined. Please define pages first.'))
context.update({'active':True,'survey_id': ids[0]})
return {
'view_type': 'form',
diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml
index 0247a205700..c01e8b45ce2 100644
--- a/addons/survey/survey_view.xml
+++ b/addons/survey/survey_view.xml
@@ -38,24 +38,24 @@
-
+
-
-
-
+
+
+
-
-
+
+
-
+
-
+
diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py
index 8ece1e184cf..f1a96fa154a 100644
--- a/addons/survey/wizard/survey_answer.py
+++ b/addons/survey/wizard/survey_answer.py
@@ -134,6 +134,8 @@ class survey_question_wiz(osv.osv_memory):
page_number += 1
if sur_name_rec.page_no > - 1:
pre_button = True
+ else:
+ flag = True
else:
if sur_name_rec.page_no != 0:
p_id = p_id[sur_name_rec.page_no - 1]
@@ -146,7 +148,15 @@ class survey_question_wiz(osv.osv_memory):
pre_button = True
if flag:
pag_rec = page_obj.browse(cr, uid, p_id, context=context)
- xml_form = etree.Element('form', {'string': tools.ustr(pag_rec.title or sur_rec.title)})
+ note = False
+ question_ids = []
+ if pag_rec:
+ title = pag_rec.title
+ note = pag_rec.note
+ question_ids = pag_rec.question_ids
+ else:
+ title = sur_rec.title
+ xml_form = etree.Element('form', {'string': tools.ustr(title)})
if context.has_key('active') and context.get('active',False) and context.has_key('edit'):
context.update({'page_id' : tools.ustr(p_id),'page_number' : sur_name_rec.page_no , 'transfer' : sur_name_read.transfer})
xml_group3 = etree.SubElement(xml_form, 'group', {'col': '4', 'colspan': '4'})
@@ -174,10 +184,10 @@ class survey_question_wiz(osv.osv_memory):
fields["wizardid_" + str(wiz_id)] = {'type':'char', 'size' : 255, 'string':"", 'views':{}}
etree.SubElement(xml_form, 'field', {'invisible':'1','name': "wizardid_" + str(wiz_id),'default':str(lambda *a: 0),'modifiers':'{"invisible":true}'})
- if pag_rec.note:
- for que_test in pag_rec.note.split('\n'):
+ if note:
+ for que_test in note.split('\n'):
etree.SubElement(xml_form, 'label', {'string': to_xml(tools.ustr(que_test)), 'align':"0.0"})
- que_ids = pag_rec.question_ids
+ que_ids = question_ids
qu_no = 0
for que in que_ids:
@@ -429,13 +439,13 @@ class survey_question_wiz(osv.osv_memory):
vals['attachment_ids'] = [(0,0,{'name': a_name,
'datas_fname': a_name,
'datas': str(a_content).encode('base64')})
- for a_name, a_content in attachments]
+ for a_name, a_content in attachments.items()]
self.pool.get('mail.mail').create(cr, uid, vals, context=context)
xml_form = etree.Element('form', {'string': _('Complete Survey Answer')})
xml_footer = etree.SubElement(xml_form, 'footer', {'col': '6', 'colspan': '4' ,'class': 'oe_survey_title_height'})
- etree.SubElement(xml_form, 'separator', {'string': 'Complete Survey', 'colspan': "4"})
+ etree.SubElement(xml_form, 'separator', {'string': 'Survey Completed', 'colspan': "4"})
etree.SubElement(xml_form, 'label', {'string': 'Thanks for your Answer'})
etree.SubElement(xml_form, 'newline')
etree.SubElement(xml_footer, 'button', {'special':"cancel",'string':"OK",'colspan':"2",'class':'oe_highlight'})
diff --git a/addons/survey/wizard/survey_send_invitation.py b/addons/survey/wizard/survey_send_invitation.py
index 5677a985e09..936e3363bde 100644
--- a/addons/survey/wizard/survey_send_invitation.py
+++ b/addons/survey/wizard/survey_send_invitation.py
@@ -50,9 +50,6 @@ class survey_send_invitation(osv.osv_memory):
_defaults = {
'send_mail': lambda *a: 1,
'send_mail_existing': lambda *a: 1,
- 'mail_subject': lambda *a: "Invitation",
- 'mail_subject_existing': lambda *a: "Invitation",
- 'mail_from': lambda *a: tools.config['email_from']
}
def genpasswd(self):
@@ -67,14 +64,23 @@ class survey_send_invitation(osv.osv_memory):
msg = ""
name = ""
for sur in survey_obj.browse(cr, uid, context.get('active_ids', []), context=context):
- name += "\t --> " + sur.title + "\n"
+ name += "\n --> " + sur.title + "\n"
if sur.state != 'open':
msg += sur.title + "\n"
+ data['mail_subject'] = _("Invitation for %s") % (sur.title)
+ data['mail_subject_existing'] = _("Invitation for %s") % (sur.title)
+ data['mail_from'] = sur.responsible_id.email
if msg:
- raise osv.except_osv(_('Warning!'), _('%sSurvey is not in open state') % msg)
- data['mail'] = '''Hello %(name)s, \n\n We are inviting you for following survey. \
- \n ''' + name + '''\n Your login ID: %(login)s, Your password: %(passwd)s
- \n link :- http://'''+ str(socket.gethostname()) + ''':8080 \n\n Thanks,'''
+ raise osv.except_osv(_('Warning!'), _('The following surveys are not in open state: %s') % msg)
+ data['mail'] = _('''
+Hello %%(name)s, \n\n
+Would you please spent some of your time to fill-in our survey: \n%s\n
+You can access this survey with the following parameters:
+ URL: %s
+ Your login ID: %%(login)s\n
+ Your password: %%(passwd)s\n
+\n\n
+Thanks,''') % (name, self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='http://localhost:8069', context=context))
return data
def create_report(self, cr, uid, res_ids, report_name=False, file_name=False):
@@ -176,7 +182,7 @@ class survey_send_invitation(osv.osv_memory):
vals['attachment_ids'] = [(0,0,{'name': a_name,
'datas_fname': a_name,
'datas': str(a_content).encode('base64')})
- for a_name, a_content in attachments]
+ for a_name, a_content in attachments.items()]
ans = self.pool.get('mail.mail').create(cr, uid, vals, context=context)
if ans:
res_data = {'name': partner.name or _('Unknown'),
diff --git a/addons/survey/wizard/survey_send_invitation.xml b/addons/survey/wizard/survey_send_invitation.xml
index 340cb58b5cf..a611973d772 100644
--- a/addons/survey/wizard/survey_send_invitation.xml
+++ b/addons/survey/wizard/survey_send_invitation.xml
@@ -16,7 +16,7 @@
-
+