diff --git a/addons/account_check_writing/i18n/ru.po b/addons/account_check_writing/i18n/ru.po index ba474c72a22..8e68dd7152a 100644 --- a/addons/account_check_writing/i18n/ru.po +++ b/addons/account_check_writing/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-12-21 17:05+0000\n" -"PO-Revision-Date: 2012-12-11 13:00+0000\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2013-06-03 07:47+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: 2013-03-16 05:51+0000\n" -"X-Generator: Launchpad (build 16532)\n" +"X-Launchpad-Export-Date: 2013-06-04 05:20+0000\n" +"X-Generator: Launchpad (build 16660)\n" #. module: account_check_writing #: selection:res.company,check_layout:0 @@ -25,13 +25,13 @@ msgstr "" #. module: account_check_writing #: report:account.print.check.top:0 msgid "Open Balance" -msgstr "" +msgstr "Открытый баланс" #. module: account_check_writing #: view:account.check.write:0 #: view:account.voucher:0 msgid "Print Check" -msgstr "" +msgstr "Напечатать чек" #. module: account_check_writing #: selection:res.company,check_layout:0 @@ -82,7 +82,7 @@ msgstr "Описание" #. module: account_check_writing #: model:ir.model,name:account_check_writing.model_account_journal msgid "Journal" -msgstr "" +msgstr "Журнал" #. module: account_check_writing #: model:ir.actions.act_window,name:account_check_writing.action_write_check @@ -95,14 +95,14 @@ msgstr "" #: report:account.print.check.middle:0 #: report:account.print.check.top:0 msgid "Discount" -msgstr "" +msgstr "Скидка" #. module: account_check_writing #: report:account.print.check.bottom:0 #: report:account.print.check.middle:0 #: report:account.print.check.top:0 msgid "Original Amount" -msgstr "" +msgstr "Первоначальная сумма" #. module: account_check_writing #: field:res.company,check_layout:0 @@ -119,7 +119,7 @@ msgstr "" #: report:account.print.check.middle:0 #: report:account.print.check.top:0 msgid "Payment" -msgstr "" +msgstr "Платеж" #. module: account_check_writing #: field:account.journal,use_preprint_check:0 @@ -153,7 +153,7 @@ msgstr "" #: report:account.print.check.middle:0 #: report:account.print.check.top:0 msgid "Due Date" -msgstr "" +msgstr "Дата исполнения" #. module: account_check_writing #: model:ir.actions.report.xml,name:account_check_writing.account_print_check_middle @@ -163,13 +163,13 @@ msgstr "" #. module: account_check_writing #: model:ir.model,name:account_check_writing.model_res_company msgid "Companies" -msgstr "" +msgstr "Компании" #. module: account_check_writing #: code:addons/account_check_writing/wizard/account_check_batch_printing.py:59 #, python-format msgid "Error!" -msgstr "" +msgstr "Ошибка!" #. module: account_check_writing #: help:account.check.write,check_number:0 @@ -202,12 +202,12 @@ msgstr "" #. module: account_check_writing #: view:account.check.write:0 msgid "or" -msgstr "" +msgstr "или" #. module: account_check_writing #: field:account.voucher,amount_in_word:0 msgid "Amount in Word" -msgstr "" +msgstr "Сумма прописью" #. module: account_check_writing #: model:ir.model,name:account_check_writing.model_account_check_write @@ -217,7 +217,7 @@ msgstr "" #. module: account_check_writing #: view:account.check.write:0 msgid "Cancel" -msgstr "" +msgstr "Отмена" #. module: account_check_writing #: field:account.check.write,check_number:0 diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index f4a985280ac..ad28bbb1d57 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -23,6 +23,7 @@ import random from urllib import urlencode from urlparse import urljoin +from openerp.addons.base.ir.ir_mail_server import MailDeliveryException from openerp.osv import osv, fields from openerp.tools.misc import DEFAULT_SERVER_DATETIME_FORMAT from openerp.tools.safe_eval import safe_eval @@ -103,6 +104,9 @@ class res_partner(osv.Model): def action_signup_prepare(self, cr, uid, ids, context=None): return self.signup_prepare(cr, uid, ids, context=context) + def signup_cancel(self, cr, uid, ids, context=None): + return self.write(cr, uid, ids, {'signup_token': False, 'signup_type': False, 'signup_expiration': False}, context=context) + def signup_prepare(self, cr, uid, ids, signup_type="signup", expiration=False, context=None): """ generate a new token for the partners with the given validity, if necessary :param expiration: the expiration datetime of the token (string, optional) @@ -202,7 +206,7 @@ class res_users(osv.Model): }) if partner.company_id: values['company_id'] = partner.company_id.id - values['company_ids'] = [(6,0,[partner.company_id.id])] + values['company_ids'] = [(6, 0, [partner.company_id.id])] self._signup_create_user(cr, uid, values, context=context) else: # no token, sign up an external user @@ -259,25 +263,26 @@ class res_users(osv.Model): pass if not bool(template): template = self.pool.get('ir.model.data').get_object(cr, uid, 'auth_signup', 'reset_password_email') - mail_obj = self.pool.get('mail.mail') assert template._name == 'email.template' for user in self.browse(cr, uid, ids, context): if not user.email: raise osv.except_osv(_("Cannot send email: user has no email address."), user.name) - mail_id = self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, True, context=context) - mail_state = mail_obj.read(cr, uid, mail_id, ['state'], context=context) - - if mail_state and mail_state['state'] == 'exception': - raise self.pool.get('res.config.settings').get_config_warning(cr, _("Cannot send email: no outgoing email server configured.\nYou can configure it under %(menu:base_setup.menu_general_configuration)s."), context) - else: - return True + try: + self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, force_send=True, raise_exception=True, context=context) + except Exception: + raise def create(self, cr, uid, values, context=None): + if context is None: + context = {} # overridden to automatically invite user to sign up user_id = super(res_users, self).create(cr, uid, values, context=context) user = self.browse(cr, uid, user_id, context=context) - if context and context.get('reset_password') and user.email: - ctx = dict(context, create_user=True) - self.action_reset_password(cr, uid, [user.id], context=ctx) + if user.email and not context.get('no_reset_password'): + context.update({'create_user': True}) + try: + self.action_reset_password(cr, uid, [user.id], context=context) + except MailDeliveryException: + self.pool.get('res.partner').signup_cancel(cr, uid, [user.partner_id.id], context=context) return user_id diff --git a/addons/auth_signup/res_users_view.xml b/addons/auth_signup/res_users_view.xml index 28f66eb101d..60c419db737 100644 --- a/addons/auth_signup/res_users_view.xml +++ b/addons/auth_signup/res_users_view.xml @@ -31,9 +31,11 @@