2
0

minor fixes

This commit is contained in:
Lorenzo Battistini 2012-12-28 14:58:36 +01:00 committed by Abraham Anes
parent dff02a5a5e
commit 805a57c392
3 changed files with 16 additions and 9 deletions

View File

@ -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):

View File

@ -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()

View File

@ -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',