[IMP] all the error messages now start with 'Error\!' (not 'Error' or 'Error \!')

bzr revid: abo@openerp.com-20120807113137-44vehm0mthqawlo3
This commit is contained in:
Antonin Bourguignon 2012-08-07 13:31:37 +02:00
parent b0e8ae4c7d
commit 8a64e7580a
50 changed files with 114 additions and 114 deletions

View File

@ -87,7 +87,7 @@ class account_analytic_line(osv.osv):
if not a: if not a:
a = prod.categ_id.property_account_expense_categ.id a = prod.categ_id.property_account_expense_categ.id
if not a: if not a:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('There is no expense account defined ' \ _('There is no expense account defined ' \
'for this product: "%s" (id:%d).') % \ 'for this product: "%s" (id:%d).') % \
(prod.name, prod.id,)) (prod.name, prod.id,))
@ -96,7 +96,7 @@ class account_analytic_line(osv.osv):
if not a: if not a:
a = prod.categ_id.property_account_income_categ.id a = prod.categ_id.property_account_income_categ.id
if not a: if not a:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('There is no income account defined ' \ _('There is no income account defined ' \
'for this product: "%s" (id:%d).') % \ 'for this product: "%s" (id:%d).') % \
(prod.name, prod_id,)) (prod.name, prod_id,))

View File

@ -364,7 +364,7 @@ class account_bank_statement(osv.osv):
context=context).line_id], context=context).line_id],
context=context): context=context):
if line.state <> 'valid': if line.state <> 'valid':
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('Journal item "%s" is not valid.') % line.name) _('Journal item "%s" is not valid.') % line.name)
# Bank statements will not consider boolean on journal entry_posted # Bank statements will not consider boolean on journal entry_posted
@ -377,7 +377,7 @@ class account_bank_statement(osv.osv):
def balance_check(self, cr, uid, st_id, journal_type='bank', context=None): def balance_check(self, cr, uid, st_id, journal_type='bank', context=None):
st = self.browse(cr, uid, st_id, context=context) st = self.browse(cr, uid, st_id, context=context)
if not ((abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001) or (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001)): if not ((abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001) or (abs((st.balance_end or 0.0) - st.balance_end_real) < 0.0001)):
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('The statement balance is incorrect !\nThe expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end)) _('The statement balance is incorrect !\nThe expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end))
return True return True
@ -415,7 +415,7 @@ class account_bank_statement(osv.osv):
for line in st.move_line_ids: for line in st.move_line_ids:
if line.state <> 'valid': if line.state <> 'valid':
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('The account entries lines are not in valid state.')) _('The account entries lines are not in valid state.'))
for st_line in st.line_ids: for st_line in st.line_ids:
if st_line.analytic_account_id: if st_line.analytic_account_id:

View File

@ -238,7 +238,7 @@ class account_cash_statement(osv.osv):
for statement in statement_pool.browse(cr, uid, ids, context=context): for statement in statement_pool.browse(cr, uid, ids, context=context):
vals = {} vals = {}
if not self._user_allow(cr, uid, statement.id, context=context): if not self._user_allow(cr, uid, statement.id, context=context):
raise osv.except_osv(_('Error !'), (_('You do not have rights to open this %s journal !') % (statement.journal_id.name, ))) raise osv.except_osv(_('Error!'), (_('You do not have rights to open this %s journal !') % (statement.journal_id.name, )))
if statement.name and statement.name == '/': if statement.name and statement.name == '/':
c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id} c = {'fiscalyear_id': statement.period_id.fiscalyear_id.id}
@ -260,7 +260,7 @@ class account_cash_statement(osv.osv):
if journal_type == 'bank': if journal_type == 'bank':
return super(account_cash_statement, self).balance_check(cr, uid, cash_id, journal_type, context) 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): if not self._equal_balance(cr, uid, cash_id, context):
raise osv.except_osv(_('Error !'), _('The closing balance should be equal to compute balance on the cash register.')) raise osv.except_osv(_('Error!'), _('The closing balance should be equal to compute balance on the cash register.'))
return True return True
def statement_close(self, cr, uid, ids, journal_type='bank', context=None): def statement_close(self, cr, uid, ids, journal_type='bank', context=None):
@ -289,7 +289,7 @@ class account_cash_statement(osv.osv):
for item_label, item_account in TALBES: for item_label, item_account in TALBES:
if getattr(obj.journal_id, item_account): if getattr(obj.journal_id, item_account):
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('There is no %s Account on the journal %s.') % (item_label, obj.journal_id.name,)) _('There is no %s Account on the journal %s.') % (item_label, obj.journal_id.name,))
is_profit = obj.difference < 0.0 is_profit = obj.difference < 0.0

View File

@ -835,7 +835,7 @@ class account_invoice(osv.osv):
context = {} context = {}
for inv in self.browse(cr, uid, ids, context=context): for inv in self.browse(cr, uid, ids, context=context):
if not inv.journal_id.sequence_id: if not inv.journal_id.sequence_id:
raise osv.except_osv(_('Error !'), _('Please define sequence on the journal related to this invoice.')) raise osv.except_osv(_('Error!'), _('Please define sequence on the journal related to this invoice.'))
if not inv.invoice_line: if not inv.invoice_line:
raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.')) raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.'))
if inv.move_id: if inv.move_id:
@ -866,7 +866,7 @@ class account_invoice(osv.osv):
total_percent += line.value_amount total_percent += line.value_amount
total_fixed = (total_fixed * 100) / (inv.amount_total or 1.0) total_fixed = (total_fixed * 100) / (inv.amount_total or 1.0)
if (total_fixed + total_percent) > 100: if (total_fixed + total_percent) > 100:
raise osv.except_osv(_('Error !'), _("Cannot create the invoice.\nThe related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount. In order to avoid rounding issues, the latest line of your payment term must be of type 'balance'.")) raise osv.except_osv(_('Error!'), _("Cannot create the invoice.\nThe related payment term is probably misconfigured as it gives a computed amount greater than the total invoiced amount. In order to avoid rounding issues, the latest line of your payment term must be of type 'balance'."))
# one move line per tax line # one move line per tax line
iml += ait_obj.move_line_get(cr, uid, inv.id) iml += ait_obj.move_line_get(cr, uid, inv.id)
@ -1061,7 +1061,7 @@ class account_invoice(osv.osv):
pay_ids = account_move_line_obj.browse(cr, uid, i['payment_ids']) pay_ids = account_move_line_obj.browse(cr, uid, i['payment_ids'])
for move_line in pay_ids: for move_line in pay_ids:
if move_line.reconcile_partial_id and move_line.reconcile_partial_id.line_partial_ids: if move_line.reconcile_partial_id and move_line.reconcile_partial_id.line_partial_ids:
raise osv.except_osv(_('Error !'), _('You cannot cancel an invoice which is partially paid. You need to unreconcile related payment entries first.')) raise osv.except_osv(_('Error!'), _('You cannot cancel an invoice which is partially paid. You need to unreconcile related payment entries first.'))
# First, set the invoices as cancelled and detach the move ids # First, set the invoices as cancelled and detach the move ids
self.write(cr, uid, ids, {'state':'cancel', 'move_id':False}) self.write(cr, uid, ids, {'state':'cancel', 'move_id':False})

View File

