[FIX] minor fixes

This commit is contained in:
Lorenzo Battistini
2012-12-28 14:58:36 +01:00
parent 585c7cfb46
commit 623c63ed37
3 changed files with 16 additions and 9 deletions

View File

@@ -20,8 +20,8 @@
# #
############################################################################## ##############################################################################
from osv import fields, osv from openerp.osv import fields, osv
from tools.translate import _ from openerp.tools.translate import _
import re import re
class account_document_template(osv.osv): class account_document_template(osv.osv):

View File

@@ -20,8 +20,8 @@
# #
############################################################################## ##############################################################################
from osv import fields, osv from openerp.osv import fields, osv
from tools.translate import _ from openerp.tools.translate import _
class account_move_template(osv.osv): class account_move_template(osv.osv):
@@ -55,7 +55,10 @@ class account_move_template(osv.osv):
else: else:
return len(journal_ids)==1 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() account_move_template()

View File

@@ -20,9 +20,9 @@
# #
############################################################################## ##############################################################################
from osv import fields,osv from openerp.osv import fields,osv
import time import time
from tools.translate import _ from openerp.tools.translate import _
class wizard_select_template(osv.osv_memory): class wizard_select_template(osv.osv_memory):
@@ -132,7 +132,9 @@ class wizard_select_template(osv.osv_memory):
analytic_account_id = False analytic_account_id = False
if line.analytic_account_id: if line.analytic_account_id:
if not line.journal_id.analytic_journal_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 analytic_account_id = line.analytic_account_id.id
val = { val = {
'name': line.name, 'name': line.name,
@@ -160,7 +162,9 @@ class wizard_select_template(osv.osv_memory):
analytic_account_id = False analytic_account_id = False
if line.analytic_account_id: if line.analytic_account_id:
if not line.journal_id.analytic_journal_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 analytic_account_id = line.analytic_account_id.id
val = { val = {
'name': 'transitory', 'name': 'transitory',