[IMP]Account : Changes in Warning Message

bzr revid: hsa@tinyerp.com-20120711084821-4reozitt3vgo9u31
This commit is contained in:
Hardik 2012-07-11 14:18:21 +05:30
parent 6cbb04758a
commit 3fadbdcfc0
5 changed files with 19 additions and 19 deletions

View File

@ -624,7 +624,7 @@ class account_account(osv.osv):
value = 'account.account,' + str(ids[0])
partner_prop_acc = self.pool.get('ir.property').search(cr, uid, [('value_reference','=',value)], context=context)
if partner_prop_acc:
raise osv.except_osv(_('Warning !'), _('You can not remove/desactivate an account which is set on a customer or supplier.'))
raise osv.except_osv(_('Warning !'), _('You cannot remove/deactivate an account which is set on a customer or supplier.'))
return True
def _check_allow_type_change(self, cr, uid, ids, new_type, context=None):
@ -907,7 +907,7 @@ class account_fiscalyear(osv.osv):
return True
_constraints = [
(_check_duration, 'Error! The start date of the fiscal year must be before his end date.', ['date_start','date_stop'])
(_check_duration, 'Error! The start date of the fiscal year must be less than the end date.', ['date_start','date_stop'])
]
def create_period3(self, cr, uid, ids, context=None):
@ -1025,7 +1025,7 @@ class account_period(osv.osv):
_constraints = [
(_check_duration, 'Error ! The duration of the Period(s) is/are invalid. ', ['date_stop']),
(_check_year_limit, 'Invalid period ! Some periods overlap or the date period is not in the scope of the fiscal year. ', ['date_stop'])
(_check_year_limit, 'Invalid period ! Some periods overlap or the date period which is not in the scope of the fiscal year. ', ['date_stop'])
]
def next(self, cr, uid, period, step, context=None):
@ -1072,7 +1072,7 @@ class account_period(osv.osv):
if 'company_id' in vals:
move_lines = self.pool.get('account.move.line').search(cr, uid, [('period_id', 'in', ids)])
if move_lines:
raise osv.except_osv(_('Warning !'), _('You can not modify company of this period as some journal items exists.'))
raise osv.except_osv(_('Warning !'), _('You cannot modify company of this period as some journal items exist.'))
return super(account_period, self).write(cr, uid, ids, vals, context=context)
def build_ctx_periods(self, cr, uid, period_from_id, period_to_id):
@ -1085,9 +1085,9 @@ class account_period(osv.osv):
period_date_stop = period_to.date_stop
company2_id = period_to.company_id.id
if company1_id != company2_id:
raise osv.except_osv(_('Error'), _('You should have chosen periods that belongs to the same company'))
raise osv.except_osv(_('Error'), _('You should choose the periods that belong to the same company.'))
if period_date_start > period_date_stop:
raise osv.except_osv(_('Error'), _('Start period should be smaller then End period'))
raise osv.except_osv(_('Error'), _('Start period should be smaller than End period.'))
#for period from = january, we want to exclude the opening period (but it has same date_from, so we have to check if period_from is special or not to include that clause or not in the search).
if period_from.special:
return self.search(cr, uid, [('date_start', '>=', period_date_start), ('date_stop', '<=', period_date_stop), ('company_id', '=', company1_id)])
@ -1569,11 +1569,11 @@ class account_move(osv.osv):
if not company_id:
company_id = line.account_id.company_id.id
if not company_id == line.account_id.company_id.id:
raise osv.except_osv(_('Error'), _("Couldn't create move between different companies"))
raise osv.except_osv(_('Error'), _("Cannot create moves for different companies"))
if line.account_id.currency_id and line.currency_id:
if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id):
raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""") % (line.account_id.code, line.account_id.name))
raise osv.except_osv(_('Error'), _("""Cannot create move with currency different from ..""") % (line.account_id.code, line.account_id.name))
if abs(amount) < 10 ** -4:
# If the move is balanced
@ -2494,7 +2494,7 @@ class account_account_template(osv.osv):
_check_recursion = check_cycle
_constraints = [
(_check_recursion, 'Error ! You can not create recursive account templates.', ['parent_id']),
(_check_type, 'Configuration Error!\nYou can not define children to an account with internal type different of "View"! ', ['type']),
(_check_type, 'Configuration Error!\nYou can not define children to an account that has internal type other than "View"!', ['type']),
]

View File

@ -298,7 +298,7 @@ class account_cash_statement(osv.osv):
if journal_type == 'bank':
return super(account_cash_statement, self).balance_check(cr, uid, cash_id, journal_type, context)
if not self._equal_balance(cr, uid, cash_id, context):
raise osv.except_osv(_('Error !'), _('The closing balance should be the same than the computed balance!'))
raise osv.except_osv(_('Error !'), _('The closing balance should be equal to compute balance on this cash register !'))
return True
def statement_close(self, cr, uid, ids, journal_type='bank', context=None):

View File

@ -364,7 +364,7 @@ class account_invoice(osv.osv):
except Exception, e:
if '"journal_id" viol' in e.args[0]:
raise orm.except_orm(_('Configuration Error!'),
_('There is no Accounting Journal of type Sale/Purchase defined!'))
_('No Sale/Purchase Journal(s) defined !'))
else:
raise orm.except_orm(_('Unknown Error'), str(e))
@ -554,7 +554,7 @@ class account_invoice(osv.osv):
pay_res_id = pay_line_data and pay_line_data[0].get('value_reference',False) and int(pay_line_data[0]['value_reference'].split(',')[1]) or False
if not rec_res_id and not pay_res_id:
raise osv.except_osv(_('Configuration Error !'),
_('Can not find a chart of account, you should create one from the configuration of the accounting menu.'))
_('Cannot find a chart of account, you should create one from Settings\Configuration\Accounting menu.'))
if type in ('out_invoice', 'out_refund'):
acc_id = rec_res_id
else:
@ -569,7 +569,7 @@ class account_invoice(osv.osv):
result_id = account_obj.search(cr, uid, [('name','=',line.account_id.name),('company_id','=',company_id)])
if not result_id:
raise osv.except_osv(_('Configuration Error !'),
_('Can not find a chart of account, you should create one from the configuration of the accounting menu.'))
_('Cannot find a chart of account, you should create one from Settings\Configuration\Accounting menu.'))
inv_line_obj.write(cr, uid, [line.id], {'account_id': result_id[-1]})
else:
if invoice_line:
@ -577,7 +577,7 @@ class account_invoice(osv.osv):
obj_l = account_obj.browse(cr, uid, inv_line[2]['account_id'])
if obj_l.company_id.id != company_id:
raise osv.except_osv(_('Configuration Error !'),
_('Invoice line account company does not match with invoice company.'))
_('Company of invoice line account and the company of invoice does not match.'))
else:
continue
if company_id and type:
@ -598,7 +598,7 @@ class account_invoice(osv.osv):
if r[1] == 'journal_id' and r[2] in journal_ids:
val['journal_id'] = r[2]
if not val.get('journal_id', False):
raise osv.except_osv(_('Configuration Error !'), (_('Can\'t find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Financial Accounting\Accounts\Journals.') % (journal_type)))
raise osv.except_osv(_('Configuration Error !'), (_('Cannot find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Journals\Journals.') % (journal_type)))
dom = {'journal_id': [('id', 'in', journal_ids)]}
else:
journal_ids = obj_journal.search(cr, uid, [])
@ -1475,7 +1475,7 @@ class account_invoice_line(osv.osv):
if prod.uom_id.category_id.id != prod_uom.category_id.id:
warning = {
'title': _('Warning!'),
'message': _('You selected an Unit of Measure which is not compatible with the product.')
'message': _('You selected a Unit of Measure which is not compatible with the Unit of Measure of the product.')
}
return {'value': res['value'], 'warning': warning}
return res

View File

@ -576,7 +576,7 @@ class account_move_line(osv.osv):
lines = self.browse(cr, uid, ids, context=context)
for l in lines:
if l.account_id.type == 'view':
raise osv.except_osv(_('Error :'), _('You can not create journal items on a "view" account %s %s') % (l.account_id.code, l.account_id.name))
raise osv.except_osv(_('Error :'), _('You cannot create journal items on “View” type account %s %s.') % (l.account_id.code, l.account_id.name))
return True
def _check_no_closed(self, cr, uid, ids, context=None):
@ -610,7 +610,7 @@ class account_move_line(osv.osv):
_constraints = [
(_check_no_view, 'You can not create journal items on an account of type view.', ['account_id']),
(_check_no_closed, 'You can not create journal items on closed account.', ['account_id']),
(_check_company_id, 'Company must be the same for its related account and period.', ['company_id']),
(_check_company_id, 'Account and Period must belong to the same company.', ['company_id']),
(_check_date, 'The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal.', ['date']),
(_check_currency, 'The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal.', ['currency_id']),
]

View File

@ -53,7 +53,7 @@ class account_aged_trial_balance(osv.osv_memory):
period_length = data['form']['period_length']
if period_length<=0:
raise osv.except_osv(_('UserError'), _('You must enter a period length that cannot be 0 or below !'))
raise osv.except_osv(_('UserError'), _('You must enter a period length greater than 0 !'))
if not data['form']['date_from']:
raise osv.except_osv(_('UserError'), _('Enter a Start date !'))