@ -577,14 +577,14 @@ class account_move_line(osv.osv):
lines = self.browse(cr, uid, ids, context=context) lines = self.browse(cr, uid, ids, context=context)
for l in lines: for l in lines:
if l.account_id.type == 'view': if l.account_id.type == 'view':
raise osv.except_osv(_('Error !'), _('You cannot create journal items on “View” type 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 return True
def _check_no_closed(self, cr, uid, ids, context=None): def _check_no_closed(self, cr, uid, ids, context=None):
lines = self.browse(cr, uid, ids, context=context) lines = self.browse(cr, uid, ids, context=context)
for l in lines: for l in lines:
if l.account_id.type == 'closed': if l.account_id.type == 'closed':
raise osv.except_osv(_('Error !'), _('You cannot create journal items on a closed account %s %s.') % (l.account_id.code, l.account_id.name)) raise osv.except_osv(_('Error!'), _('You cannot create journal items on a closed account %s %s.') % (l.account_id.code, l.account_id.name))
return True return True
def _check_company_id(self, cr, uid, ids, context=None): def _check_company_id(self, cr, uid, ids, context=None):
@ -800,7 +800,7 @@ class account_move_line(osv.osv):
company_list.append(line.company_id.id) company_list.append(line.company_id.id)
for line in unrec_lines: for line in unrec_lines:
if line.state <> 'valid': if line.state <> 'valid':
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_('Entry "%s" is not valid !') % line.name) _('Entry "%s" is not valid !') % line.name)
credit += line['credit'] credit += line['credit']
debit += line['debit'] debit += line['debit']
@ -823,10 +823,10 @@ class account_move_line(osv.osv):
r = cr.fetchall() r = cr.fetchall()
#TODO: move this check to a constraint in the account_move_reconcile object #TODO: move this check to a constraint in the account_move_reconcile object
if not unrec_lines: if not unrec_lines:
raise osv.except_osv(_('Error !'), _('Entry is already reconciled.')) raise osv.except_osv(_('Error!'), _('Entry is already reconciled.'))
account = account_obj.browse(cr, uid, account_id, context=context) account = account_obj.browse(cr, uid, account_id, context=context)
if r[0][1] != None: if r[0][1] != None:
raise osv.except_osv(_('Error !'), _('Some entries are already reconciled.')) raise osv.except_osv(_('Error!'), _('Some entries are already reconciled.'))
if (not currency_obj.is_zero(cr, uid, account.company_id.currency_id, writeoff)) or \ if (not currency_obj.is_zero(cr, uid, account.company_id.currency_id, writeoff)) or \
(account.currency_id and (not currency_obj.is_zero(cr, uid, account.currency_id, currency))): (account.currency_id and (not currency_obj.is_zero(cr, uid, account.currency_id, currency))):
@ -1186,7 +1186,7 @@ class account_move_line(osv.osv):
result = cr.fetchall() result = cr.fetchall()
for (state,) in result: for (state,) in result:
if state == 'done': if state == 'done':
raise osv.except_osv(_('Error !'), _('You cannot add/modify entries in a closed journal.')) raise osv.except_osv(_('Error!'), _('You cannot add/modify entries in a closed journal.'))
if not result: if not result:
journal = journal_obj.browse(cr, uid, journal_id, context=context) journal = journal_obj.browse(cr, uid, journal_id, context=context)
period = period_obj.browse(cr, uid, period_id, context=context) period = period_obj.browse(cr, uid, period_id, context=context)
@ -1202,9 +1202,9 @@ class account_move_line(osv.osv):
for line in self.browse(cr, uid, ids, context=context): for line in self.browse(cr, uid, ids, context=context):
err_msg = _('Move name (id): %s (%s)') % (line.move_id.name, str(line.move_id.id)) err_msg = _('Move name (id): %s (%s)') % (line.move_id.name, str(line.move_id.id))
if line.move_id.state <> 'draft' and (not line.journal_id.entry_posted): if line.move_id.state <> 'draft' and (not line.journal_id.entry_posted):
raise osv.except_osv(_('Error !'), _('You cannot do this modification on a confirmed entry. You can just change some non legal fields or you must unconfirm the journal entry first.\n%s.') % err_msg) raise osv.except_osv(_('Error!'), _('You cannot do this modification on a confirmed entry. You can just change some non legal fields or you must unconfirm the journal entry first.\n%s.') % err_msg)
if line.reconcile_id: if line.reconcile_id:
raise osv.except_osv(_('Error !'), _('You cannot do this modification on a reconciled entry. You can just change some non legal fields or you must unreconcile first.\n%s.') % err_msg) raise osv.except_osv(_('Error!'), _('You cannot do this modification on a reconciled entry. You can just change some non legal fields or you must unreconcile first.\n%s.') % err_msg)
t = (line.journal_id.id, line.period_id.id) t = (line.journal_id.id, line.period_id.id)
if t not in done: if t not in done:
self._update_journal_check(cr, uid, line.journal_id.id, line.period_id.id, context) self._update_journal_check(cr, uid, line.journal_id.id, line.period_id.id, context)

View File

@ -67,7 +67,7 @@ class accounting_report(osv.osv_memory):
result['date_to'] = data['form']['date_to_cmp'] result['date_to'] = data['form']['date_to_cmp']
elif data['form']['filter_cmp'] == 'filter_period': elif data['form']['filter_cmp'] == 'filter_period':
if not data['form']['period_from_cmp'] or not data['form']['period_to_cmp']: if not data['form']['period_from_cmp'] or not data['form']['period_to_cmp']:
raise osv.except_osv(_('Error'),_('Select a starting and an ending period')) raise osv.except_osv(_('Error!'),_('Select a starting and an ending period'))
result['period_from'] = data['form']['period_from_cmp'] result['period_from'] = data['form']['period_from_cmp']
result['period_to'] = data['form']['period_to_cmp'] result['period_to'] = data['form']['period_to_cmp']
return result return result

View File

@ -106,9 +106,9 @@ class account_invoice_refund(osv.osv_memory):
journal_id = form.journal_id.id journal_id = form.journal_id.id
for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context): for inv in inv_obj.browse(cr, uid, context.get('active_ids'), context=context):
if inv.state in ['draft', 'proforma2', 'cancel']: if inv.state in ['draft', 'proforma2', 'cancel']:
raise osv.except_osv(_('Error !'), _('Cannot %s draft/proforma/cancel invoice.') % (mode)) raise osv.except_osv(_('Error!'), _('Cannot %s draft/proforma/cancel invoice.') % (mode))
if inv.reconciled and mode in ('cancel', 'modify'): if inv.reconciled and mode in ('cancel', 'modify'):
raise osv.except_osv(_('Error !'), _('Cannot %s invoice which is already reconciled, invoice should be unreconciled first. You can only refund this invoice.') % (mode)) raise osv.except_osv(_('Error!'), _('Cannot %s invoice which is already reconciled, invoice should be unreconciled first. You can only refund this invoice.') % (mode))
if form.period.id: if form.period.id:
period = form.period.id period = form.period.id
else: else:

View File

@ -36,7 +36,7 @@ class account_open_closed_fiscalyear(osv.osv_memory):
data = self.browse(cr, uid, ids, context=context)[0] data = self.browse(cr, uid, ids, context=context)[0]
period_journal = data.fyear_id.end_journal_period_id or False period_journal = data.fyear_id.end_journal_period_id or False
if not period_journal: if not period_journal:
raise osv.except_osv(_('Error !'), _('You have to set the end of the fiscal year for this journal.')) raise osv.except_osv(_('Error!'), _('You have to set the end of the fiscal year for this journal.'))
ids_move = move_obj.search(cr, uid, [('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)]) ids_move = move_obj.search(cr, uid, [('journal_id','=',period_journal.journal_id.id),('period_id','=',period_journal.period_id.id)])
if ids_move: if ids_move:

View File

@ -41,7 +41,7 @@ class account_use_model(osv.osv_memory):
for line in model.lines_id: for line in model.lines_id:
if line.date_maturity == 'partner': if line.date_maturity == 'partner':
if not line.partner_id: if not line.partner_id:
raise osv.except_osv(_('Error !'), _("Maturity date of entry line generated by model line '%s' is based on partner payment term!"\ raise osv.except_osv(_('Error!'), _("Maturity date of entry line generated by model line '%s' is based on partner payment term!"\
"\nPlease define partner on it!")%line.name) "\nPlease define partner on it!")%line.name)
pass pass

View File

@ -29,11 +29,11 @@ class CashBox(osv.osv_memory):
for box in self.browse(cr, uid, ids, context=context): for box in self.browse(cr, uid, ids, context=context):
for record in records: for record in records:
if not record.journal_id: if not record.journal_id:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_("Please check that the field 'Journal' is set on the Bank Statement")) _("Please check that the field 'Journal' is set on the Bank Statement"))
if not record.journal_id.internal_account_id: if not record.journal_id.internal_account_id:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_("Please check that the field 'Internal Transfers Account' is set on the payment method '%s'.") % (record.journal_id.name,)) _("Please check that the field 'Internal Transfers Account' is set on the payment method '%s'.") % (record.journal_id.name,))
self._create_bank_statement_line(cr, uid, box, record, context=context) self._create_bank_statement_line(cr, uid, box, record, context=context)

View File

@ -107,7 +107,7 @@ class account_move_line(osv.osv):
if line.id not in line2bank and line.partner_id.bank_ids: if line.id not in line2bank and line.partner_id.bank_ids:
line2bank[line.id] = line.partner_id.bank_ids[0].id line2bank[line.id] = line.partner_id.bank_ids[0].id
else: else:
raise osv.except_osv(_('Error !'), _('There is no partner defined on the entry line.')) raise osv.except_osv(_('Error!'), _('There is no partner defined on the entry line.'))
return line2bank return line2bank
_columns = { _columns = {

View File

@ -473,7 +473,7 @@ class account_voucher(osv.osv):
tr_type = 'purchase' tr_type = 'purchase'
else: else:
if not journal.default_credit_account_id or not journal.default_debit_account_id: if not journal.default_credit_account_id or not journal.default_debit_account_id:
raise osv.except_osv(_('Error !'), _('Please define default credit/debit accounts on the journal "%s".') % (journal.name)) raise osv.except_osv(_('Error!'), _('Please define default credit/debit accounts on the journal "%s".') % (journal.name))
account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id account_id = journal.default_credit_account_id.id or journal.default_debit_account_id.id
tr_type = 'receipt' tr_type = 'receipt'
@ -919,7 +919,7 @@ class account_voucher(osv.osv):
elif voucher_brw.journal_id.sequence_id: elif voucher_brw.journal_id.sequence_id:
name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id, context=context) name = seq_obj.next_by_id(cr, uid, voucher_brw.journal_id.sequence_id.id, context=context)
else: else:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('Please define a sequence on the journal.')) _('Please define a sequence on the journal.'))
if not voucher_brw.reference: if not voucher_brw.reference:
ref = name.replace('/','') ref = name.replace('/','')

