From b0e8ae4c7db5ac05656531d00d8cfe7e7768cd8c Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Tue, 7 Aug 2012 13:06:16 +0200 Subject: [PATCH] [IMP] error messages fix errors ending with an exclamation point; use a point instead remove uniques (or almost) error messages titles, like 'Encoding Error' (1 occurrence in addons), 'Integrity Error' (1 occurrence in addons), 'Report Name' (1 occurrence in addons), 'Value Error' (1 occurrence in addons), 'Wrong Period Code' (1 occurrence in addons); replace these with 'Error' add newline character after some messages titles, when necessary fix 'UserError': should be 'User Error' remove spaces before exclamation marks add capital letters to messages titles words (e.g.: 'Invalid action' becomes 'Invalid Action') bzr revid: abo@openerp.com-20120807110616-u3nlnybtgaebro18 --- addons/account/account.py | 58 ++++++++--------- addons/account/account_bank_statement.py | 32 +++++----- addons/account/account_invoice.py | 14 ++--- addons/account/account_move_line.py | 10 +-- .../account/test/account_bank_statement.yml | 2 +- .../wizard/account_automatic_reconcile.py | 2 +- .../wizard/account_fiscalyear_close.py | 6 +- addons/account/wizard/account_move_journal.py | 4 +- addons/account/wizard/account_period_close.py | 2 +- .../account_report_aged_partner_balance.py | 4 +- .../account_analytic_plans.py | 2 +- addons/account_coda/account_coda.py | 8 +-- addons/account_voucher/account_voucher.py | 2 +- .../bin/script/ModifyExistingReport.py | 2 +- .../bin/script/SendToServer.py | 8 +-- .../bin/script/ServerParameter.py | 2 +- .../wizard/hr_attendance_sign_in_out.py | 8 +-- .../wizard/hr_timesheet_sign_in_out.py | 4 +- .../wizard/hr_timesheet_invoice_create.py | 4 +- .../hr_timesheet_sheet/hr_timesheet_sheet.py | 40 ++++++------ addons/l10n_ch/report/report_webkit_html.py | 62 +++++++++---------- addons/l10n_ch/wizard/bvr_import.py | 30 ++++----- addons/mrp/mrp.py | 8 +-- addons/procurement/procurement.py | 6 +- addons/project_timesheet/project_timesheet.py | 6 +- addons/purchase/purchase.py | 32 +++++----- addons/sale/sale.py | 42 ++++++------- .../sale/wizard/sale_make_invoice_advance.py | 6 +- addons/stock/stock.py | 36 +++++------ addons/stock_planning/stock_planning.py | 20 +++--- 30 files changed, 231 insertions(+), 231 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 14eccafbc7b..e716028b138 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -404,7 +404,7 @@ class account_account(osv.osv): journal_obj = self.pool.get('account.journal') jids = journal_obj.search(cr, uid, [('type','=','situation'),('centralisation','=',1),('company_id','=',account.company_id.id)], context=context) if not jids: - raise osv.except_osv(_('Error!'),_("You need an Opening journal with centralisation checked to set the initial balance!")) + raise osv.except_osv(_('Error!'),_("You need an Opening journal with centralisation checked to set the initial balance.")) period_obj = self.pool.get('account.period') pids = period_obj.search(cr, uid, [('special','=',True),('company_id','=',account.company_id.id)], context=context) @@ -426,7 +426,7 @@ class account_account(osv.osv): }, context=context) else: if diff<0.0: - raise osv.except_osv(_('Error!'),_("Unable to adapt the initial balance (negative value)!")) + raise osv.except_osv(_('Error!'),_("Unable to adapt the initial balance (negative value).")) nameinv = (name=='credit' and 'debit') or 'credit' move_id = move_obj.create(cr, uid, { 'name': _('Opening Balance'), @@ -541,9 +541,9 @@ class account_account(osv.osv): return True _constraints = [ - (_check_recursion, 'Error ! You cannot create recursive accounts.', ['parent_id']), - (_check_type, 'Configuration Error! \nYou cannot define children to an account with internal type different of "View"! ', ['type']), - (_check_account_type, 'Configuration Error! \nYou cannot select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable"! ', ['user_type','type']), + (_check_recursion, 'Error!\nYou cannot create recursive accounts.', ['parent_id']), + (_check_type, 'Configuration Error!\nYou cannot define children to an account with internal type different of "View".', ['type']), + (_check_account_type, 'Configuration Error!\nYou cannot select an account type with a deferral method different of "Unreconciled" for accounts with internal type "Payable/Receivable".', ['user_type','type']), ] _sql_constraints = [ ('code_company_uniq', 'unique (code,company_id)', 'The code of the account must be unique per company !') @@ -619,9 +619,9 @@ class account_account(osv.osv): if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): if method == 'write': - raise osv.except_osv(_('Error !'), _('You cannot deactivate an account that contains journal items.')) + raise osv.except_osv(_('Error!'), _('You cannot deactivate an account that contains journal items.')) elif method == 'unlink': - raise osv.except_osv(_('Error !'), _('You cannot remove an account that contains journal items.')) + raise osv.except_osv(_('Error!'), _('You cannot remove an account that contains journal items.')) #Checking whether the account is set as a property to any Partner or not value = 'account.account,' + str(ids[0]) partner_prop_acc = self.pool.get('ir.property').search(cr, uid, [('value_reference','=',value)], context=context) @@ -768,7 +768,7 @@ class account_journal(osv.osv): return True _constraints = [ - (_check_currency, 'Configuration error! The currency chosen should be shared by the default accounts too.', ['currency','default_debit_account_id','default_credit_account_id']), + (_check_currency, 'Configuration error!\nThe currency chosen should be shared by the default accounts too.', ['currency','default_debit_account_id','default_credit_account_id']), ] def copy(self, cr, uid, id, default={}, context=None, done_list=[], local=False): @@ -915,7 +915,7 @@ class account_fiscalyear(osv.osv): return True _constraints = [ - (_check_duration, 'Error! The start date of a fiscal year must precede its end date.', ['date_start','date_stop']) + (_check_duration, 'Error!\nThe start date of a fiscal year must precede its end date.', ['date_start','date_stop']) ] def create_period3(self, cr, uid, ids, context=None): @@ -966,7 +966,7 @@ class account_fiscalyear(osv.osv): ids = self.search(cr, uid, args, context=context) if not ids: if exception: - raise osv.except_osv(_('Error !'), _('There is no fiscal year defined for this date.\nPlease create one from the configuration of the accounting menu.')) + raise osv.except_osv(_('Error!'), _('There is no fiscal year defined for this date.\nPlease create one from the configuration of the accounting menu.')) else: return [] return ids @@ -1032,8 +1032,8 @@ class account_period(osv.osv): return True _constraints = [ - (_check_duration, 'Error ! The duration of the Period(s) is/are invalid. ', ['date_stop']), - (_check_year_limit, 'Error ! The period is invalid. Either some periods are overlapping or the period\'s dates are not matching the scope of the fiscal year.', ['date_stop']) + (_check_duration, 'Error!\nThe duration of the Period(s) is/are invalid.', ['date_stop']), + (_check_year_limit, 'Error!\nThe period is invalid. Either some periods are overlapping or the period\'s dates are not matching the scope of the fiscal year.', ['date_stop']) ] def next(self, cr, uid, period, step, context=None): @@ -1055,7 +1055,7 @@ class account_period(osv.osv): args.append(('company_id', '=', company_id)) ids = self.search(cr, uid, args, context=context) if not ids: - raise osv.except_osv(_('Error !'), _('There is no period defined for this date: %s.\nPlease create one.')%dt) + raise osv.except_osv(_('Error!'), _('There is no period defined for this date: %s.\nPlease create one.')%dt) return ids def action_draft(self, cr, uid, ids, *args): @@ -1134,7 +1134,7 @@ class account_journal_period(osv.osv): cr.execute('select * from account_move_line where journal_id=%s and period_id=%s limit 1', (obj.journal_id.id, obj.period_id.id)) res = cr.fetchall() if res: - raise osv.except_osv(_('Error !'), _('You cannot modify/delete a journal with entries for this period.')) + raise osv.except_osv(_('Error!'), _('You cannot modify/delete a journal with entries for this period.')) return True def write(self, cr, uid, ids, vals, context=None): @@ -1314,7 +1314,7 @@ class account_move(osv.osv): valid_moves = self.validate(cr, uid, ids, context) if not valid_moves: - raise osv.except_osv(_('Integrity Error !'), _('You cannot validate a non-balanced entry.\nMake sure you have configured payment terms properly.\nThe latest payment term line should be of the "Balance" type.')) + raise osv.except_osv(_('Error!'), _('You cannot validate a non-balanced entry.\nMake sure you have configured payment terms properly.\nThe latest payment term line should be of the "Balance" type.')) obj_sequence = self.pool.get('ir.sequence') for move in self.browse(cr, uid, valid_moves, context=context): if move.name =='/': @@ -1328,7 +1328,7 @@ class account_move(osv.osv): c = {'fiscalyear_id': move.period_id.fiscalyear_id.id} new_name = obj_sequence.next_by_id(cr, uid, journal.sequence_id.id, c) else: - raise osv.except_osv(_('Error !'), _('Please define a sequence on the journal.')) + raise osv.except_osv(_('Error!'), _('Please define a sequence on the journal.')) if new_name: self.write(cr, uid, [move.id], {'name':new_name}) @@ -1351,14 +1351,14 @@ class account_move(osv.osv): if not top_common: top_common = top_account elif top_account.id != top_common.id: - raise osv.except_osv(_('Error !'), - _('You cannot validate this journal entry because account "%s" does not belong to chart of accounts "%s"!') % (account.name, top_common.name)) + raise osv.except_osv(_('Error!'), + _('You cannot validate this journal entry because account "%s" does not belong to chart of accounts "%s".') % (account.name, top_common.name)) return self.post(cursor, user, ids, context=context) def button_cancel(self, cr, uid, ids, context=None): for line in self.browse(cr, uid, ids, context=context): if not line.journal_id.update_posted: - raise osv.except_osv(_('Error !'), _('You cannot modify a posted entry of this journal.\nFirst you should set the journal to allow cancelling entries.')) + raise osv.except_osv(_('Error!'), _('You cannot modify a posted entry of this journal.\nFirst you should set the journal to allow cancelling entries.')) if ids: cr.execute('UPDATE account_move '\ 'SET state=%s '\ @@ -1445,7 +1445,7 @@ class account_move(osv.osv): obj_move_line = self.pool.get('account.move.line') for move in self.browse(cr, uid, ids, context=context): if move['state'] != 'draft': - raise osv.except_osv(_('UserError!'), + raise osv.except_osv(_('User Error!'), _('You cannot delete a posted journal entry "%s".') % \ move['name']) line_ids = map(lambda x: x.id, move.line_id) @@ -1474,14 +1474,14 @@ class account_move(osv.osv): account_id = move.journal_id.default_debit_account_id.id mode2 = 'debit' if not account_id: - raise osv.except_osv(_('UserError'), + raise osv.except_osv(_('User Error!'), _('There is no default debit account defined \n' \ 'on journal "%s".') % move.journal_id.name) else: account_id = move.journal_id.default_credit_account_id.id mode2 = 'credit' if not account_id: - raise osv.except_osv(_('UserError'), + raise osv.except_osv(_('User Error!'), _('There is no default credit account defined \n' \ 'on journal "%s".') % move.journal_id.name) @@ -1833,7 +1833,7 @@ class account_tax_code(osv.osv): _check_recursion = check_cycle _constraints = [ - (_check_recursion, 'Error ! You cannot create recursive accounts.', ['parent_id']) + (_check_recursion, 'Error!\nYou cannot create recursive accounts.', ['parent_id']) ] _order = 'code' @@ -2307,7 +2307,7 @@ class account_model(osv.osv): date_maturity = context.get('date',time.strftime('%Y-%m-%d')) if line.date_maturity == 'partner': if not line.partner_id: - raise osv.except_osv(_('Error !'), _("Maturity date of entry line generated by model line '%s' of model '%s' is based on partner payment term!" \ + raise osv.except_osv(_('Error!'), _("Maturity date of entry line generated by model line '%s' of model '%s' is based on partner payment term!" \ "\nPlease define partner on it!")%(line.name, model.name)) if line.partner_id.property_payment_term: payment_term_id = line.partner_id.property_payment_term.id @@ -2521,8 +2521,8 @@ class account_account_template(osv.osv): _check_recursion = check_cycle _constraints = [ - (_check_recursion, 'Error ! You cannot create recursive account templates.', ['parent_id']), - (_check_type, 'Configuration Error!\nYou cannot define children to an account that has internal type other than "View"!', ['type']), + (_check_recursion, 'Error!\nYou cannot create recursive account templates.', ['parent_id']), + (_check_type, 'Configuration Error!\nYou cannot define children to an account that has internal type other than "View".', ['type']), ] @@ -2623,7 +2623,7 @@ class account_add_tmpl_wizard(osv.osv_memory): ptids = tmpl_obj.read(cr, uid, [tids[0]['parent_id'][0]], ['code']) res = None if not ptids or not ptids[0]['code']: - raise osv.except_osv(_('Error !'), _('There is no parent code for the template account.')) + raise osv.except_osv(_('Error!'), _('There is no parent code for the template account.')) res = acc_obj.search(cr, uid, [('code','=',ptids[0]['code'])]) return res and res[0] or False @@ -2729,7 +2729,7 @@ class account_tax_code_template(osv.osv): _check_recursion = check_cycle _constraints = [ - (_check_recursion, 'Error ! You cannot create recursive Tax Codes.', ['parent_id']) + (_check_recursion, 'Error!\nYou cannot create recursive Tax Codes.', ['parent_id']) ] _order = 'code,name' account_tax_code_template() @@ -3464,7 +3464,7 @@ class wizard_multi_charts_accounts(osv.osv_memory): journal_data.append(vals) ref_acc_bank = obj_wizard.chart_template_id.bank_account_view_id if journal_data and not ref_acc_bank.code: - raise osv.except_osv(_('Configuration Error !'), _('You have to set a code for the bank account defined on the selected chart of accounts.')) + raise osv.except_osv(_('Configuration Error!'), _('You have to set a code for the bank account defined on the selected chart of accounts.')) current_num = 1 for line in journal_data: diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 11bcf565260..1011abb7727 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -192,11 +192,11 @@ class account_bank_statement(osv.osv): 'ref': st_line.ref, } - def _prepare_bank_move_line(self, cr, uid, st_line, move_id, amount, company_currency_id, + def _prepare_bank_move_line(self, cr, uid, st_line, move_id, amount, company_currency_id, context=None): """Compute the args to build the dict of values to create the bank move line from a - statement line by calling the _prepare_move_line_vals. This method may be - overridden to implement custom move generation (making sure to call super() to + statement line by calling the _prepare_move_line_vals. This method may be + overridden to implement custom move generation (making sure to call super() to establish a clean extension chain). :param browse_record st_line: account.bank.statement.line record to @@ -219,12 +219,12 @@ class account_bank_statement(osv.osv): res_currency_obj = self.pool.get('res.currency') amt_cur = -res_currency_obj.compute(cr, uid, company_currency_id, cur_id, amount, context=context) - res = self._prepare_move_line_vals(cr, uid, st_line, move_id, debit, credit, + res = self._prepare_move_line_vals(cr, uid, st_line, move_id, debit, credit, amount_currency=amt_cur, currency_id=cur_id, analytic_id=anl_id, context=context) return res def _get_counter_part_account(sefl, cr, uid, st_line, context=None): - """Retrieve the account to use in the counterpart move. + """Retrieve the account to use in the counterpart move. This method may be overridden to implement custom move generation (making sure to call super() to establish a clean extension chain). @@ -237,7 +237,7 @@ class account_bank_statement(osv.osv): return st_line.statement_id.journal_id.default_debit_account_id.id def _get_counter_part_partner(sefl, cr, uid, st_line, context=None): - """Retrieve the partner to use in the counterpart move. + """Retrieve the partner to use in the counterpart move. This method may be overridden to implement custom move generation (making sure to call super() to establish a clean extension chain). @@ -247,11 +247,11 @@ class account_bank_statement(osv.osv): """ return st_line.partner_id and st_line.partner_id.id or False - def _prepare_counterpart_move_line(self, cr, uid, st_line, move_id, amount, company_currency_id, + def _prepare_counterpart_move_line(self, cr, uid, st_line, move_id, amount, company_currency_id, context=None): """Compute the args to build the dict of values to create the counter part move line from a - statement line by calling the _prepare_move_line_vals. This method may be - overridden to implement custom move generation (making sure to call super() to + statement line by calling the _prepare_move_line_vals. This method may be + overridden to implement custom move generation (making sure to call super() to establish a clean extension chain). :param browse_record st_line: account.bank.statement.line record to @@ -271,12 +271,12 @@ class account_bank_statement(osv.osv): if st_line.statement_id.currency.id <> company_currency_id: amt_cur = st_line.amount cur_id = st_line.statement_id.currency.id - return self._prepare_move_line_vals(cr, uid, st_line, move_id, debit, credit, + return self._prepare_move_line_vals(cr, uid, st_line, move_id, debit, credit, amount_currency = amt_cur, currency_id = cur_id, account_id = account_id, partner_id = partner_id, context=context) def _prepare_move_line_vals(self, cr, uid, st_line, move_id, debit, credit, currency_id = False, - amount_currency= False, account_id = False, analytic_id = False, + amount_currency= False, account_id = False, analytic_id = False, partner_id = False, context=None): """Prepare the dict of values to create the move line from a statement line. All non-mandatory args will replace the default computed one. @@ -350,12 +350,12 @@ class account_bank_statement(osv.osv): amount = res_currency_obj.compute(cr, uid, st.currency.id, company_currency_id, st_line.amount, context=context) - bank_move_vals = self._prepare_bank_move_line(cr, uid, st_line, move_id, amount, + bank_move_vals = self._prepare_bank_move_line(cr, uid, st_line, move_id, amount, company_currency_id, context=context) move_line_id = account_move_line_obj.create(cr, uid, bank_move_vals, context=context) torec.append(move_line_id) - counterpart_move_vals = self._prepare_counterpart_move_line(cr, uid, st_line, move_id, + counterpart_move_vals = self._prepare_counterpart_move_line(cr, uid, st_line, move_id, amount, company_currency_id, context=context) account_move_line_obj.create(cr, uid, counterpart_move_vals, context=context) @@ -401,7 +401,7 @@ class account_bank_statement(osv.osv): self.balance_check(cr, uid, st.id, journal_type=j_type, context=context) if (not st.journal_id.default_credit_account_id) \ or (not st.journal_id.default_debit_account_id): - raise osv.except_osv(_('Configuration Error !'), + raise osv.except_osv(_('Configuration Error!'), _('Please verify that an account is defined in the journal.')) if not st.name == '/': @@ -445,7 +445,7 @@ class account_bank_statement(osv.osv): account_move_obj.unlink(cr, uid, ids, context) done.append(st.id) return self.write(cr, uid, done, {'state':'draft'}, context=context) - + def _compute_balance_end_real(self, cr, uid, journal_id, context=None): cr.execute('SELECT balance_end_real \ FROM account_bank_statement \ @@ -469,7 +469,7 @@ class account_bank_statement(osv.osv): if t['state'] in ('draft'): unlink_ids.append(t['id']) else: - raise osv.except_osv(_('Invalid action !'), _('In order to delete a bank statement, you must first cancel it to delete related journal items.')) + raise osv.except_osv(_('Invalid Action!'), _('In order to delete a bank statement, you must first cancel it to delete related journal items.')) osv.osv.unlink(self, cr, uid, unlink_ids, context=context) return True diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 7786750abda..7c1607cb73e 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -425,7 +425,7 @@ class account_invoice(osv.osv): if t['state'] in ('draft', 'cancel') and t['internal_number']== False: unlink_ids.append(t['id']) else: - raise osv.except_osv(_('Invalid action !'), _('You cannot delete an invoice which is open or paid. You should refund it instead.')) + raise osv.except_osv(_('Invalid Action!'), _('You cannot delete an invoice which is open or paid. You should refund it instead.')) osv.osv.unlink(self, cr, uid, unlink_ids, context=context) return True @@ -458,7 +458,7 @@ class account_invoice(osv.osv): rec_res_id = rec_line_data and rec_line_data[0].get('value_reference',False) and int(rec_line_data[0]['value_reference'].split(',')[1]) or False 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 !'), + raise osv.except_osv(_('Configuration Error!'), _('Cannot find a chart of accounts for this company, you should create one.')) account_obj = self.pool.get('account.account') rec_obj_acc = account_obj.browse(cr, uid, [rec_res_id]) @@ -553,7 +553,7 @@ class account_invoice(osv.osv): rec_res_id = rec_line_data and rec_line_data[0].get('value_reference',False) and int(rec_line_data[0]['value_reference'].split(',')[1]) or False 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 !'), + raise osv.except_osv(_('Configuration Error!'), _('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 @@ -568,7 +568,7 @@ class account_invoice(osv.osv): if line.account_id.company_id.id != company_id: 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 !'), + raise osv.except_osv(_('Configuration Error!'), _('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: @@ -576,7 +576,7 @@ class account_invoice(osv.osv): for inv_line in invoice_line: 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 !'), + raise osv.except_osv(_('Configuration Error!'), _('Invoice line account\'s company and invoice\'s compnay does not match.')) else: continue @@ -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 !'), (_('Cannot find any account journal of %s type for this company.\n\nYou can create one in the menu: \nConfiguration\Journals\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, []) @@ -947,7 +947,7 @@ class account_invoice(osv.osv): journal_id = inv.journal_id.id journal = journal_obj.browse(cr, uid, journal_id, context=ctx) if journal.centralisation: - raise osv.except_osv(_('UserError'), + raise osv.except_osv(_('User Error!'), _('You cannot create an invoice on a centralized journal. Uncheck the centralized counterpart box in the related journal from the configuration menu.')) line = self.finalize_invoice_move_lines(cr, uid, inv, line) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 6ce15529842..ad4c023b919 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1090,7 +1090,7 @@ class account_move_line(osv.osv): res = cr.fetchone() if res: if res[1] != 'draft': - raise osv.except_osv(_('UserError!'), + raise osv.except_osv(_('User Error!'), _('The account move (%s) for centralisation ' \ 'has been confirmed.') % res[2]) return res @@ -1141,7 +1141,7 @@ class account_move_line(osv.osv): if vals.get('account_tax_id', False): raise osv.except_osv(_('Unable to change tax!'), _('You cannot change the tax, you should remove and recreate lines.')) if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']: - raise osv.except_osv(_('Bad account!'), _('You cannot use an inactive account.')) + raise osv.except_osv(_('Bad Account!'), _('You cannot use an inactive account.')) if update_check: if ('account_id' in vals) or ('journal_id' in vals) or ('period_id' in vals) or ('move_id' in vals) or ('debit' in vals) or ('credit' in vals) or ('date' in vals): self._update_check(cr, uid, ids, context) @@ -1224,7 +1224,7 @@ class account_move_line(osv.osv): if company_id: vals['company_id'] = company_id[0] if ('account_id' in vals) and not account_obj.read(cr, uid, vals['account_id'], ['active'])['active']: - raise osv.except_osv(_('Bad account!'), _('You cannot use an inactive account.')) + raise osv.except_osv(_('Bad Account!'), _('You cannot use an inactive account.')) if 'journal_id' in vals: context['journal_id'] = vals['journal_id'] if 'period_id' in vals: @@ -1237,7 +1237,7 @@ class account_move_line(osv.osv): if 'period_id' not in context or not isinstance(context.get('period_id', ''), (int, long)): period_candidate_ids = self.pool.get('account.period').name_search(cr, uid, name=context.get('period_id','')) if len(period_candidate_ids) != 1: - raise osv.except_osv(_('Encoding error!'), _('No period found or more than one period found for the given date.')) + raise osv.except_osv(_('Error!'), _('No period found or more than one period found for the given date.')) context['period_id'] = period_candidate_ids[0][0] if not context.get('journal_id', False) and context.get('search_default_journal_id', False): context['journal_id'] = context.get('search_default_journal_id') @@ -1288,7 +1288,7 @@ class account_move_line(osv.osv): vals['amount_currency'] = cur_obj.compute(cr, uid, account.company_id.currency_id.id, account.currency_id.id, vals.get('debit', 0.0)-vals.get('credit', 0.0), context=ctx) if not ok: - raise osv.except_osv(_('Bad account !'), _('You cannot use this general account in this journal, check the tab \'Entry Controls\' on the related journal.')) + raise osv.except_osv(_('Bad Account!'), _('You cannot use this general account in this journal, check the tab \'Entry Controls\' on the related journal.')) if vals.get('analytic_account_id',False): if journal.analytic_journal_id: diff --git a/addons/account/test/account_bank_statement.yml b/addons/account/test/account_bank_statement.yml index 37789f3ad66..89d0b493444 100644 --- a/addons/account/test/account_bank_statement.yml +++ b/addons/account/test/account_bank_statement.yml @@ -70,4 +70,4 @@ try: self.button_cancel(cr, uid, [ref("account_bank_statement_0")]) except Exception, e: - assert e[0]=='UserError', 'Another exception has been raised!' + assert e[0]=='User Error!', 'Another exception has been raised!' diff --git a/addons/account/wizard/account_automatic_reconcile.py b/addons/account/wizard/account_automatic_reconcile.py index 8b09dbe3a20..b4355e79129 100644 --- a/addons/account/wizard/account_automatic_reconcile.py +++ b/addons/account/wizard/account_automatic_reconcile.py @@ -145,7 +145,7 @@ class account_automatic_reconcile(osv.osv_memory): allow_write_off = form.allow_write_off reconciled = unreconciled = 0 if not form.account_ids: - raise osv.except_osv(_('UserError!'), _('You must select accounts to reconcile.')) + raise osv.except_osv(_('User Error!'), _('You must select accounts to reconcile.')) for account_id in form.account_ids: params = (account_id.id,) if not allow_write_off: diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index a79f9b22770..3202a17fca5 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -85,7 +85,7 @@ class account_fiscalyear_close(osv.osv_memory): fy2_period_set = ','.join(map(lambda id: str(id[0]), cr.fetchall())) if not fy_period_set or not fy2_period_set: - raise osv.except_osv(_('UserError!'), _('The periods to generate opening entries cannot be found.')) + raise osv.except_osv(_('User Error!'), _('The periods to generate opening entries cannot be found.')) period = obj_acc_period.browse(cr, uid, data[0].period_id.id, context=context) new_fyear = obj_acc_fiscalyear.browse(cr, uid, data[0].fy2_id.id, context=context) @@ -96,10 +96,10 @@ class account_fiscalyear_close(osv.osv_memory): company_id = new_journal.company_id.id if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id: - raise osv.except_osv(_('UserError!'), + raise osv.except_osv(_('User Error!'), _('The journal must have default credit and debit account.')) if (not new_journal.centralisation) or new_journal.entry_posted: - raise osv.except_osv(_('UserError!'), + raise osv.except_osv(_('User Error!'), _('The journal must have centralized counterpart without the Skipping draft state option checked.')) #delete existing move and move lines if any diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py index f14e8c555e6..1353efca1f5 100644 --- a/addons/account/wizard/account_move_journal.py +++ b/addons/account/wizard/account_move_journal.py @@ -60,7 +60,7 @@ class account_move_journal(osv.osv_memory): if context.get('journal_type', False): jids = journal_pool.search(cr, uid, [('type','=', context.get('journal_type'))]) if not jids: - 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.') % context.get('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.') % context.get('journal_type')) journal_id = jids[0] return journal_id @@ -158,7 +158,7 @@ class account_move_journal(osv.osv_memory): state = period.state if state == 'done': - raise osv.except_osv(_('UserError!'), _('This period is already closed.')) + raise osv.except_osv(_('User Error!'), _('This period is already closed.')) company = period.company_id.id res = { diff --git a/addons/account/wizard/account_period_close.py b/addons/account/wizard/account_period_close.py index b2c61d9197a..086485ac0f2 100644 --- a/addons/account/wizard/account_period_close.py +++ b/addons/account/wizard/account_period_close.py @@ -48,7 +48,7 @@ class account_period_close(osv.osv_memory): for id in context['active_ids']: account_move_ids = account_move_obj.search(cr, uid, [('period_id', '=', id), ('state', '=', "draft")], context=context) if account_move_ids: - raise osv.except_osv(_('Invalid action !'), _('In order to close a period, you must first post related journal entries.')) + raise osv.except_osv(_('Invalid Action!'), _('In order to close a period, you must first post related journal entries.')) cr.execute('update account_journal_period set state=%s where period_id=%s', (mode, id)) cr.execute('update account_period set state=%s where id=%s', (mode, id)) diff --git a/addons/account/wizard/account_report_aged_partner_balance.py b/addons/account/wizard/account_report_aged_partner_balance.py index ddc8724256c..c4167322b90 100644 --- a/addons/account/wizard/account_report_aged_partner_balance.py +++ b/addons/account/wizard/account_report_aged_partner_balance.py @@ -53,9 +53,9 @@ 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 set a period length greater than 0.')) + raise osv.except_osv(_('User Error!'), _('You must set a period length greater than 0.')) if not data['form']['date_from']: - raise osv.except_osv(_('UserError!'), _('You must set a start date.')) + raise osv.except_osv(_('User Error!'), _('You must set a start date.')) start = datetime.strptime(data['form']['date_from'], "%Y-%m-%d") diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index f3998492a5c..234d6fe0cf8 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -231,7 +231,7 @@ class account_analytic_plan_instance(osv.osv): if acct_anal_acct.search(cr, uid, [('parent_id', 'child_of', [item.root_analytic_id.id]), ('id', '=', tempo[2]['analytic_account_id'])], context=context): total_per_plan += tempo[2]['rate'] if total_per_plan < item.min_required or total_per_plan > item.max_required: - raise osv.except_osv(_('Value Error!'),_('The total should be between %s and %s.') % (str(item.min_required), str(item.max_required))) + raise osv.except_osv(_('Error!'),_('The total should be between %s and %s.') % (str(item.min_required), str(item.max_required))) return super(account_analytic_plan_instance, self).create(cr, uid, vals, context=context) diff --git a/addons/account_coda/account_coda.py b/addons/account_coda/account_coda.py index 2b08b3fcd2d..cd117b5be88 100644 --- a/addons/account_coda/account_coda.py +++ b/addons/account_coda/account_coda.py @@ -293,10 +293,10 @@ class coda_bank_statement(osv.osv): # unlink CODA banks statements as well as associated bank statements and CODA files for coda_statement in self.browse(cr, uid, new_ids, context=context): if coda_statement.statement_id.state == 'confirm': - raise osv.except_osv(_('Invalid action !'), - _("Cannot delete CODA Bank Statement '%s' of Journal '%s'." \ - "\nThe associated Bank Statement has already been confirmed !" \ - "\nPlease undo this action first!") \ + raise osv.except_osv(_('Invalid Action!'), + _("Cannot delete CODA Bank Statement '%s' of journal '%s'." \ + "\nThe associated Bank Statement has already been confirmed." \ + "\nPlease undo this action first.") \ % (coda_statement.name, coda_statement.journal_id.name)) else: if not context.get('coda_unlink', False): diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 490cd34e47c..2b2c0c5d200 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -822,7 +822,7 @@ class account_voucher(osv.osv): def unlink(self, cr, uid, ids, context=None): for t in self.read(cr, uid, ids, ['state'], context=context): if t['state'] not in ('draft', 'cancel'): - raise osv.except_osv(_('Invalid Action !'), _('Cannot delete voucher(s) which are already opened or paid.')) + raise osv.except_osv(_('Invalid Action!'), _('Cannot delete voucher(s) which are already opened or paid.')) return super(account_voucher, self).unlink(cr, uid, ids, context=context) def onchange_payment(self, cr, uid, ids, pay_now, journal_id, partner_id, ttype='sale'): diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py index b463bfa41e2..ebe2650575d 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ModifyExistingReport.py @@ -92,7 +92,7 @@ class ModifyExistingReport(unohelper.Base, XJobExecutor): ids = self.sock.execute(database, uid, self.password, 'ir.module.module', 'search', [('name','=','base_report_designer'),('state', '=', 'installed')]) if not len(ids): - ErrorDialog("Please install base_report_designer module.", "", "Module Uninstalled Error !") + ErrorDialog("Please install base_report_designer module.", "", "Module Uninstalled Error!") exit(1) ids = self.sock.execute(database, uid, self.password, 'ir.actions.report.xml', 'search', [('report_xsl', '=', False),('report_xml', '=', False)]) diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py index 2b11555c0af..d32f7aa6c20 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/SendToServer.py @@ -91,7 +91,7 @@ class SendtoServer(unohelper.Base, XJobExecutor): self.ids = self.sock.execute(database, uid, self.password, 'ir.module.module', 'search', [('name','=','base_report_designer'),('state', '=', 'installed')]) if not len(self.ids): - ErrorDialog("Please install base_report_designer module.", "", "Module Uninstalled Error !") + ErrorDialog("Please install base_report_designer module.", "", "Module Uninstalled Error!") exit(1) report_name = "" @@ -170,7 +170,7 @@ class SendtoServer(unohelper.Base, XJobExecutor): } res = self.sock.execute(database, uid, self.password, 'ir.values' , 'create',rec ) else : - ErrorDialog("This name is already used for another report.\nPlease try with another name.", "", "Report Name !") + ErrorDialog("This name is already used for another report.\nPlease try with another name.", "", "Error!") self.logobj.log_write('SendToServer',LOG_WARNING, ': report name already used DB %s' % (database)) self.win.endExecute() except Exception,e: @@ -203,8 +203,8 @@ class SendtoServer(unohelper.Base, XJobExecutor): self.logobj.log_write('SendToServer',LOG_INFO, ':Report %s successfully send using %s'%(params['name'],database)) self.win.endExecute() else: - ErrorDialog("Either report name or technical name is blank.\nPlease specify an appropriate name.","","Blank Field Error !") - self.logobj.log_write('SendToServer',LOG_WARNING, ': either report name or technical name is blank.') + ErrorDialog("Either report name or technical name is empty.\nPlease specify an appropriate name.", "", "Error!") + self.logobj.log_write('SendToServer',LOG_WARNING, ': either report name or technical name is empty.') self.win.endExecute() def getID(self): diff --git a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py index 399e52819f3..ba9817ca20a 100644 --- a/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py +++ b/addons/base_report_designer/plugin/openerp_report_designer/bin/script/ServerParameter.py @@ -133,7 +133,7 @@ class ServerParameter( unohelper.Base, XJobExecutor ): # self.win.endExecute() ids_module =self.sock.execute(sDatabase, UID, sPassword, 'ir.module.module', 'search', [('name','=','base_report_designer'),('state', '=', 'installed')]) if not len(ids_module): - ErrorDialog("Please install base_report_designer module.", "", "Module Uninstalled Error !") + ErrorDialog("Please install base_report_designer module.", "", "Module Uninstalled Error!") self.logobj.log_write('Module not found.',LOG_WARNING, ': base_report_designer not installed in database %s.' % (sDatabase)) #self.win.endExecute() else: diff --git a/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py index c5af93ef49c..0ad4323ad78 100644 --- a/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py +++ b/addons/hr_attendance/wizard/hr_attendance_sign_in_out.py @@ -158,25 +158,25 @@ class hr_sign_in_out(osv.osv_memory): emp_id = data['emp_id'] if 'last_time' in data: if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'): - raise osv.except_osv(_('UserError !'), _('The sign-out date must be in the past.')) + raise osv.except_osv(_('User Error!'), _('The sign-out date must be in the past.')) self.pool.get('hr.attendance').create(cr, uid, {'name': data['last_time'], 'action': 'sign_out', 'employee_id': emp_id}, context=context) try: self.pool.get('hr.employee').attendance_action_change(cr, uid, [emp_id], 'sign_in') except: - raise osv.except_osv(_('UserError !'), _('A sign-in must be right after a sign-out!')) + raise osv.except_osv(_('User Error!'), _('A sign-in must be right after a sign-out!')) return {'type': 'ir.actions.act_window_close'} # To do: Return Success message def sign_out(self, cr, uid, data, context=None): emp_id = data['emp_id'] if 'last_time' in data: if data['last_time'] > time.strftime('%Y-%m-%d %H:%M:%S'): - raise osv.except_osv(_('UserError !'), _('The sign-in date must be in the past.')) + raise osv.except_osv(_('User Error!'), _('The sign-in date must be in the past.')) self.pool.get('hr.attendance').create(cr, uid, {'name':data['last_time'], 'action':'sign_in', 'employee_id':emp_id}, context=context) try: self.pool.get('hr.employee').attendance_action_change(cr, uid, [emp_id], 'sign_out') except: - raise osv.except_osv(_('UserError !'), _('A sign-out must be right after a sign-in!')) + raise osv.except_osv(_('User Error!'), _('A sign-out must be right after a sign-in.')) return {'type': 'ir.actions.act_window_close'} # To do: Return Success message hr_sign_in_out() diff --git a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py index 30708c43e97..34cfee40262 100644 --- a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py +++ b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py @@ -74,7 +74,7 @@ class hr_so_project(osv.osv_memory): res = timesheet_obj.default_get(cr, uid, ['product_id','product_uom_id'], context=context) if not res['product_uom_id']: - raise osv.except_osv(_('UserError !'), _('Please define cost unit for this employee!')) + raise osv.except_osv(_('User Error!'), _('Please define cost unit for this employee.')) up = timesheet_obj.on_change_unit_amount(cr, uid, False, res['product_id'], hour,False, res['product_uom_id'])['value'] res['name'] = data['info'] @@ -129,7 +129,7 @@ class hr_si_project(osv.osv_memory): emp_obj = self.pool.get('hr.employee') emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context) if not emp_id: - raise osv.except_osv(_('UserError !'), _('Please define employee for your user!')) + raise osv.except_osv(_('User Error!'), _('Please define employee for your user.')) return False def check_state(self, cr, uid, ids, context=None): diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 618e55407df..7a03b9bb8af 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -103,7 +103,7 @@ class account_analytic_line(osv.osv): 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)) 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: factor_name += ' - ' + factor.customer_name @@ -119,7 +119,7 @@ class account_analytic_line(osv.osv): tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes) account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id if not account_id: - raise osv.except_osv(_("Configuration Error !"), _("Please define income account for product '%s'.") % product.name) + raise osv.except_osv(_("Configuration Error!"), _("Please define income account for product '%s'.") % product.name) curr_line = { 'price_unit': price, 'quantity': qty, diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 73a4368caaf..ca28b5bdb28 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -234,33 +234,33 @@ class hr_timesheet_sheet(osv.osv): ids_signout = self.pool.get('hr.attendance').search(cr,uid,[('sheet_id', '=', sheet_id),('action','=','sign_out')]) if len(ids_signin) != len(ids_signout): - raise osv.except_osv(('Warning !'),_('The timesheet cannot be validated as it does not contain an equal number of sign ins and sign outs!')) + raise osv.except_osv(('Warning!'),_('The timesheet cannot be validated as it does not contain an equal number of sign ins and sign outs.')) return True def copy(self, cr, uid, ids, *args, **argv): - raise osv.except_osv(_('Error !'), _('You cannot duplicate a timesheet!')) + raise osv.except_osv(_('Error!'), _('You cannot duplicate a timesheet.')) def create(self, cr, uid, vals, *args, **argv): if 'employee_id' in vals: if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id: - raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must assign it to a user!')) + raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.')) if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id: - raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must link the employee to a product, like \'Consultant\'!')) + raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product, like \'Consultant\'.')) if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id: - raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal, like \'Timesheet\'!')) + raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal, like \'Timesheet\'.')) return super(hr_timesheet_sheet, self).create(cr, uid, vals, *args, **argv) def write(self, cr, uid, ids, vals, *args, **argv): if 'employee_id' in vals: new_user_id = self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).user_id.id or False if not new_user_id: - raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must assign it to a user!')) + raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.')) if not self._sheet_date(cr, uid, ids, forced_user_id=new_user_id): - raise osv.except_osv(_('Error !'), _('You cannot have 2 timesheets that overlaps!\nYou should use the menu \'My Timesheet\' to avoid this problem.')) + raise osv.except_osv(_('Error!'), _('You cannot have 2 timesheets that overlaps!\nYou should use the menu \'My Timesheet\' to avoid this problem.')) if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id: - raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must link the employee to a product!')) + raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product.')) if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id: - raise osv.except_osv(_('Error !'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal!')) + raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign the employee to an analytic journal.')) return super(hr_timesheet_sheet, self).write(cr, uid, ids, vals, *args, **argv) def button_confirm(self, cr, uid, ids, context=None): @@ -271,7 +271,7 @@ class hr_timesheet_sheet(osv.osv): wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr) else: - raise osv.except_osv(_('Warning !'), _('Please verify that the total difference of the sheet is lower than %.2f!') %(di,)) + raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,)) return True def date_today(self, cr, uid, ids, context=None): @@ -315,7 +315,7 @@ class hr_timesheet_sheet(osv.osv): def check_sign(self, cr, uid, ids, typ, context=None): sheet = self.browse(cr, uid, ids, context=context)[0] if not sheet.date_current == time.strftime('%Y-%m-%d'): - raise osv.except_osv(_('Error !'), _('You cannot sign in/sign out from other date than today.')) + raise osv.except_osv(_('Error!'), _('You cannot sign in/sign out from other date than today.')) return True def sign(self, cr, uid, ids, typ, context=None): @@ -452,9 +452,9 @@ class hr_timesheet_sheet(osv.osv): sheets = self.read(cr, uid, ids, ['state','total_attendance'], context=context) for sheet in sheets: if sheet['state'] in ('confirm', 'done'): - raise osv.except_osv(_('Invalid action !'), _('You cannot delete a timesheet which is already confirmed!')) + raise osv.except_osv(_('Invalid Action!'), _('You cannot delete a timesheet which is already confirmed.')) elif sheet['total_attendance'] <> 0.00: - raise osv.except_osv(_('Invalid action !'), _('You cannot delete a timesheet which have attendance entries!')) + raise osv.except_osv(_('Invalid Action!'), _('You cannot delete a timesheet which have attendance entries.')) return super(hr_timesheet_sheet, self).unlink(cr, uid, ids, context=context) def onchange_employee_id(self, cr, uid, ids, employee_id, context=None): @@ -545,7 +545,7 @@ class hr_timesheet_line(osv.osv): def _check(self, cr, uid, ids): for att in self.browse(cr, uid, ids): if att.sheet_id and att.sheet_id.state not in ('draft', 'new'): - raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet !')) + raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.')) return True hr_timesheet_line() @@ -612,12 +612,12 @@ class hr_attendance(osv.osv): if 'sheet_id' in context: ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id'], context=context) if ts.state not in ('draft', 'new'): - raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet!')) + raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet.')) res = super(hr_attendance,self).create(cr, uid, vals, context=context) if 'sheet_id' in context: if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id: - raise osv.except_osv(_('UserError !'), _('You cannot enter an attendance ' \ - 'date outside the current timesheet dates!')) + raise osv.except_osv(_('User Error!'), _('You cannot enter an attendance ' \ + 'date outside the current timesheet dates.')) return res def unlink(self, cr, uid, ids, *args, **kwargs): @@ -636,14 +636,14 @@ class hr_attendance(osv.osv): if 'sheet_id' in context: for attendance in self.browse(cr, uid, ids, context=context): if context['sheet_id'] != attendance.sheet_id.id: - raise osv.except_osv(_('UserError !'), _('You cannot enter an attendance ' \ - 'date outside the current timesheet dates!')) + raise osv.except_osv(_('User Error!'), _('You cannot enter an attendance ' \ + 'date outside the current timesheet dates.')) return res def _check(self, cr, uid, ids): for att in self.browse(cr, uid, ids): if att.sheet_id and att.sheet_id.state not in ('draft', 'new'): - raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet!')) + raise osv.except_osv(_('Error!'), _('You cannot modify an entry in a confirmed timesheet')) return True hr_attendance() diff --git a/addons/l10n_ch/report/report_webkit_html.py b/addons/l10n_ch/report/report_webkit_html.py index ad29d3ac9c8..1699871dc26 100644 --- a/addons/l10n_ch/report/report_webkit_html.py +++ b/addons/l10n_ch/report/report_webkit_html.py @@ -31,7 +31,7 @@ from mako import exceptions from report import report_sxw from report_webkit import webkit_report -from report_webkit import report_helper +from report_webkit import report_helper from osv import osv from osv.osv import except_osv @@ -68,24 +68,24 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): _compile_comma_me = re.compile("^(-?\d+)(\d{3})") _compile_check_bvr = re.compile('[0-9][0-9]-[0-9]{3,6}-[0-9]') _compile_check_bvr_add_num = re.compile('[0-9]*$') - + def set_context(self, objects, data, ids, report_type=None): user = self.pool.get('res.users').browse(self.cr, self.uid, self.uid) company = user.company_id if not company.invoice_only: self._check(ids) return super(l10n_ch_report_webkit_html, self).set_context(objects, data, ids, report_type=report_type) - + def police_absolute_path(self, inner_path) : """Will get the ocrb police absolute path""" path = addons.get_module_resource(os.path.join('l10n_ch', 'report', inner_path)) return path - + def bvr_absolute_path(self) : """Will get the ocrb police absolute path""" path = addons.get_module_resource(os.path.join('l10n_ch', 'report', 'bvr1.jpg')) return path - + def headheight(self): report_id = self.pool.get('ir.actions.report.xml').search(self.cr, self.uid, [('name','=', 'BVR invoice')])[0] report = self.pool.get('ir.actions.report.xml').browse(self.cr, self.uid, report_id) @@ -112,8 +112,8 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): '12 34567 89012 345' """ return ''.join([' '[(i - 2) % nbrspc:] + c for i, c in enumerate(nbr)]) - - + + def _get_ref(self, inv): """Retrieve ESR/BVR reference form invoice in order to print it""" res = '' @@ -123,7 +123,7 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): if inv.number: invoice_number = self._compile_get_ref.sub('', inv.number) return mod10r(res + invoice_number.rjust(26-len(res), '0')) - + def _check(self, invoice_ids): """Check if the invoice is ready to be printed""" if not invoice_ids: @@ -135,24 +135,24 @@ class l10n_ch_report_webkit_html(report_sxw.rml_parse): for invoice in invoice_obj.browse(cursor, self.uid, ids): invoice_name = "%s %s" %(invoice.name, invoice.number) if not invoice.partner_bank_id: - raise except_osv(_('UserError'), - _('No bank specified on invoice:\n%s' %(invoice_name))) + raise except_osv(_('User Error!'), + _('No bank specified on invoice:\n%s.' %(invoice_name))) if not self._compile_check_bvr.match( invoice.partner_bank_id.post_number or ''): - raise except_osv(_('UserError'), + raise except_osv(_('User Error!'), _(('Your bank BVR number should be of the form 0X-XXX-X! ' 'Please check your company ' - 'information for the invoice:\n%s') + 'information for the invoice:\n%s.') %(invoice_name))) if invoice.partner_bank_id.bvr_adherent_num \ and not self._compile_check_bvr_add_num.match( invoice.partner_bank_id.bvr_adherent_num): - raise except_osv(_('UserError'), + raise except_osv(_('User Error!'), _(('Your bank BVR adherent number must contain only ' 'digits!\nPlease check your company ' - 'information for the invoice:\n%s') %(invoice_name))) + 'information for the invoice:\n%s.') %(invoice_name))) return '' - + def mako_template(text): """Build a Mako template. @@ -162,15 +162,15 @@ def mako_template(text): return Template(text, input_encoding='utf-8', output_encoding='utf-8', lookup=tmp_lookup) class BVRWebKitParser(webkit_report.WebKitParser): - + def create_single_pdf(self, cursor, uid, ids, data, report_xml, context=None): """generate the PDF""" context = context or {} if report_xml.report_type != 'webkit': return super(WebKitParser,self).create_single_pdf(cursor, uid, ids, data, report_xml, context=context) - self.parser_instance = self.parser(cursor, - uid, - self.name2, + self.parser_instance = self.parser(cursor, + uid, + self.name2, context=context) self.pool = pooler.get_pool(cursor.dbname) objs = self.getObjects(cursor, uid, ids, context) @@ -183,12 +183,12 @@ class BVRWebKitParser(webkit_report.WebKitParser): if not template and report_xml.report_webkit_data : template = report_xml.report_webkit_data if not template : - raise except_osv(_('Error'),_('Webkit Report template not found !')) + raise except_osv(_('Error!'),_('Webkit Report template not found.')) header = report_xml.webkit_header.html footer = report_xml.webkit_header.footer_html if not header and report_xml.header: raise except_osv( - _('No header defined for this Webkit report!'), + _('No header defined for this Webkit report.'), _('Please set a header in company settings.') ) if not report_xml.header : @@ -212,7 +212,7 @@ class BVRWebKitParser(webkit_report.WebKitParser): self.parser_instance.localcontext['objects'] = [obj] if not company.bvr_only: try: - html = body_mako_tpl.render(helper=helper, + html = body_mako_tpl.render(helper=helper, css=css, _=self.translate_call, **self.parser_instance.localcontext) @@ -221,16 +221,16 @@ class BVRWebKitParser(webkit_report.WebKitParser): htmls.append(html) if not company.invoice_only: try: - bvr = body_bvr_tpl.render(helper=helper, + bvr = body_bvr_tpl.render(helper=helper, css=css, _=self.translate_call, **self.parser_instance.localcontext) except Exception, e: raise Exception(exceptions.text_error_template().render()) - htmls.append(bvr) + htmls.append(bvr) head_mako_tpl = Template(header, input_encoding='utf-8', output_encoding='utf-8') try: - head = head_mako_tpl.render(helper=helper, + head = head_mako_tpl.render(helper=helper, css=css, _debug=False, _=self.translate_call, @@ -241,16 +241,16 @@ class BVRWebKitParser(webkit_report.WebKitParser): if footer and company.invoice_only : foot_mako_tpl = Template(footer, input_encoding='utf-8', output_encoding='utf-8') try: - foot = foot_mako_tpl.render(helper=helper, - css=css, + foot = foot_mako_tpl.render(helper=helper, + css=css, _=self.translate_call, **self.parser_instance.localcontext) except Exception, e: raise Exception(exceptions.text_error_template().render()) if report_xml.webkit_debug : try: - deb = head_mako_tpl.render(helper=helper, - css=css, + deb = head_mako_tpl.render(helper=helper, + css=css, _debug=html, _=self.translate_call, **self.parser_instance.localcontext) @@ -260,10 +260,10 @@ class BVRWebKitParser(webkit_report.WebKitParser): bin = self.get_lib(cursor, uid) pdf = self.generate_pdf(bin, report_xml, head, foot, htmls) return (pdf, 'pdf') - + BVRWebKitParser('report.invoice_web_bvr', - 'account.invoice', + 'account.invoice', 'addons/l10n_ch/report/report_webkit_html.mako', parser=l10n_ch_report_webkit_html) diff --git a/addons/l10n_ch/wizard/bvr_import.py b/addons/l10n_ch/wizard/bvr_import.py index 3233a277ce6..38ba1e2a7d9 100644 --- a/addons/l10n_ch/wizard/bvr_import.py +++ b/addons/l10n_ch/wizard/bvr_import.py @@ -71,9 +71,9 @@ def _import(self, cursor, user, data, context=None): statement_obj = self.pool.get('account.bank.statement') property_obj = self.pool.get('ir.property') file = data['form']['file'] - if not file: - raise osv.except_osv(_('UserError'), - _('Please select a file first!')) + if not file: + raise osv.except_osv(_('User Error!'), + _('Please select a file first.')) statement_id = data['id'] records = [] total_amount = 0 @@ -90,12 +90,12 @@ def _import(self, cursor, user, data, context=None): if line[0:3] in ('999', '995'): if find_total: - raise osv.except_osv(_('Error'), - _('Too much total record found!')) + raise osv.except_osv(_('Error!'), + _('Too much total record found.')) find_total = True if lines: - raise osv.except_osv(_('Error'), - _('Record found after total record!')) + raise osv.except_osv(_('Error!'), + _('Record found after total record.')) amount = float(line[39:49]) + (float(line[49:51]) / 100) cost = float(line[69:76]) + (float(line[76:78]) / 100) if line[2] == '5': @@ -104,11 +104,11 @@ def _import(self, cursor, user, data, context=None): if round(amount - total_amount, 2) >= 0.01 \ or round(cost - total_cost, 2) >= 0.01: - raise osv.except_osv(_('Error'), - _('Total record different from the computed!')) + raise osv.except_osv(_('Error!'), + _('Total record different from the computed.')) if int(line[51:63]) != len(records): - raise osv.except_osv(_('Error'), - _('Number record different from the computed!')) + raise osv.except_osv(_('Error!'), + _('Number record different from the computed.')) else: record = { 'reference': line[12:39], @@ -119,8 +119,8 @@ def _import(self, cursor, user, data, context=None): } if record['reference'] != mod10r(record['reference'][:-1]): - raise osv.except_osv(_('Error'), - _('Recursive mod10 is invalid for reference: %s') % \ + raise osv.except_osv(_('Error!'), + _('Recursive mod10 is invalid for reference: %s.') % \ record['reference']) if line[2] == '5': @@ -221,10 +221,10 @@ def _import(self, cursor, user, data, context=None): if value : account_id = int(value.split(',')[1]) else : - raise osv.except_osv(_('Error'), + raise osv.except_osv(_('Error!'), _('The properties account payable and account receivable are not set.')) if not account_id and line_ids: - raise osv.except_osv(_('Error'), + raise osv.except_osv(_('Error!'), _('The properties account payable and account receivable are not set.')) values['account_id'] = account_id values['partner_id'] = partner_id diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 16989401089..749d95c0c23 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -451,10 +451,10 @@ class mrp_production(osv.osv): def _src_id_default(self, cr, uid, ids, context=None): src_location_id = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock', context=context) return src_location_id.id - + def _dest_id_default(self, cr, uid, ids, context=None): dest_location_id = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock', context=context) - return dest_location_id.id + return dest_location_id.id _columns = { 'name': fields.char('Reference', size=64, required=True), @@ -530,7 +530,7 @@ class mrp_production(osv.osv): def unlink(self, cr, uid, ids, context=None): for production in self.browse(cr, uid, ids, context=context): if production.state not in ('draft', 'cancel'): - raise osv.except_osv(_('Invalid action !'), _('Cannot delete a manufacturing order in state \'%s\'.') % production.state) + raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a manufacturing order in state \'%s\'.') % production.state) return super(mrp_production, self).unlink(cr, uid, ids, context=context) def copy(self, cr, uid, id, default=None, context=None): @@ -1041,7 +1041,7 @@ class mrp_production(osv.osv): pick_obj = self.pool.get('stock.picking') pick_obj.force_assign(cr, uid, [prod.picking_id.id for prod in self.browse(cr, uid, ids)]) return True - + # --------------------------------------------------- # OpenChatter methods and notifications # --------------------------------------------------- diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index c69e7776e72..ea473839005 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -135,8 +135,8 @@ class procurement_order(osv.osv): if s['state'] in ['draft','cancel']: unlink_ids.append(s['id']) else: - raise osv.except_osv(_('Invalid action !'), - _('Cannot delete Procurement Order(s) which are in %s state!') % \ + raise osv.except_osv(_('Invalid Action!'), + _('Cannot delete Procurement Order(s) which are in %s state.') % \ s['state']) return osv.osv.unlink(self, cr, uid, unlink_ids, context=context) @@ -328,7 +328,7 @@ class procurement_order(osv.osv): for procurement in self.browse(cr, uid, ids, context=context): if procurement.product_qty <= 0.00: raise osv.except_osv(_('Insufficient Data!'), - _('Please check the quantity in procurement order(s), it should not be 0 or less.')) + _('Quantity in procurement order(s) must be greater than 0.')) if procurement.product_id.type in ('product', 'consu'): if not procurement.move_id: source = procurement.location_id.id diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 5a2ed939540..e4374f096fd 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -116,7 +116,7 @@ class project_work(osv.osv): vals_line['product_id'] = result['product_id'] vals_line['date'] = vals['date'][:10] - #calculate quantity based on employee's product's uom + #calculate quantity based on employee's product's uom vals_line['unit_amount'] = vals['hours'] default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id @@ -254,7 +254,7 @@ class res_partner(osv.osv): def unlink(self, cursor, user, ids, context=None): parnter_id=self.pool.get('project.project').search(cursor, user, [('partner_id', 'in', ids)]) if parnter_id: - raise osv.except_osv(_('Invalid action !'), _('You cannot delete a partner which is assigned to project, we suggest you to uncheck the active box!')) + raise osv.except_osv(_('Invalid Action!'), _('You cannot delete a partner which is assigned to project, but you can uncheck the active box.')) return super(res_partner,self).unlink(cursor, user, ids, context=context) res_partner() @@ -271,6 +271,6 @@ class account_analytic_line(osv.osv): res['value']['to_invoice'] = st or False if acc.state == 'close' or acc.state == 'cancelled': raise osv.except_osv(_('Invalid Analytic Account !'), _('You cannot select a Analytic Account which is in Close or Cancelled state.')) - return res + return res account_analytic_line() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index a84fa9d2d22..44027fca610 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -224,13 +224,13 @@ class purchase_order(osv.osv): _inherit = ['ir.needaction_mixin', 'mail.thread'] _description = "Purchase Order" _order = "name desc" - + def create(self, cr, uid, vals, context=None): order = super(purchase_order, self).create(cr, uid, vals, context=context) if order: self.create_send_note(cr, uid, [order], context=context) return order - + def unlink(self, cr, uid, ids, context=None): purchase_orders = self.read(cr, uid, ids, ['state'], context=context) unlink_ids = [] @@ -238,7 +238,7 @@ class purchase_order(osv.osv): if s['state'] in ['draft','cancel']: unlink_ids.append(s['id']) else: - raise osv.except_osv(_('Invalid action !'), _('In order to delete a purchase order, You must cancel it first.')) + raise osv.except_osv(_('Invalid Action!'), _('In order to delete a purchase order, you must cancel it first.')) # TODO: temporary fix in 5.0, to remove in 5.2 when subflows support # automatically sending subflow.delete upon deletion @@ -291,7 +291,7 @@ class purchase_order(osv.osv): if not po.invoice_ids: context.update({'active_ids' : [line.id for line in po.order_line]}) wizard_obj.makeInvoices(cr, uid, [], context=context) - + for po in self.browse(cr, uid, ids, context=context): inv_ids+= [invoice.id for invoice in po.invoice_ids] res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_supplier_form') @@ -476,12 +476,12 @@ class purchase_order(osv.osv): if res: self.invoice_send_note(cr, uid, ids, res, context) return res - + def invoice_done(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state':'approved'}, context=context) self.invoice_done_send_note(cr, uid, ids, context=context) return True - + def has_stockable_product(self,cr, uid, ids, *args): for order in self.browse(cr, uid, ids): for order_line in order.order_line: @@ -727,18 +727,18 @@ class purchase_order(osv.osv): wf_service.trg_redirect(uid, 'purchase.order', old_id, neworder_id, cr) wf_service.trg_validate(uid, 'purchase.order', old_id, 'purchase_cancel', cr) return orders_info - + # -------------------------------------- # OpenChatter methods and notifications # -------------------------------------- - + def get_needaction_user_ids(self, cr, uid, ids, context=None): result = super(purchase_order, self).get_needaction_user_ids(cr, uid, ids, context=context) for obj in self.browse(cr, uid, ids, context=context): if obj.state == 'approved': result[obj.id].append(obj.validator.id) return result - + def create_send_note(self, cr, uid, ids, context=None): return self.message_append_note(cr, uid, ids, body=_("Request for quotation created."), context=context) @@ -746,7 +746,7 @@ class purchase_order(osv.osv): for obj in self.browse(cr, uid, ids, context=context): self.message_subscribe(cr, uid, [obj.id], [obj.validator.id], context=context) self.message_append_note(cr, uid, [obj.id], body=_("Quotation for %s converted to a Purchase Order of %s %s.") % (obj.partner_id.name, obj.amount_total, obj.pricelist_id.currency_id.symbol), context=context) - + def shipment_send_note(self, cr, uid, ids, picking_id, context=None): for order in self.browse(cr, uid, ids, context=context): for picking in (pck for pck in order.picking_ids if pck.id == picking_id): @@ -755,21 +755,21 @@ class purchase_order(osv.osv): picking_datetime = fields.DT.datetime.strptime(picking.min_date, DEFAULT_SERVER_DATETIME_FORMAT) picking_date_str = fields.datetime.context_timestamp(cr, uid, picking_datetime, context=context).strftime(DATETIME_FORMATS_MAP['%+'] + " (%Z)") self.message_append_note(cr, uid, [order.id], body=_("Shipment %s scheduled for %s.") % (picking.name, picking_date_str), context=context) - + def invoice_send_note(self, cr, uid, ids, invoice_id, context=None): for order in self.browse(cr, uid, ids, context=context): for invoice in (inv for inv in order.invoice_ids if inv.id == invoice_id): self.message_append_note(cr, uid, [order.id], body=_("Draft Invoice of %s %s is waiting for validation.") % (invoice.amount_total, invoice.currency_id.symbol), context=context) - + def shipment_done_send_note(self, cr, uid, ids, context=None): self.message_append_note(cr, uid, ids, body=_("""Shipment received."""), context=context) - + def invoice_done_send_note(self, cr, uid, ids, context=None): self.message_append_note(cr, uid, ids, body=_("Invoice paid."), context=context) - + def draft_send_note(self, cr, uid, ids, context=None): return self.message_append_note(cr, uid, ids, body=_("Purchase Order has been set to draft."), context=context) - + def cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_append_note(cr, uid, [obj.id], body=_("Purchase Order for %s cancelled.") % (obj.partner_id.name), context=context) @@ -1086,7 +1086,7 @@ procurement_order() class mail_message(osv.osv): _name = 'mail.message' _inherit = 'mail.message' - + def _postprocess_sent_message(self, cr, uid, message, context=None): if message.model == 'purchase.order': wf_service = netsvc.LocalService("workflow") diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c65b7906df6..83b725302e3 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -50,7 +50,7 @@ class sale_order(osv.osv): _name = "sale.order" _inherit = ['ir.needaction_mixin', 'mail.thread'] _description = "Sales Order" - + def copy(self, cr, uid, id, default=None, context=None): if not default: @@ -295,7 +295,7 @@ class sale_order(osv.osv): if s['state'] in ['draft', 'cancel']: unlink_ids.append(s['id']) else: - raise osv.except_osv(_('Invalid action !'), _('In order to delete a confirmed sales order, you must cancel it! To cancel a sale order, you must first cancel related picking for delivery orders.')) + raise osv.except_osv(_('Invalid Action!'), _('In order to delete a confirmed sales order, you must cancel it.\nTo do so, you must first cancel related picking for delivery orders.')) return osv.osv.unlink(self, cr, uid, unlink_ids, context=context) @@ -481,7 +481,7 @@ class sale_order(osv.osv): 'form': self.read(cr, uid, ids[0], context=context), } return {'type': 'ir.actions.report.xml', 'report_name': 'sale.order', 'datas': datas, 'nodestroy': True} - + def manual_invoice(self, cr, uid, ids, context=None): """ create invoices for the given sale orders (ids), and open the form view of one of the newly created invoices @@ -547,7 +547,7 @@ class sale_order(osv.osv): result.update(view_id = res and res[1] or False) return result - + def action_view_delivery(self, cr, uid, ids, context=None): ''' This function returns an action that display existing delivery orders of given sale order ids. It can either be a in a list or in a form view, if there is only one delivery order to show. @@ -1021,27 +1021,27 @@ class sale_order(osv.osv): # ------------------------------------------------ # OpenChatter methods and notifications # ------------------------------------------------ - + def get_needaction_user_ids(self, cr, uid, ids, context=None): result = super(sale_order, self).get_needaction_user_ids(cr, uid, ids, context=context) for obj in self.browse(cr, uid, ids, context=context): if (obj.state == 'manual' or obj.state == 'progress'): result[obj.id].append(obj.user_id.id) return result - + def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_subscribe(cr, uid, [obj.id], [obj.user_id.id], context=context) self.message_append_note(cr, uid, [obj.id], body=_("Quotation for %s has been created.") % (obj.partner_id.name), context=context) - + def confirm_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_append_note(cr, uid, [obj.id], body=_("Quotation for %s converted to Sale Order of %s %s.") % (obj.partner_id.name, obj.amount_total, obj.pricelist_id.currency_id.symbol), context=context) - + def cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_append_note(cr, uid, [obj.id], body=_("Sale Order for %s cancelled.") % (obj.partner_id.name), context=context) - + def delivery_send_note(self, cr, uid, ids, picking_id, context=None): for order in self.browse(cr, uid, ids, context=context): for picking in (pck for pck in order.picking_ids if pck.id == picking_id): @@ -1050,22 +1050,22 @@ class sale_order(osv.osv): picking_datetime = fields.DT.datetime.strptime(picking.min_date, DEFAULT_SERVER_DATETIME_FORMAT) picking_date_str = fields.datetime.context_timestamp(cr, uid, picking_datetime, context=context).strftime(DATETIME_FORMATS_MAP['%+'] + " (%Z)") self.message_append_note(cr, uid, [order.id], body=_("Delivery Order %s scheduled for %s.") % (picking.name, picking_date_str), context=context) - + def delivery_end_send_note(self, cr, uid, ids, context=None): self.message_append_note(cr, uid, ids, body=_("Order delivered."), context=context) - + def invoice_paid_send_note(self, cr, uid, ids, context=None): self.message_append_note(cr, uid, ids, body=_("Invoice paid."), context=context) - + def invoice_send_note(self, cr, uid, ids, invoice_id, context=None): for order in self.browse(cr, uid, ids, context=context): for invoice in (inv for inv in order.invoice_ids if inv.id == invoice_id): self.message_append_note(cr, uid, [order.id], body=_("Draft Invoice of %s %s waiting for validation.") % (invoice.amount_total, invoice.currency_id.symbol), context=context) - + def action_cancel_draft_send_note(self, cr, uid, ids, context=None): return self.message_append_note(cr, uid, ids, body='Sale order has been set in draft.', context=context) - - + + sale_order() # TODO add a field price_unit_uos @@ -1249,7 +1249,7 @@ class sale_order_line(osv.osv): def button_cancel(self, cr, uid, ids, context=None): for line in self.browse(cr, uid, ids, context=context): if line.invoiced: - raise osv.except_osv(_('Invalid action !'), _('You cannot cancel a sale order line that has already been invoiced!')) + raise osv.except_osv(_('Invalid Action!'), _('You cannot cancel a sale order line that has already been invoiced.')) for move_line in line.move_ids: if move_line.state != 'cancel': raise osv.except_osv( @@ -1333,7 +1333,7 @@ class sale_order_line(osv.osv): (qty, ean, qty_pack, type_ul.name) warning_msgs += _("Picking Information ! : ") + warn_msg + "\n\n" warning = { - 'title': _('Configuration Error !'), + 'title': _('Configuration Error!'), 'message': warning_msgs } result['product_uom_qty'] = qty @@ -1453,7 +1453,7 @@ class sale_order_line(osv.osv): result.update({'price_unit': price}) if warning_msgs: warning = { - 'title': _('Configuration Error !'), + 'title': _('Configuration Error!'), 'message' : warning_msgs } return {'value': result, 'domain': domain, 'warning': warning} @@ -1479,18 +1479,18 @@ class sale_order_line(osv.osv): """Allows to delete sales order lines in draft,cancel states""" for rec in self.browse(cr, uid, ids, context=context): if rec.state not in ['draft', 'cancel']: - raise osv.except_osv(_('Invalid action !'), _('Cannot delete a sales order line which is in state \'%s\'!') %(rec.state,)) + raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a sales order line which is in state \'%s\'.') %(rec.state,)) return super(sale_order_line, self).unlink(cr, uid, ids, context=context) sale_order_line() class mail_message(osv.osv): _inherit = 'mail.message' - + def _postprocess_sent_message(self, cr, uid, message, context=None): if message.model == 'sale.order': wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'sale.order', message.res_id, 'quotation_sent', cr) + wf_service.trg_validate(uid, 'sale.order', message.res_id, 'quotation_sent', cr) return super(mail_message, self)._postprocess_sent_message(cr, uid, message=message, context=context) mail_message() diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index a09325d663d..85fbcd17fe8 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -114,12 +114,12 @@ class sale_advance_payment_inv(osv.osv_memory): prop_id = prop and prop.id or False account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, sale.fiscal_position.id or False, prop_id) if not account_id: - raise osv.except_osv(_('Configuration Error !'), + raise osv.except_osv(_('Configuration Error!'), _('There is no income account defined as global property.')) res['account_id'] = account_id if not res.get('account_id'): - raise osv.except_osv(_('Configuration Error !'), - _('There is no income account defined for this product: "%s" (id:%d)') % \ + raise osv.except_osv(_('Configuration Error!'), + _('There is no income account defined for this product: "%s" (id:%d).') % \ (wizard.product_id.name, wizard.product_id.id,)) # determine invoice amount diff --git a/addons/stock/stock.py b/addons/stock/stock.py index ba95037fe08..96d9418dbed 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -605,7 +605,7 @@ class stock_picking(osv.osv): res[pick]['min_date'] = dt1 res[pick]['max_date'] = dt2 return res - + def create(self, cr, user, vals, context=None): if ('name' not in vals) or (vals.get('name')=='/'): seq_obj_name = 'stock.picking.' + vals['type'] @@ -1322,7 +1322,7 @@ class stock_picking(osv.osv): delivered_pack = self.browse(cr, uid, delivered_pack_id, context=context) res[pick.id] = {'delivered_picking': delivered_pack.id or False} - + return res def log_picking(self, cr, uid, ids, context=None): @@ -1364,11 +1364,11 @@ class stock_picking(osv.osv): context.update({'view_id': res and res[1] or False}) message += state_list[pick.state] return True - + # ----------------------------------------- # OpenChatter methods and notifications # ----------------------------------------- - + def _get_document_type(self, type): type_dict = { 'out': 'Delivery order', @@ -1376,17 +1376,17 @@ class stock_picking(osv.osv): 'internal': 'Internal picking', } return type_dict.get(type, 'Stock picking') - + def create_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_append_note(cr, uid, [obj.id], body=_("%s has been created.") % (self._get_document_type(obj.type)), context=context) - + def scrap_send_note(self, cr, uid, ids, quantity, uom, name, context=None): return self.message_append_note(cr, uid, ids, body= _("%s %s %s has been moved to scrap.") % (quantity, uom, name), context=context) - + def back_order_send_note(self, cr, uid, ids, back_name, context=None): return self.message_append_note(cr, uid, ids, body=_("Back order %s has been created.") % (back_name), context=context) - + def ship_done_send_note(self, cr, uid, ids, context=None): type_dict = { 'out': 'delivered', @@ -1395,11 +1395,11 @@ class stock_picking(osv.osv): } for obj in self.browse(cr, uid, ids, context=context): self.message_append_note(cr, uid, [obj.id], body=_("Products have been %s.") % (type_dict.get(obj.type, 'move done')), context=context) - + def ship_cancel_send_note(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): self.message_append_note(cr, uid, [obj.id], body=_("%s has been cancelled.") % (self._get_document_type(obj.type)), context=context) - + stock_picking() @@ -1727,7 +1727,7 @@ class stock_move(osv.osv): if location_xml_id: location_model, location_id = mod_obj.get_object_reference(cr, uid, 'stock', location_xml_id) return location_id - + def _default_destination_address(self, cr, uid, context=None): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) return user.company_id.partner_id.id @@ -2367,7 +2367,7 @@ class stock_move(osv.osv): ctx = context.copy() for move in self.browse(cr, uid, ids, context=context): if move.state != 'draft' and not ctx.get('call_unlink',False): - raise osv.except_osv(_('UserError!'), + raise osv.except_osv(_('User Error!'), _('You can only delete draft moves.')) return super(stock_move, self).unlink( cr, uid, ids, context=ctx) @@ -2537,7 +2537,7 @@ class stock_move(osv.osv): 'location_id': location_id or move.location_id.id, } self.write(cr, uid, [move.id], update_val) - + product_obj = self.pool.get('product.product') for new_move in self.browse(cr, uid, res, context=context): message = _("Product has been consumed with '%s' quantity.") % (new_move.product_qty) @@ -2779,7 +2779,7 @@ class stock_inventory(osv.osv): account_move_data_l = account_move_obj.read(cr, uid, account_move_ids, ['state'], context=context) for account_move in account_move_data_l: if account_move['state'] == 'posted': - raise osv.except_osv(_('UserError!'), + raise osv.except_osv(_('User Error!'), _('In order to cancel this inventory, you must first unpost related journal entries.')) account_move_obj.unlink(cr, uid, [account_move['id']], context=context) self.write(cr, uid, [inv.id], {'state': 'cancel'}, context=context) @@ -2869,8 +2869,8 @@ class stock_picking_in(osv.osv): ('confirmed', 'Waiting Availability'), ('assigned', 'Ready to Receive'), ('done', 'Received'), - ('cancel', 'Cancelled'),], - 'State', readonly=True, select=True, + ('cancel', 'Cancelled'),], + 'State', readonly=True, select=True, help="""* Draft: not confirmed yet and will not be scheduled until confirmed\n * Waiting Another Operation: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n * Waiting Availability: still waiting for the availability of products\n @@ -2908,8 +2908,8 @@ class stock_picking_out(osv.osv): ('confirmed', 'Waiting Availability'), ('assigned', 'Ready to Deliver'), ('done', 'Delivered'), - ('cancel', 'Cancelled'),], - 'State', readonly=True, select=True, + ('cancel', 'Cancelled'),], + 'State', readonly=True, select=True, help="""* Draft: not confirmed yet and will not be scheduled until confirmed\n * Waiting Another Operation: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n * Waiting Availability: still waiting for the availability of products\n diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py index e6f3b8d4218..7fcaf23045e 100644 --- a/addons/stock_planning/stock_planning.py +++ b/addons/stock_planning/stock_planning.py @@ -29,7 +29,7 @@ from tools.translate import _ import logging import decimal_precision as dp -_logger = logging.getLogger(__name__) +_logger = logging.getLogger(__name__) def rounding(fl, round_value): @@ -52,11 +52,11 @@ class stock_period(osv.osv): _defaults = { 'state': 'draft' } - + def button_open(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state': 'open'}) return True - + def button_close(self, cr, uid, ids, context=None): self.write(cr, uid, ids, {'state': 'close'}) return True @@ -143,7 +143,7 @@ class stock_sale_forecast(osv.osv): if t['state'] in ('draft'): unlink_ids.append(t['id']) else: - raise osv.except_osv(_('Invalid action !'), _('Cannot delete a validated sales forecast!')) + raise osv.except_osv(_('Invalid Action!'), _('Cannot delete a validated sales forecast.')) osv.osv.unlink(self, cr, uid, unlink_ids, context=context) return True @@ -172,7 +172,7 @@ class stock_sale_forecast(osv.osv): res = {'value': ret} return res - def onchange_uom(self, cr, uid, ids, product_uom=False, product_qty=0.0, + def onchange_uom(self, cr, uid, ids, product_uom=False, product_qty=0.0, active_uom=False, product_id=False): ret = {} if product_uom and product_id: @@ -430,7 +430,7 @@ class stock_planning(osv.osv): result['warehouse_id'] = False return {'value': result} - def onchange_uom(self, cr, uid, ids, product_uom=False, product_id=False, active_uom=False, + def onchange_uom(self, cr, uid, ids, product_uom=False, product_id=False, active_uom=False, planned_outgoing=0.0, to_procure=0.0): ret = {} if not product_uom: @@ -623,7 +623,7 @@ class stock_planning(osv.osv): def procure_incomming_left(self, cr, uid, ids, context, *args): for obj in self.browse(cr, uid, ids, context=context): if obj.incoming_left <= 0: - raise osv.except_osv(_('Error !'), _('Incoming Left must be greater than 0 !')) + raise osv.except_osv(_('Error!'), _('Incoming Left must be greater than 0.')) uom_qty, uom, uos_qty, uos = self._qty_to_standard(cr, uid, obj, context) user = self.pool.get('res.users').browse(cr, uid, uid, context=context) proc_id = self.pool.get('procurement.order').create(cr, uid, { @@ -667,11 +667,11 @@ class stock_planning(osv.osv): def internal_supply(self, cr, uid, ids, context, *args): for obj in self.browse(cr, uid, ids, context=context): if obj.incoming_left <= 0: - raise osv.except_osv(_('Error !'), _('Incoming Left must be greater than 0 !')) + raise osv.except_osv(_('Error!'), _('Incoming Left must be greater than 0.')) if not obj.supply_warehouse_id: - raise osv.except_osv(_('Error !'), _('You must specify a Source Warehouse !')) + raise osv.except_osv(_('Error!'), _('You must specify a Source Warehouse.')) if obj.supply_warehouse_id.id == obj.warehouse_id.id: - raise osv.except_osv(_('Error !'), _('You must specify a Source Warehouse different than calculated (destination) Warehouse !')) + raise osv.except_osv(_('Error!'), _('You must specify a Source Warehouse different than calculated (destination) Warehouse.')) uom_qty, uom, uos_qty, uos = self._qty_to_standard(cr, uid, obj, context) user = self.pool.get('res.users').browse(cr, uid, uid, context) picking_id = self.pool.get('stock.picking').create(cr, uid, {