From 805a57c392a0b01e8c1ffd44076dea07f61fd23b Mon Sep 17 00:00:00 2001 From: Lorenzo Battistini Date: Fri, 28 Dec 2012 14:58:36 +0100 Subject: [PATCH] minor fixes --- account_move_template/account_document_template.py | 4 ++-- account_move_template/account_move_template.py | 9 ++++++--- account_move_template/wizard/select_template.py | 12 ++++++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/account_move_template/account_document_template.py b/account_move_template/account_document_template.py index 0a035ed7..cdbfe18b 100644 --- a/account_move_template/account_document_template.py +++ b/account_move_template/account_document_template.py @@ -20,8 +20,8 @@ # ############################################################################## -from osv import fields, osv -from tools.translate import _ +from openerp.osv import fields, osv +from openerp.tools.translate import _ import re class account_document_template(osv.osv): diff --git a/account_move_template/account_move_template.py b/account_move_template/account_move_template.py index fff164f9..9722c7a7 100644 --- a/account_move_template/account_move_template.py +++ b/account_move_template/account_move_template.py @@ -20,8 +20,8 @@ # ############################################################################## -from osv import fields, osv -from tools.translate import _ +from openerp.osv import fields, osv +from openerp.tools.translate import _ class account_move_template(osv.osv): @@ -55,7 +55,10 @@ class account_move_template(osv.osv): else: return len(journal_ids)==1 - _constraints = [(_check_different_journal,'If the template is "cross-journals", the Journals must be different, if the template does not "cross-journals" the Journals must be the same!',['journal_id'])] + _constraints = [(_check_different_journal, + 'If the template is "cross-journals", the Journals must be different,' \ + 'if the template does not "cross-journals" the Journals must be the same!', + ['journal_id'])] account_move_template() diff --git a/account_move_template/wizard/select_template.py b/account_move_template/wizard/select_template.py index 3e03671b..792b7953 100644 --- a/account_move_template/wizard/select_template.py +++ b/account_move_template/wizard/select_template.py @@ -20,9 +20,9 @@ # ############################################################################## -from osv import fields,osv +from openerp.osv import fields,osv import time -from tools.translate import _ +from openerp.tools.translate import _ class wizard_select_template(osv.osv_memory): @@ -132,7 +132,9 @@ class wizard_select_template(osv.osv_memory): analytic_account_id = False if line.analytic_account_id: if not line.journal_id.analytic_journal_id: - raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (line.journal_id.name,)) + raise osv.except_osv(_('No Analytic Journal !'), + _("You have to define an analytic journal on the '%s' journal!") + % (line.journal_id.name,)) analytic_account_id = line.analytic_account_id.id val = { 'name': line.name, @@ -160,7 +162,9 @@ class wizard_select_template(osv.osv_memory): analytic_account_id = False if line.analytic_account_id: if not line.journal_id.analytic_journal_id: - raise osv.except_osv(_('No Analytic Journal !'),_("You have to define an analytic journal on the '%s' journal!") % (wizard.template_id.journal_id.name,)) + raise osv.except_osv(_('No Analytic Journal !'), + _("You have to define an analytic journal on the '%s' journal!") + % (wizard.template_id.journal_id.name,)) analytic_account_id = line.analytic_account_id.id val = { 'name': 'transitory',