View File

@ -140,7 +140,7 @@ class account_analytic_account(osv.osv):
for account in self.browse(cr, uid, ids, context=context): for account in self.browse(cr, uid, ids, context=context):
if account.company_id: if account.company_id:
if account.company_id.currency_id.id != value: if account.company_id.currency_id.id != value:
raise osv.except_osv(_('Error !'), _("If you set a company, the currency selected has to be the same as it's currency. \nYou can remove the company belonging, and thus change the currency, only on analytic account of type 'view'. This can be really usefull for consolidation purposes of several companies charts with different currencies, for example.")) raise osv.except_osv(_('Error!'), _("If you set a company, the currency selected has to be the same as it's currency. \nYou can remove the company belonging, and thus change the currency, only on analytic account of type 'view'. This can be really usefull for consolidation purposes of several companies charts with different currencies, for example."))
return cr.execute("""update account_analytic_account set currency_id=%s where id=%s""", (value, account.id, )) return cr.execute("""update account_analytic_account set currency_id=%s where id=%s""", (value, account.id, ))
def _currency(self, cr, uid, ids, field_name, arg, context=None): def _currency(self, cr, uid, ids, field_name, arg, context=None):

View File

@ -92,7 +92,7 @@ class hr_analytic_timesheet(osv.osv):
if not a: if not a:
a = r.product_id.categ_id.property_account_expense_categ.id a = r.product_id.categ_id.property_account_expense_categ.id
if not a: if not a:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('There is no expense account define ' \ _('There is no expense account define ' \
'for this product: "%s" (id:%d)') % \ 'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,)) (r.product_id.name, r.product_id.id,))
@ -127,7 +127,7 @@ class hr_analytic_timesheet(osv.osv):
if not a: if not a:
a = r.product_id.categ_id.property_account_expense_categ.id a = r.product_id.categ_id.property_account_expense_categ.id
if not a: if not a:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('There is no expense account define ' \ _('There is no expense account define ' \
'for this product: "%s" (id:%d)') % \ 'for this product: "%s" (id:%d)') % \
(r.product_id.name, r.product_id.id,)) (r.product_id.name, r.product_id.id,))

View File

@ -33,7 +33,7 @@ def _create_yaml(self, cr, uid, data, context=None):
try: try:
res_xml = mod.generate_yaml(cr, uid) res_xml = mod.generate_yaml(cr, uid)
except Exception, e: except Exception, e:
raise osv.except_osv(_('Error'),_(str(e))) raise osv.except_osv(_('Error!'),_(str(e)))
return { return {
'yaml_file': base64.encodestring(res_xml), 'yaml_file': base64.encodestring(res_xml),
} }

View File

@ -202,7 +202,7 @@ class base_stage(object):
if case.section_id.parent_id.user_id: if case.section_id.parent_id.user_id:
data['user_id'] = case.section_id.parent_id.user_id.id data['user_id'] = case.section_id.parent_id.user_id.id
else: else:
raise osv.except_osv(_('Error !'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore.")) raise osv.except_osv(_('Error!'), _("You are already at the top level of your sales-team category.\nTherefore you cannot escalate furthermore."))
self.write(cr, uid, [case.id], data, context=context) self.write(cr, uid, [case.id], data, context=context)
case.case_escalate_send_note(case.section_id.parent_id, context=context) case.case_escalate_send_note(case.section_id.parent_id, context=context)
cases = self.browse(cr, uid, ids, context=context) cases = self.browse(cr, uid, ids, context=context)

View File

@ -108,7 +108,7 @@ class res_partner(osv.osv):
def button_check_vat(self, cr, uid, ids, context=None): def button_check_vat(self, cr, uid, ids, context=None):
if not self.check_vat(cr, uid, ids, context=context): if not self.check_vat(cr, uid, ids, context=context):
msg = self._construct_constraint_msg(cr, uid, ids, context=context) msg = self._construct_constraint_msg(cr, uid, ids, context=context)
raise osv.except_osv(_('Error'), msg) raise osv.except_osv(_('Error!'), msg)
def check_vat(self, cr, uid, ids, context=None): def check_vat(self, cr, uid, ids, context=None):
user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id

View File

@ -1290,7 +1290,7 @@ class Attendee(CalDAV, osv.osv_memory):
attendee_add.params['CN'] = cn_val attendee_add.params['CN'] = cn_val
if not attendee['email']: if not attendee['email']:
attendee_add.value = 'MAILTO:' attendee_add.value = 'MAILTO:'
#raise osv.except_osv(_('Error !'), _('Attendee must have an Email Id')) #raise osv.except_osv(_('Error!'), _('Attendee must have an Email Id'))
elif attendee['email']: elif attendee['email']:
attendee_add.value = 'MAILTO:' + attendee['email'] attendee_add.value = 'MAILTO:' + attendee['email']
return vevent return vevent

View File

@ -788,7 +788,7 @@ class crm_lead(base_stage, osv.osv):
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
for lead in self.browse(cr, uid, ids, context): for lead in self.browse(cr, uid, ids, context):
if (not lead.section_id.allow_unlink) and (lead.state != 'draft'): if (not lead.section_id.allow_unlink) and (lead.state != 'draft'):
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_("You cannot delete lead '%s' because it is not in 'Draft' state. " \ _("You cannot delete lead '%s' because it is not in 'Draft' state. " \
"You can still cancel it, instead of deleting it.") % lead.name) "You can still cancel it, instead of deleting it.") % lead.name)
return super(crm_lead, self).unlink(cr, uid, ids, context) return super(crm_lead, self).unlink(cr, uid, ids, context)

View File

@ -74,7 +74,7 @@ class google_login(osv.osv_memory):
} }
self.pool.get('res.users').write(cr, uid, uid, res, context=context) self.pool.get('res.users').write(cr, uid, uid, res, context=context)
else: else:
raise osv.except_osv(_('Error'), _("Authentication failed. Check the user and password.")) raise osv.except_osv(_('Error!'), _("Authentication failed. Check the user and password."))
return self._get_next_action(cr, uid, context=context) return self._get_next_action(cr, uid, context=context)

View File

@ -171,7 +171,7 @@ class hr_expense_expense(osv.osv):
else: else:
acc = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category', context={'force_company': company_id}) acc = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category', context={'force_company': company_id})
if not acc: if not acc:
raise osv.except_osv(_('Error !'), _('Please configure Default Expense account for Product purchase: `property_account_expense_categ`.')) raise osv.except_osv(_('Error!'), _('Please configure Default Expense account for Product purchase: `property_account_expense_categ`.'))
lines.append((0, False, { lines.append((0, False, {
'name': l.name, 'name': l.name,
'account_id': acc.id, 'account_id': acc.id,
@ -183,7 +183,7 @@ class hr_expense_expense(osv.osv):
'account_analytic_id': l.analytic_account.id, 'account_analytic_id': l.analytic_account.id,
})) }))
if not exp.employee_id.address_home_id: if not exp.employee_id.address_home_id:
raise osv.except_osv(_('Error !'), _('The employee must have a home address.')) raise osv.except_osv(_('Error!'), _('The employee must have a home address.'))
acc = exp.employee_id.address_home_id.property_account_payable.id acc = exp.employee_id.address_home_id.property_account_payable.id
payment_term_id = exp.employee_id.address_home_id.property_payment_term.id payment_term_id = exp.employee_id.address_home_id.property_payment_term.id
inv = { inv = {

View File

@ -41,7 +41,7 @@ class hr_holidays_summary_dept(osv.osv_memory):
def print_report(self, cr, uid, ids, context=None): def print_report(self, cr, uid, ids, context=None):
data = self.read(cr, uid, ids, [], context=context)[0] data = self.read(cr, uid, ids, [], context=context)[0]
if not data['depts']: if not data['depts']:
raise osv.except_osv(_('Error !'), _('You have to select at least one Department. And try again.')) raise osv.except_osv(_('Error!'), _('You have to select at least one Department. And try again.'))
datas = { datas = {
'ids': [], 'ids': [],
'model': 'ir.ui.menu', 'model': 'ir.ui.menu',

View File

@ -859,18 +859,18 @@ result = rules.NET > categories.NET * 0.10''',
try: try:
return rule.amount_fix, eval(rule.quantity, localdict), 100.0 return rule.amount_fix, eval(rule.quantity, localdict), 100.0
except: except:
raise osv.except_osv(_('Error !'), _('Wrong quantity defined for salary rule %s (%s).')% (rule.name, rule.code)) raise osv.except_osv(_('Error!'), _('Wrong quantity defined for salary rule %s (%s).')% (rule.name, rule.code))
elif rule.amount_select == 'percentage': elif rule.amount_select == 'percentage':
try: try:
return eval(rule.amount_percentage_base, localdict), eval(rule.quantity, localdict), rule.amount_percentage return eval(rule.amount_percentage_base, localdict), eval(rule.quantity, localdict), rule.amount_percentage
except: except:
raise osv.except_osv(_('Error !'), _('Wrong percentage base or quantity defined for salary rule %s (%s).')% (rule.name, rule.code)) raise osv.except_osv(_('Error!'), _('Wrong percentage base or quantity defined for salary rule %s (%s).')% (rule.name, rule.code))
else: else:
try: try:
eval(rule.amount_python_compute, localdict, mode='exec', nocopy=True) eval(rule.amount_python_compute, localdict, mode='exec', nocopy=True)
return localdict['result'], 'result_qty' in localdict and localdict['result_qty'] or 1.0, 'result_rate' in localdict and localdict['result_rate'] or 100.0 return localdict['result'], 'result_qty' in localdict and localdict['result_qty'] or 1.0, 'result_rate' in localdict and localdict['result_rate'] or 100.0
except: except:
raise osv.except_osv(_('Error !'), _('Wrong python code defined for salary rule %s (%s).')% (rule.name, rule.code)) raise osv.except_osv(_('Error!'), _('Wrong python code defined for salary rule %s (%s).')% (rule.name, rule.code))
def satisfy_condition(self, cr, uid, rule_id, localdict, context=None): def satisfy_condition(self, cr, uid, rule_id, localdict, context=None):
""" """
@ -887,13 +887,13 @@ result = rules.NET > categories.NET * 0.10''',
result = eval(rule.condition_range, localdict) result = eval(rule.condition_range, localdict)
return rule.condition_range_min <= result and result <= rule.condition_range_max or False return rule.condition_range_min <= result and result <= rule.condition_range_max or False
except: except:
raise osv.except_osv(_('Error !'), _('Wrong range condition defined for salary rule %s (%s).')% (rule.name, rule.code)) raise osv.except_osv(_('Error!'), _('Wrong range condition defined for salary rule %s (%s).')% (rule.name, rule.code))
else: #python code else: #python code
try: try:
eval(rule.condition_python, localdict, mode='exec', nocopy=True) eval(rule.condition_python, localdict, mode='exec', nocopy=True)
return 'result' in localdict and localdict['result'] or False return 'result' in localdict and localdict['result'] or False
except: except:
raise osv.except_osv(_('Error !'), _('Wrong python condition defined for salary rule %s (%s).')% (rule.name, rule.code)) raise osv.except_osv(_('Error!'), _('Wrong python condition defined for salary rule %s (%s).')% (rule.name, rule.code))
hr_salary_rule() hr_salary_rule()

View File

@ -35,7 +35,7 @@ class hr_recruitment_partner_create(osv.osv_memory):
context = {} context = {}
for case in case_obj.browse(cr, uid, context['active_ids'], context=context): for case in case_obj.browse(cr, uid, context['active_ids'], context=context):
if case.partner_id: if case.partner_id:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('A contact is already defined on this job request.')) _('A contact is already defined on this job request.'))
pass pass
@ -53,7 +53,7 @@ class hr_recruitment_partner_create(osv.osv_memory):
for case in case_obj.browse(cr, uid, context['active_ids'], context=context): for case in case_obj.browse(cr, uid, context['active_ids'], context=context):
partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)], context=context) partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)], context=context)
if partner_id: if partner_id:
raise osv.except_osv(_('Error !'),_('A contact is already existing with the same name.')) raise osv.except_osv(_('Error!'),_('A contact is already existing with the same name.'))
partner_id = partner_obj.create(cr, uid, { partner_id = partner_obj.create(cr, uid, {
'name': case.partner_name or case.name, 'name': case.partner_name or case.name,
'user_id': case.user_id.id, 'user_id': case.user_id.id,

View File

@ -157,7 +157,7 @@ class account_analytic_line(osv.osv):
if ( not vals.has_key('invoice_id')) or vals['invoice_id' ] == False: if ( not vals.has_key('invoice_id')) or vals['invoice_id' ] == False:
for line in self.browse(cr, uid, select): for line in self.browse(cr, uid, select):
if line.invoice_id: if line.invoice_id:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('You cannot modify an invoiced analytic line!')) _('You cannot modify an invoiced analytic line!'))
return True return True

View File

@ -101,7 +101,7 @@ class account_analytic_line(osv.osv):
product_id = data['product'][0] product_id = data['product'][0]
product = product_obj.browse(cr, uid, product_id, context=context2) product = product_obj.browse(cr, uid, product_id, context=context2)
if not product: if not product:
raise osv.except_osv(_('Error'), _('There is no product defined for the line %s. Please select one or force the product through the wizard.') % (line_name)) raise osv.except_osv(_('Error!'), _('There is no product defined for the line %s. Please select one or force the product through the wizard.') % (line_name))
factor = invoice_factor_obj.browse(cr, uid, factor_id, context=context2) factor = invoice_factor_obj.browse(cr, uid, factor_id, context=context2)
factor_name = product_obj.name_get(cr, uid, [product_id], context=context2)[0][1] factor_name = product_obj.name_get(cr, uid, [product_id], context=context2)[0][1]
if factor.customer_name: if factor.customer_name:

View File

@ -35,7 +35,7 @@ class hr_timesheet_current_open(osv.osv_memory):
user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context) user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context)
if not len(user_ids): if not len(user_ids):
raise osv.except_osv(_('Error !'), _('Please define employee for your user!')) raise osv.except_osv(_('Error!'), _('Please define employee for your user!'))
ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))], context=context) ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))], context=context)
if len(ids) > 1: if len(ids) > 1:

View File

@ -127,13 +127,13 @@ class synchronize_google(osv.osv_memory):
gmail_pwd = user_obj.gmail_password gmail_pwd = user_obj.gmail_password
google = self.pool.get('google.login') google = self.pool.get('google.login')
if not gmail_user or not gmail_pwd: if not gmail_user or not gmail_pwd:
raise osv.except_osv(_('Error'), _("Invalid login detail !\nPlease specify correct username and password.")) raise osv.except_osv(_('Error!'), _("Invalid login detail !\nPlease specify correct username and password."))
if context.get('contact'): if context.get('contact'):
msg = " Your contacts are being imported in background, an email to %s will be sent when the process is over." % (user_obj.gmail_user) msg = " Your contacts are being imported in background, an email to %s will be sent when the process is over." % (user_obj.gmail_user)
gd_client = google.google_login(gmail_user, gmail_pwd, type='contact') gd_client = google.google_login(gmail_user, gmail_pwd, type='contact')
if not gd_client: if not gd_client:
raise osv.except_osv(_('Error'), _("Please specify correct username and password!")) raise osv.except_osv(_('Error!'), _("Please specify correct username and password!"))
if obj.group_name not in ['all']: if obj.group_name not in ['all']:
context.update({ 'group_name': obj.group_name}) context.update({ 'group_name': obj.group_name})
tables.append('Contact') tables.append('Contact')

View File

@ -76,7 +76,7 @@ class sugar_import(import_framework):
#login #login
PortType,sessionid = sugar.login(self.context.get('username',''), self.context.get('password',''), self.context.get('url','')) PortType,sessionid = sugar.login(self.context.get('username',''), self.context.get('password',''), self.context.get('url',''))
if sessionid == '-1': if sessionid == '-1':
raise osv.except_osv(_('Error !'), _('Authentication error!\nBad username or password or bad SugarSoap Api url!')) raise osv.except_osv(_('Error!'), _('Authentication error!\nBad username or password or bad SugarSoap Api url!'))
self.context['port'] = PortType self.context['port'] = PortType
self.context['session_id'] = sessionid self.context['session_id'] = sessionid

View File

@ -57,7 +57,7 @@ def login(username, password, url):
try: try:
response = portType.login(request) response = portType.login(request)
except: except:
raise osv.except_osv(_('Error !'), _('Authentication error!\nBad username or password or bad SugarSoap Api url!')) raise osv.except_osv(_('Error!'), _('Authentication error!\nBad username or password or bad SugarSoap Api url!'))
if -1 == response._return._id: if -1 == response._return._id:
raise LoginError(response._return._error._description) raise LoginError(response._return._error._description)

View File

@ -372,17 +372,17 @@ def _create_dta(obj, cr, uid, data, context=None):
# raise osv.except_osv(_('Order not confirmed'), # raise osv.except_osv(_('Order not confirmed'),
# _('Please confirm it')) # _('Please confirm it'))
if not payment.mode: if not payment.mode:
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_('No payment mode.')) _('No payment mode.'))
bank = payment.mode.bank_id bank = payment.mode.bank_id
if not bank: if not bank:
raise osv.except_osv(_('Error'), _('No bank account for the company.')) raise osv.except_osv(_('Error!'), _('No bank account for the company.'))
v['comp_bank_name']= bank.bank and bank.bank.name or False v['comp_bank_name']= bank.bank and bank.bank.name or False
v['comp_bank_clearing'] = bank.bank.clearing v['comp_bank_clearing'] = bank.bank.clearing
if not v['comp_bank_clearing']: if not v['comp_bank_clearing']:
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_('You must provide a Clearing Number for your bank account.')) _('You must provide a Clearing Number for your bank account.'))
user = pool.get('res.users').browse(cr,uid,[uid])[0] user = pool.get('res.users').browse(cr,uid,[uid])[0]
@ -404,7 +404,7 @@ def _create_dta(obj, cr, uid, data, context=None):
#else: #else:
# v['comp_bank_iban'] = '' # v['comp_bank_iban'] = ''
if not v['comp_bank_iban']: if not v['comp_bank_iban']:
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_('No IBAN for the company bank account.')) _('No IBAN for the company bank account.'))
res_partner_bank_obj = pool.get('res.partner.bank') res_partner_bank_obj = pool.get('res.partner.bank')
@ -415,10 +415,10 @@ def _create_dta(obj, cr, uid, data, context=None):
for pline in payment.line_ids: for pline in payment.line_ids:
if not pline.bank_id: if not pline.bank_id:
raise osv.except_osv(_('Error'), _('No bank account defined\n' \ raise osv.except_osv(_('Error!'), _('No bank account defined\n' \
'on line: %s') % pline.name) 'on line: %s') % pline.name)
if not pline.bank_id.bank: if not pline.bank_id.bank:
raise osv.except_osv(_('Error'), _('No bank defined\n' \ raise osv.except_osv(_('Error!'), _('No bank defined\n' \
'for the bank account: %s\n' \ 'for the bank account: %s\n' \
'on the partner: %s\n' \ 'on the partner: %s\n' \
'on line: %s') + (pline.bank_id.state, pline.partner_id.name, pline.name)) 'on line: %s') + (pline.bank_id.state, pline.partner_id.name, pline.name))
@ -431,7 +431,7 @@ def _create_dta(obj, cr, uid, data, context=None):
v['partner_bank_name'] = pline.bank_id.bank.name or False v['partner_bank_name'] = pline.bank_id.bank.name or False
v['partner_bank_clearing'] = pline.bank_id.bank.clearing or False v['partner_bank_clearing'] = pline.bank_id.bank.clearing or False
if not v['partner_bank_name'] : if not v['partner_bank_name'] :
raise osv.except_osv(_('Error'), _('No bank name defined\n' \ raise osv.except_osv(_('Error!'), _('No bank name defined\n' \
'for the bank account: %s\n' \ 'for the bank account: %s\n' \
'on the partner: %s\n' \ 'on the partner: %s\n' \
'on line: %s') % (pline.bank_id.state, pline.partner_id.name, pline.name)) 'on line: %s') % (pline.bank_id.state, pline.partner_id.name, pline.name))
@ -460,7 +460,7 @@ def _create_dta(obj, cr, uid, data, context=None):
v['partner_bvr'] = v['partner_bvr'].rjust(9, '0') v['partner_bvr'] = v['partner_bvr'].rjust(9, '0')
is_9_pos_adherent = False is_9_pos_adherent = False
else: else:
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_('Wrong postal number format.\n' _('Wrong postal number format.\n'
'It must be 12-123456-9 or 12345 format')) 'It must be 12-123456-9 or 12345 format'))
@ -519,7 +519,7 @@ def _create_dta(obj, cr, uid, data, context=None):
v['comp_country'] = co_addr.country_id and co_addr.country_id.code+'-' or '' v['comp_country'] = co_addr.country_id and co_addr.country_id.code+'-' or ''
record_type = record_gt836 record_type = record_gt836
if not v['partner_bank_iban']: if not v['partner_bank_iban']:
raise osv.except_osv(_('Error'), _('No IBAN defined \n' \ raise osv.except_osv(_('Error!'), _('No IBAN defined \n' \
'for the bank account: %s\n' + \ 'for the bank account: %s\n' + \
'on line: %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] , pline.name)) 'on line: %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] , pline.name))
@ -535,27 +535,27 @@ def _create_dta(obj, cr, uid, data, context=None):
+ ' ' + v['partner_bank_city'] \ + ' ' + v['partner_bank_city'] \
+ ' ' + v['partner_bank_country'] + ' ' + v['partner_bank_country']
else: else:
raise osv.except_osv(_('Error'), _('You must provide the bank city ' raise osv.except_osv(_('Error!'), _('You must provide the bank city '
'or the bic code for the partner bank: \n %d\n' + \ 'or the bic code for the partner bank: \n %d\n' + \
'on line: %s') %(res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1], pline.name)) 'on line: %s') %(res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1], pline.name))
elif elec_pay == 'bvrbank' or elec_pay == 'bvrpost': elif elec_pay == 'bvrbank' or elec_pay == 'bvrpost':
from tools import mod10r from tools import mod10r
if not v['reference']: if not v['reference']:
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_('You must provide ' \ _('You must provide ' \
'a BVR reference number \n' \ 'a BVR reference number \n' \
'for the line: %s') % pline.name) 'for the line: %s') % pline.name)
v['reference'] = v['reference'].replace(' ', '') v['reference'] = v['reference'].replace(' ', '')
if is_9_pos_adherent: if is_9_pos_adherent:
if len(v['reference']) > 27: if len(v['reference']) > 27:
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_('BVR reference number is not valid \n' _('BVR reference number is not valid \n'
'for the line: %s. \n' 'for the line: %s. \n'
'Reference is too long.') % pline.name) 'Reference is too long.') % pline.name)
# do a mod10 check # do a mod10 check
if mod10r(v['reference'][:-1]) != v['reference']: if mod10r(v['reference'][:-1]) != v['reference']:
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_('BVR reference number is not valid \n' _('BVR reference number is not valid \n'
'for the line: %s. \n' 'for the line: %s. \n'
'Mod10 check failed.') % pline.name) 'Mod10 check failed.') % pline.name)
@ -565,7 +565,7 @@ def _create_dta(obj, cr, uid, data, context=None):
# reference of BVR adherent with 5 positions number # reference of BVR adherent with 5 positions number
# have 15 positions references # have 15 positions references
if len(v['reference']) > 15: if len(v['reference']) > 15:
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_('BVR reference number is not valid \n' _('BVR reference number is not valid \n'
'for the line: %s. \n' 'for the line: %s. \n'
'Reference is too long ' 'Reference is too long '
@ -575,19 +575,19 @@ def _create_dta(obj, cr, uid, data, context=None):
v['reference'] = v['reference'].rjust(15, '0').ljust(27, ' ') v['reference'] = v['reference'].rjust(15, '0').ljust(27, ' ')
if not v['partner_bvr']: if not v['partner_bvr']:
raise osv.except_osv(_('Error'), _('You must provide a BVR number\n' raise osv.except_osv(_('Error!'), _('You must provide a BVR number\n'
'for the bank account: %s' \ 'for the bank account: %s' \
'on line: %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id],context)[0][1] ,pline.name)) 'on line: %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id],context)[0][1] ,pline.name))
record_type = record_gt826 record_type = record_gt826
elif elec_pay == 'bvbank': elif elec_pay == 'bvbank':
if not v['partner_bank_number'] : if not v['partner_bank_number'] :
raise osv.except_osv(_('Error'), _('You must provide ' \ raise osv.except_osv(_('Error!'), _('You must provide ' \
'a bank number \n' \ 'a bank number \n' \
'for the partner bank: %s\n' \ 'for the partner bank: %s\n' \
'on line: %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] , pline.name)) 'on line: %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] , pline.name))
if not v['partner_bank_clearing']: if not v['partner_bank_clearing']:
raise osv.except_osv(_('Error'), _('You must provide ' \ raise osv.except_osv(_('Error!'), _('You must provide ' \
'a Clearing Number\n' \ 'a Clearing Number\n' \
'for the partner bank: %s\n' \ 'for the partner bank: %s\n' \
'on line %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] , pline.name)) 'on line %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] , pline.name))
@ -595,7 +595,7 @@ def _create_dta(obj, cr, uid, data, context=None):
record_type = record_gt827 record_type = record_gt827
elif elec_pay == 'bvpost': elif elec_pay == 'bvpost':
if not v['partner_post_number']: if not v['partner_post_number']:
raise osv.except_osv(_('Error'), _('You must provide ' \ raise osv.except_osv(_('Error!'), _('You must provide ' \
'a post number \n' \ 'a post number \n' \
'for the partner bank: %s\n' \ 'for the partner bank: %s\n' \
'on line: %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] ,pline.name)) 'on line: %s') % (res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] ,pline.name))
@ -603,7 +603,7 @@ def _create_dta(obj, cr, uid, data, context=None):
v['partner_bank_number'] = '/C/'+v['partner_post_number'] v['partner_bank_number'] = '/C/'+v['partner_post_number']
record_type = record_gt827 record_type = record_gt827
else: else:
raise osv.except_osv(_('Error'), _('The Bank type %s of the bank account: %s is not supported.') \ raise osv.except_osv(_('Error!'), _('The Bank type %s of the bank account: %s is not supported.') \
% (elec_pay, res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1],)) % (elec_pay, res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1],))
dta_line = record_type(v).generate() dta_line = record_type(v).generate()

View File

@ -50,12 +50,12 @@ class res_partner_bank(osv.osv):
# compute the key # compute the key
key = 97 - (100 * int(rib)) % 97 key = 97 - (100 * int(rib)) % 97
if int(bank_acc.key) != key: if int(bank_acc.key) != key:
raise osv.except_osv(_('Error'), raise osv.except_osv(_('Error!'),
_("The RIB key %s does not correspond to the other codes: %s %s %s.") % \ _("The RIB key %s does not correspond to the other codes: %s %s %s.") % \
(bank_acc.key, bank_acc.bank_code, bank_acc.office, bank_acc.rib_acc_number) ) (bank_acc.key, bank_acc.bank_code, bank_acc.office, bank_acc.rib_acc_number) )
if bank_acc.acc_number: if bank_acc.acc_number:
if not self.is_iban_valid(cr, uid, bank_acc.acc_number): if not self.is_iban_valid(cr, uid, bank_acc.acc_number):
raise osv.except_osv(_('Error'), _("The IBAN %s is not valid.") % bank_acc.acc_number) raise osv.except_osv(_('Error!'), _("The IBAN %s is not valid.") % bank_acc.acc_number)
return True return True
def onchange_bank_id(self, cr, uid, ids, bank_id, context=None): def onchange_bank_id(self, cr, uid, ids, bank_id, context=None):

View File

@ -407,10 +407,10 @@ class Partner(osv.osv):
fpos_id = partner.property_account_position and partner.property_account_position.id or False fpos_id = partner.property_account_position and partner.property_account_position.id or False
addr = self.address_get(cr, uid, [partner.id], ['invoice']) addr = self.address_get(cr, uid, [partner.id], ['invoice'])
if partner.free_member: if partner.free_member:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_("Partner is a free Member.")) _("Partner is a free Member."))
if not addr.get('invoice', False): if not addr.get('invoice', False):
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_("Partner doesn't have an address to make the invoice.")) _("Partner doesn't have an address to make the invoice."))
quantity = 1 quantity = 1
line_value = { line_value = {

View File

@ -330,7 +330,7 @@ class mrp_repair(osv.osv):
else: else:
self.write(cr, uid, [o.id], {'state': 'confirmed'}) self.write(cr, uid, [o.id], {'state': 'confirmed'})
if not o.operations: if not o.operations:
raise osv.except_osv(_('Error !'),_('You cannot confirm a repair order which has no line.')) raise osv.except_osv(_('Error!'),_('You cannot confirm a repair order which has no line.'))
for line in o.operations: for line in o.operations:
if line.product_id.track_production and not line.prodlot_id: if line.product_id.track_production and not line.prodlot_id:
raise osv.except_osv(_('Warning'), _("Serial number is required for operation line with product '%s'") % (line.product_id.name)) raise osv.except_osv(_('Warning'), _("Serial number is required for operation line with product '%s'") % (line.product_id.name))
@ -380,7 +380,7 @@ class mrp_repair(osv.osv):
inv_obj.write(cr, uid, [inv_id], invoice_vals, context=context) inv_obj.write(cr, uid, [inv_id], invoice_vals, context=context)
else: else:
if not repair.partner_id.property_account_receivable: if not repair.partner_id.property_account_receivable:
raise osv.except_osv(_('Error !'), _('No account defined for partner "%s".') % repair.partner_id.name ) raise osv.except_osv(_('Error!'), _('No account defined for partner "%s".') % repair.partner_id.name )
account_id = repair.partner_id.property_account_receivable.id account_id = repair.partner_id.property_account_receivable.id
inv = { inv = {
'name': repair.name, 'name': repair.name,
@ -408,7 +408,7 @@ class mrp_repair(osv.osv):
elif operation.product_id.categ_id.property_account_income_categ: elif operation.product_id.categ_id.property_account_income_categ:
account_id = operation.product_id.categ_id.property_account_income_categ.id account_id = operation.product_id.categ_id.property_account_income_categ.id
else: else:
raise osv.except_osv(_('Error !'), _('No account defined for product "%s".') % operation.product_id.name ) raise osv.except_osv(_('Error!'), _('No account defined for product "%s".') % operation.product_id.name )
invoice_line_id = inv_line_obj.create(cr, uid, { invoice_line_id = inv_line_obj.create(cr, uid, {
'invoice_id': inv_id, 'invoice_id': inv_id,
@ -437,7 +437,7 @@ class mrp_repair(osv.osv):
elif fee.product_id.categ_id.property_account_income_categ: elif fee.product_id.categ_id.property_account_income_categ:
account_id = fee.product_id.categ_id.property_account_income_categ.id account_id = fee.product_id.categ_id.property_account_income_categ.id
else: else:
raise osv.except_osv(_('Error !'), _('No account defined for product "%s".') % fee.product_id.name) raise osv.except_osv(_('Error!'), _('No account defined for product "%s".') % fee.product_id.name)
invoice_fee_id = inv_line_obj.create(cr, uid, { invoice_fee_id = inv_line_obj.create(cr, uid, {
'invoice_id': inv_id, 'invoice_id': inv_id,

View File

@ -366,7 +366,7 @@ class pos_session(osv.osv):
if abs(st.difference) > st.journal_id.amount_authorized_diff: if abs(st.difference) > st.journal_id.amount_authorized_diff:
# The pos manager can close statements with maximums. # The pos manager can close statements with maximums.
if not self.pool.get('ir.model.access').check_groups(cr, uid, "point_of_sale.group_pos_manager"): if not self.pool.get('ir.model.access').check_groups(cr, uid, "point_of_sale.group_pos_manager"):
raise osv.except_osv( _('Error !'), raise osv.except_osv( _('Error!'),
_("Your ending balance is too different from the theorical cash closing (%.2f), the maximum allowed is: %.2f. You can contact your manager to force it.") % (st.difference, st.journal_id.amount_authorized_diff)) _("Your ending balance is too different from the theorical cash closing (%.2f), the maximum allowed is: %.2f. You can contact your manager to force it.") % (st.difference, st.journal_id.amount_authorized_diff))
if st.difference: if st.difference:
if st.difference > 0.0: if st.difference > 0.0:
@ -376,7 +376,7 @@ class pos_session(osv.osv):
account_id = st.journal_id.loss_account_id.id account_id = st.journal_id.loss_account_id.id
name= _('Point of Sale Loss') name= _('Point of Sale Loss')
if not account_id: if not account_id:
raise osv.except_osv( _('Error !'), raise osv.except_osv( _('Error!'),
_("Please set your profit and loss accounts on your payment method '%s'.") % (st.journal_id.name,)) _("Please set your profit and loss accounts on your payment method '%s'.") % (st.journal_id.name,))
bsl.create(cr, uid, { bsl.create(cr, uid, {
'statement_id': st.id, 'statement_id': st.id,
@ -403,7 +403,7 @@ class pos_session(osv.osv):
for order in session.order_ids: for order in session.order_ids:
if order.state != 'paid': if order.state != 'paid':
raise osv.except_osv( raise osv.except_osv(
_('Error !'), _('Error!'),
_("You cannot confirm all orders of this session, because they have not the 'paid' status")) _("You cannot confirm all orders of this session, because they have not the 'paid' status"))
else: else:
wf_service.trg_validate(uid, 'pos.order', order.id, 'done', cr) wf_service.trg_validate(uid, 'pos.order', order.id, 'done', cr)
@ -693,7 +693,7 @@ class pos_order(osv.osv):
break break
if not statement_id: if not statement_id:
raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox.')) raise osv.except_osv(_('Error!'), _('You have to open at least one cashbox.'))
args.update({ args.update({
'statement_id' : statement_id, 'statement_id' : statement_id,

View File

@ -43,7 +43,7 @@ class pos_invoice(report_sxw.rml_parse):
if order.invoice_id and order.invoice_id not in iids: if order.invoice_id and order.invoice_id not in iids:
if not order.invoice_id: if not order.invoice_id:
raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.')) raise osv.except_osv(_('Error!'), _('Please create an invoice for this sale.'))
iids.append(order.invoice_id) iids.append(order.invoice_id)
nids.append(order.invoice_id.id) nids.append(order.invoice_id.id)
data['ids'] = nids data['ids'] = nids

View File

@ -20,7 +20,7 @@ class PosBox(CashBox):
bank_statements = [record.cash_register_id for record in records if record.cash_register_id] bank_statements = [record.cash_register_id for record in records if record.cash_register_id]
if not bank_statements: if not bank_statements:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_("There is no cash register for this PoS Session")) _("There is no cash register for this PoS Session"))
return self._run(cr, uid, ids, bank_statements, context=context) return self._run(cr, uid, ids, bank_statements, context=context)

View File

@ -43,7 +43,7 @@ def get_journal(self, cr, uid, context=None):
res = statement_obj.read(cr, uid, obj_ids, ['journal_id'], context=context) res = statement_obj.read(cr, uid, obj_ids, ['journal_id'], context=context)
res = [(r['journal_id']) for r in res] res = [(r['journal_id']) for r in res]
if not len(res) and context: if not len(res) and context:
raise osv.except_osv(_('Error !'), _('You do not have any open cash register. You must create a payment method or open a cash register.')) raise osv.except_osv(_('Error!'), _('You do not have any open cash register. You must create a payment method or open a cash register.'))
return res return res
class pos_box_entries(osv.osv_memory): class pos_box_entries(osv.osv_memory):
@ -115,12 +115,12 @@ class pos_box_entries(osv.osv_memory):
curr_company = res_obj.browse(cr, uid, uid, context=context).company_id.id curr_company = res_obj.browse(cr, uid, uid, context=context).company_id.id
statement_id = statement_obj.search(cr, uid, [('journal_id', '=', int(data['journal_id'])), ('company_id', '=', curr_company), ('user_id', '=', uid), ('state', '=', 'open')], context=context) statement_id = statement_obj.search(cr, uid, [('journal_id', '=', int(data['journal_id'])), ('company_id', '=', curr_company), ('user_id', '=', uid), ('state', '=', 'open')], context=context)
if not statement_id: if not statement_id:
raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox.')) raise osv.except_osv(_('Error!'), _('You have to open at least one cashbox.'))
product = product_obj.browse(cr, uid, int(data['product_id'])) product = product_obj.browse(cr, uid, int(data['product_id']))
acc_id = product.property_account_income or product.categ_id.property_account_income_categ acc_id = product.property_account_income or product.categ_id.property_account_income_categ
if not acc_id: if not acc_id:
raise osv.except_osv(_('Error !'), _('Please check that income account is set to %s.')%(product_obj.browse(cr, uid, data['product_id']).name)) raise osv.except_osv(_('Error!'), _('Please check that income account is set to %s.')%(product_obj.browse(cr, uid, data['product_id']).name))
if statement_id: if statement_id:
statement_id = statement_id[0] statement_id = statement_id[0]
if not statement_id: if not statement_id:

View File

@ -86,9 +86,9 @@ class pos_box_out(osv.osv_memory):
product = product_obj.browse(cr, uid, data['product_id'], context=context) product = product_obj.browse(cr, uid, data['product_id'], context=context)
acc_id = product.property_account_expense or product.categ_id.property_account_expense_categ acc_id = product.property_account_expense or product.categ_id.property_account_expense_categ
if not acc_id: if not acc_id:
raise osv.except_osv(_('Error !'), _('please check that account is set to %s.')%(product.name)) raise osv.except_osv(_('Error!'), _('please check that account is set to %s.')%(product.name))
if not statement_ids: if not statement_ids:
raise osv.except_osv(_('Error !'), _('You have to open at least one cashbox.')) raise osv.except_osv(_('Error!'), _('You have to open at least one cashbox.'))
vals['statement_id'] = statement_ids[0] vals['statement_id'] = statement_ids[0]
vals['journal_id'] = data['journal_id'] vals['journal_id'] = data['journal_id']
vals['account_id'] = acc_id.id vals['account_id'] = acc_id.id

View File

@ -140,7 +140,7 @@ class product_uom(osv.osv):
context = {} context = {}
if from_unit.category_id.id <> to_unit.category_id.id: if from_unit.category_id.id <> to_unit.category_id.id:
if context.get('raise-exception', True): if context.get('raise-exception', True):
raise osv.except_osv(_('Error !'), _('Conversion from Product UoM %s to Default UoM %s is not possible as they both belong to different Category!.') % (from_unit.name,to_unit.name,)) raise osv.except_osv(_('Error!'), _('Conversion from Product UoM %s to Default UoM %s is not possible as they both belong to different Category!.') % (from_unit.name,to_unit.name,))
else: else:
return qty return qty
amount = qty / from_unit.factor amount = qty / from_unit.factor

View File

@ -49,7 +49,7 @@ class project_timebox_empty(osv.osv_memory):
ids = obj_tb.search(cr, uid, [], context=context) ids = obj_tb.search(cr, uid, [], context=context)
if not len(ids): if not len(ids):
raise osv.except_osv(_('Error !'), _('No timebox child of this one !')) raise osv.except_osv(_('Error!'), _('No timebox child of this one !'))
tids = obj_task.search(cr, uid, [('timebox_id', '=', context['active_id'])]) tids = obj_task.search(cr, uid, [('timebox_id', '=', context['active_id'])])
for task in obj_task.browse(cr, uid, tids, context): for task in obj_task.browse(cr, uid, tids, context):
if (task.state in ('cancel','done')) or (task.user_id.id <> uid): if (task.state in ('cancel','done')) or (task.user_id.id <> uid):

View File

@ -367,7 +367,7 @@ class purchase_order(osv.osv):
todo = [] todo = []
for po in self.browse(cr, uid, ids, context=context): for po in self.browse(cr, uid, ids, context=context):
if not po.order_line: if not po.order_line:
raise osv.except_osv(_('Error !'),_('You cannot confirm a purchase order without any purchase order line.')) raise osv.except_osv(_('Error!'),_('You cannot confirm a purchase order without any purchase order line.'))
for line in po.order_line: for line in po.order_line:
if line.state=='draft': if line.state=='draft':
todo.append(line.id) todo.append(line.id)
@ -427,7 +427,7 @@ class purchase_order(osv.osv):
pay_acc_id = order.partner_id.property_account_payable.id pay_acc_id = order.partner_id.property_account_payable.id
journal_ids = journal_obj.search(cr, uid, [('type', '=','purchase'),('company_id', '=', order.company_id.id)], limit=1) journal_ids = journal_obj.search(cr, uid, [('type', '=','purchase'),('company_id', '=', order.company_id.id)], limit=1)
if not journal_ids: if not journal_ids:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('Define purchase journal for this company: "%s" (id:%d).') % (order.company_id.name, order.company_id.id)) _('Define purchase journal for this company: "%s" (id:%d).') % (order.company_id.name, order.company_id.id))
# generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line # generate invoice line correspond to PO line and link that to created invoice (inv_id) and PO line
@ -438,7 +438,7 @@ class purchase_order(osv.osv):
if not acc_id: if not acc_id:
acc_id = po_line.product_id.categ_id.property_account_expense_categ.id acc_id = po_line.product_id.categ_id.property_account_expense_categ.id
if not acc_id: if not acc_id:
raise osv.except_osv(_('Error !'), _('Define expense account for this company: "%s" (id:%d).') % (po_line.product_id.name, po_line.product_id.id,)) raise osv.except_osv(_('Error!'), _('Define expense account for this company: "%s" (id:%d).') % (po_line.product_id.name, po_line.product_id.id,))
else: else:
acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category').id acc_id = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category').id
fpos = order.fiscal_position or False fpos = order.fiscal_position or False

View File

@ -106,7 +106,7 @@ class purchase_line_invoice(osv.osv_memory):
if not a: if not a:
a = line.product_id.categ_id.property_account_expense_categ.id a = line.product_id.categ_id.property_account_expense_categ.id
if not a: if not a:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('Define expense account for this product: "%s" (id:%d).') % \ _('Define expense account for this product: "%s" (id:%d).') % \
(line.product_id.name, line.product_id.id,)) (line.product_id.name, line.product_id.id,))
else: else:

View File

@ -418,7 +418,7 @@ class sale_order(osv.osv):
[('type', '=', 'sale'), ('company_id', '=', order.company_id.id)], [('type', '=', 'sale'), ('company_id', '=', order.company_id.id)],
limit=1) limit=1)
if not journal_ids: if not journal_ids:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('Please define sales journal for this company: "%s" (id:%d).') % (order.company_id.name, order.company_id.id)) _('Please define sales journal for this company: "%s" (id:%d).') % (order.company_id.name, order.company_id.id))
invoice_vals = { invoice_vals = {
@ -600,7 +600,7 @@ class sale_order(osv.osv):
currency_id = o.pricelist_id.currency_id.id currency_id = o.pricelist_id.currency_id.id
if (o.partner_id.id in partner_currency) and (partner_currency[o.partner_id.id] <> currency_id): if (o.partner_id.id in partner_currency) and (partner_currency[o.partner_id.id] <> currency_id):
raise osv.except_osv( raise osv.except_osv(
_('Error !'), _('Error!'),
_('You cannot group sales having different currencies for the same partner.')) _('You cannot group sales having different currencies for the same partner.'))
partner_currency[o.partner_id.id] = currency_id partner_currency[o.partner_id.id] = currency_id
@ -750,7 +750,7 @@ class sale_order(osv.osv):
def action_wait(self, cr, uid, ids, context=None): def action_wait(self, cr, uid, ids, context=None):
for o in self.browse(cr, uid, ids): for o in self.browse(cr, uid, ids):
if not o.order_line: if not o.order_line:
raise osv.except_osv(_('Error !'),_('You cannot confirm a sale order which has no line.')) raise osv.except_osv(_('Error!'),_('You cannot confirm a sale order which has no line.'))
if (o.order_policy == 'manual'): if (o.order_policy == 'manual'):
self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': fields.date.context_today(self, cr, uid, context=context)}) self.write(cr, uid, [o.id], {'state': 'manual', 'date_confirm': fields.date.context_today(self, cr, uid, context=context)})
else: else:
@ -1192,7 +1192,7 @@ class sale_order_line(osv.osv):
if not account_id: if not account_id:
account_id = line.product_id.categ_id.property_account_income_categ.id account_id = line.product_id.categ_id.property_account_income_categ.id
if not account_id: if not account_id:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('Please define income account for this product: "%s" (id:%d).') % \ _('Please define income account for this product: "%s" (id:%d).') % \
(line.product_id.name, line.product_id.id,)) (line.product_id.name, line.product_id.id,))
else: else:
@ -1209,7 +1209,7 @@ class sale_order_line(osv.osv):
fpos = line.order_id.fiscal_position or False fpos = line.order_id.fiscal_position or False
account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, account_id) account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, fpos, account_id)
if not account_id: if not account_id:
raise osv.except_osv(_('Error !'), raise osv.except_osv(_('Error!'),
_('There is no Fiscal Position defined or Income category account defined for default properties of Product categories.')) _('There is no Fiscal Position defined or Income category account defined for default properties of Product categories.'))
return { return {
'name': line.name, 'name': line.name,

View File

@ -99,7 +99,7 @@ class sale_advance_payment_inv(osv.osv_memory):
for sale in sale_obj.browse(cr, uid, sale_ids, context=context): for sale in sale_obj.browse(cr, uid, sale_ids, context=context):
if sale.order_policy == 'postpaid': if sale.order_policy == 'postpaid':
raise osv.except_osv( raise osv.except_osv(
_('Error'), _('Error!'),
_("You cannot make an advance on a sales order \ _("You cannot make an advance on a sales order \
that is defined as 'Automatic Invoice after delivery'.")) that is defined as 'Automatic Invoice after delivery'."))

View File

@ -75,7 +75,7 @@ class stock_report_prodlots(osv.osv):
)""") )""")
def unlink(self, cr, uid, ids, context={}): def unlink(self, cr, uid, ids, context={}):
raise osv.except_osv(_('Error !'), _('You cannot delete any record!')) raise osv.except_osv(_('Error!'), _('You cannot delete any record!'))
stock_report_prodlots() stock_report_prodlots()
@ -132,7 +132,7 @@ class stock_report_tracklots(osv.osv):
)""") )""")
def unlink(self, cr, uid, ids, context={}): def unlink(self, cr, uid, ids, context={}):
raise osv.except_osv(_('Error !'), _('You cannot delete any record!')) raise osv.except_osv(_('Error!'), _('You cannot delete any record!'))
stock_report_tracklots() stock_report_tracklots()

View File

@ -516,7 +516,7 @@ class stock_tracking(osv.osv):
return res return res
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
raise osv.except_osv(_('Error'), _('You cannot remove a lot line.')) raise osv.except_osv(_('Error!'), _('You cannot remove a lot line.'))
def action_traceability(self, cr, uid, ids, context={}): def action_traceability(self, cr, uid, ids, context={}):
""" It traces the information of a product """ It traces the information of a product
@ -762,7 +762,7 @@ class stock_picking(osv.osv):
wf_service = netsvc.LocalService("workflow") wf_service = netsvc.LocalService("workflow")
for pick in self.browse(cr, uid, ids): for pick in self.browse(cr, uid, ids):
if not pick.move_lines: if not pick.move_lines:
raise osv.except_osv(_('Error !'),_('You cannot process picking without stock moves.')) raise osv.except_osv(_('Error!'),_('You cannot process picking without stock moves.'))
wf_service.trg_validate(uid, 'stock.picking', pick.id, wf_service.trg_validate(uid, 'stock.picking', pick.id,
'button_confirm', cr) 'button_confirm', cr)
return True return True
@ -1154,7 +1154,7 @@ class stock_picking(osv.osv):
return True return True
for move in pick.move_lines: for move in pick.move_lines:
if move.state == 'done': if move.state == 'done':
raise osv.except_osv(_('Error'), _('You cannot cancel picking because stock move is in done state!')) raise osv.except_osv(_('Error!'), _('You cannot cancel picking because stock move is in done state!'))
return True return True
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
move_obj = self.pool.get('stock.move') move_obj = self.pool.get('stock.move')
@ -1162,7 +1162,7 @@ class stock_picking(osv.osv):
context = {} context = {}
for pick in self.browse(cr, uid, ids, context=context): for pick in self.browse(cr, uid, ids, context=context):
if pick.state in ['done','cancel']: if pick.state in ['done','cancel']:
raise osv.except_osv(_('Error'), _('You cannot remove the picking which is in %s state!')%(pick.state,)) raise osv.except_osv(_('Error!'), _('You cannot remove the picking which is in %s state!')%(pick.state,))
else: else:
ids2 = [move.id for move in pick.move_lines] ids2 = [move.id for move in pick.move_lines]
ctx = context.copy() ctx = context.copy()

View File

@ -68,7 +68,7 @@ class stock_planning_createlines(osv.osv_memory):
prod_categ_ids = prod_categ_obj.search(cr,uid,[('parent_id','child_of',categ_ids)]) prod_categ_ids = prod_categ_obj.search(cr,uid,[('parent_id','child_of',categ_ids)])
products_id1 = product_obj.search(cr,uid,[('categ_id','in',prod_categ_ids)]) products_id1 = product_obj.search(cr,uid,[('categ_id','in',prod_categ_ids)])
if len(products_id1)==0: if len(products_id1)==0:
raise osv.except_osv(_('Error !'), _('No forecasts for selected period or no products available in selected category !')) raise osv.except_osv(_('Error!'), _('No forecasts for selected period or no products available in selected category !'))
for p in product_obj.browse(cr, uid, products_id1,context=context): for p in product_obj.browse(cr, uid, products_id1,context=context):
if len(planning_obj.search(cr, uid, [('product_id','=',p.id), if len(planning_obj.search(cr, uid, [('product_id','=',p.id),

View File

@ -55,7 +55,7 @@ class stock_sale_forecast_createlines(osv.osv_memory):
prod_categ_ids = prod_categ_obj.search(cr, uid, [('parent_id','child_of', categ_ids)]) prod_categ_ids = prod_categ_obj.search(cr, uid, [('parent_id','child_of', categ_ids)])
products_ids = product_obj.search(cr, uid, [('categ_id','in',prod_categ_ids)]) products_ids = product_obj.search(cr, uid, [('categ_id','in',prod_categ_ids)])
if len(products_ids) == 0: if len(products_ids) == 0:
raise osv.except_osv(_('Error !'), _('No products available in selected category !')) raise osv.except_osv(_('Error!'), _('No products available in selected category !'))
copy = f.copy_forecast copy = f.copy_forecast
for p in product_obj.browse(cr, uid, products_ids,{}): for p in product_obj.browse(cr, uid, products_ids,{}):
if len(forecast_obj.search(cr, uid, [('product_id','=',p.id) , \ if len(forecast_obj.search(cr, uid, [('product_id','=',p.id) , \

View File

@ -133,7 +133,7 @@ class subscription_subscription(osv.osv):
def unlink(self, cr, uid, ids, context=None): def unlink(self, cr, uid, ids, context=None):
for record in self.browse(cr, uid, ids, context or {}): for record in self.browse(cr, uid, ids, context or {}):
if record.state=="running": if record.state=="running":
raise osv.except_osv(_('Error !'),_('You cannot delete an active subscription !')) raise osv.except_osv(_('Error!'),_('You cannot delete an active subscription !'))
return super(subscription_subscription, self).unlink(cr, uid, ids, context) return super(subscription_subscription, self).unlink(cr, uid, ids, context)
def set_done(self, cr, uid, ids, context=None): def set_done(self, cr, uid, ids, context=None):