From 6d2fac36f6ed8ea847acc9266e0df32b870ad137 Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Sat, 7 Mar 2009 00:50:10 +0100 Subject: [PATCH] [IMP] * add missing tools.translate * translate all missing raise * add encoding: utf-8 in missing file * add vim comment (when missing) at the end of file * convert tabs to spaces (PEP8 Compliant) * more pythonic when concatenate value bzr revid: christophe.chauvet@syleam.fr-20090306235010-kf09klskd2voo5cp --- addons/account/account.py | 2 +- .../wizard/wizard_account_analytic_line.py | 1 + addons/account/report/account_balance.py | 1 + addons/account/report/account_tax_code.py | 1 + addons/account/report/aged_trial_balance.py | 1 + addons/account/report/general_ledger.py | 1 + .../report/general_ledger_landscape.py | 1 + addons/account/report/invoice.py | 1 + addons/account/report/partner_balance.py | 1 + addons/account/report/rml_parse.py | 1 + addons/account/report/tax_report.py | 1 + addons/account/report/third_party_ledger.py | 1 + addons/account/sequence.py | 1 + .../wizard/wizard_account_balance_report.py | 6 +- .../wizard/wizard_aged_trial_balance.py | 4 +- .../wizard/wizard_automatic_reconcile.py | 1 + .../wizard/wizard_general_ledger_report.py | 6 +- .../wizard/wizard_partner_balance_report.py | 6 +- addons/account/wizard/wizard_refund.py | 1 + addons/account/wizard/wizard_state_open.py | 2 +- .../wizard/wizard_statement_from_invoice.py | 2 + .../wizard/wizard_third_party_ledger.py | 6 +- addons/account/wizard/wizard_use_model.py | 3 +- addons/account/wizard/wizard_vat.py | 1 + addons/account_analytic_default/__init__.py | 1 + .../account_analytic_default.py | 1 + .../account_analytic_plans.py | 6 +- .../wizard/create_model.py | 5 +- .../wizard/wizard_crossovered_analytic.py | 3 +- addons/account_budget/crossovered_budget.py | 3 +- .../wizard/wizard_budget_report.py | 3 +- .../account_date_check/account_date_check.py | 3 +- addons/account_payment/account_move_line.py | 2 +- addons/account_payment/report/__init__.py | 1 + .../account_payment/report/payment_order.py | 4 +- addons/account_report/account.py | 1 + .../wizard/wizard_print_indicators.py | 3 +- addons/account_voucher/__init__.py | 1 + addons/account_voucher/report/__init__.py | 4 +- .../account_voucher/report/report_voucher.py | 4 +- .../report/report_voucher_amount.py | 4 +- addons/account_voucher/voucher.py | 4 +- addons/account_voucher/voucher_account.py | 1 + addons/account_voucher/wizard/__init__.py | 1 + .../analytic_user_function.py | 13 ++- addons/auction/auction.py | 9 +- addons/auction/barcode/__init__.py | 1 + addons/auction/barcode/code128.py | 1 + addons/auction/barcode/code39.py | 1 + addons/auction/barcode/code93.py | 1 + addons/auction/barcode/common.py | 1 + addons/auction/barcode/fourstate.py | 1 + addons/auction/barcode/test.py | 1 + addons/auction/barcode/usps.py | 1 + addons/auction/report/buyer_list.py | 1 + addons/auction/wizard/wizard_aie_send.py | 1 + .../auction/wizard/wizard_aie_send_result.py | 1 + addons/audittrail/audittrail.py | 5 +- .../wizard/base_module_merge.py | 1 + .../wizard/base_module_publish.py | 1 + .../wizard/base_module_publish_all.py | 3 +- .../base_module_publish/wizard/module_zip.py | 1 + .../base_report_creator.py | 3 +- .../wizard/base_report_designer_modify.py | 1 + addons/board/wizard/board_wizard.py | 3 +- addons/board_auction/__init__.py | 1 + addons/board_crm_configuration/__init__.py | 1 + addons/board_document/__init__.py | 1 + addons/crm_configuration/__init__.py | 1 + addons/crm_configuration/wizard/__init__.py | 1 + .../wizard/meeting_planify.py | 1 + .../wizard/wizard_opportunity_set.py | 6 +- .../wizard/wizard_partner_create.py | 5 +- addons/crm_vertical/__init__.py | 1 + addons/crm_vertical/crm_vertical.py | 4 +- addons/document/document.py | 15 +-- addons/document_ics/__init__.py | 1 + addons/event/event.py | 1 + addons/event/wizard/confirm_registration.py | 1 + addons/event_project/wizard/event_task.py | 3 +- addons/hr/hr.py | 1 + addons/hr_holidays/hr.py | 4 +- addons/hr_timesheet/hr_timesheet.py | 4 +- addons/l10n_be/wizard/__init__.py | 4 +- .../l10n_be/wizard/account_vat_declaration.py | 1 + addons/l10n_be/wizard/partner_vat_listing.py | 6 +- addons/l10n_ch/__init__.py | 1 + addons/l10n_ch/__terp__.py | 1 + addons/l10n_ch/account_move_line.py | 1 + addons/l10n_ch/bank.py | 1 + addons/l10n_ch/company.py | 1 + addons/l10n_ch/dta.py | 1 + addons/l10n_ch/invoice.py | 4 +- addons/l10n_ch/partner.py | 1 + addons/l10n_ch/payment.py | 1 + addons/l10n_ch/report/__init__.py | 1 + addons/l10n_ch/report/bvr.py | 1 + addons/l10n_ch/report/tiny_sxw2rml.py | 1 + addons/l10n_ch/wizard/__init__.py | 1 + addons/l10n_ch/wizard/bvr_import.py | 27 +++-- addons/l10n_ch/wizard/dta_wizard.py | 106 ++++++++---------- addons/l10n_ch/wizard/journal_config.py | 4 +- addons/l10n_ch/wizard/wizard_bvr.py | 29 ++--- addons/l10n_ch_chart_c2c_pcg/__init__.py | 1 + addons/l10n_ch_chart_c2c_pcg/__terp__.py | 1 + .../l10n_ch_chart_c2c_pcg/wizard/__init__.py | 4 +- addons/l10n_ch_chart_c2c_pcg/wizard/config.py | 4 +- addons/l10n_lu/__init__.py | 1 + addons/l10n_lu/wizard/__init__.py | 1 + addons/l10n_lu/wizard/print_vat.py | 1 + .../membership/wizard/invoice_membership.py | 5 +- addons/mrp/__init__.py | 1 + addons/mrp/company.py | 1 + addons/mrp/mrp.py | 3 +- addons/mrp/report/order.py | 1 + addons/mrp/schedulers.py | 1 + .../wizard/wizard_change_production_qty.py | 8 +- addons/mrp_operations/mrp_operations.py | 3 +- addons/mrp_repair/mrp_repair.py | 4 +- addons/mrp_subproduct/__init__.py | 1 + addons/mrp_subproduct/mrp_subproduct.py | 1 + addons/point_of_sale/pos.py | 30 ++--- addons/point_of_sale/report/pos_invoice.py | 3 +- .../wizard/wizard_default_journal.py | 1 + .../point_of_sale/wizard/wizard_get_sale.py | 3 +- .../wizard/wizard_scan_product.py | 1 + addons/process/process.py | 1 + addons/product/product.py | 1 + .../wizard/wizard_product_margin.py | 1 + .../profile_association.py | 1 + addons/project/company.py | 1 + addons/project/project.py | 1 + addons/project/wizard/close_task.py | 1 + .../project_gtd/wizard/project_gtd_daily.py | 3 +- .../project_gtd/wizard/project_gtd_empty.py | 3 +- addons/project_timesheet/project_timesheet.py | 3 +- addons/report_intrastat/report/__init__.py | 1 + addons/report_intrastat/report/invoice.py | 1 + addons/sale/product.py | 1 + addons/sale/report/__init__.py | 1 + addons/sale/sale.py | 1 + addons/sale/wizard/make_invoice_advance.py | 1 + addons/sale_crm/wizard/makesale.py | 1 + addons/sale_delivery_report/__init__.py | 1 + .../sale_delivery_report/report/__init__.py | 1 + .../sale_delivery_report/report/shipping.py | 1 + addons/stock/report/picking.py | 1 + addons/stock/report_stock.py | 2 + addons/stock/wizard/inventory_merge.py | 9 +- addons/stock/wizard/inventory_merge_zero.py | 5 +- addons/stock/wizard/wizard_inventory.py | 8 +- .../stock/wizard/wizard_invoice_onshipping.py | 7 +- .../stock/wizard/wizard_location_product.py | 1 + addons/stock_location/__init__.py | 1 + addons/stock_location/__terp__.py | 1 + addons/stock_location/stock.py | 1 + addons/wiki/__init__.py | 4 +- addons/wiki/wiki.py | 1 + addons/wiki/wizard/__init__.py | 1 + addons/wiki/wizard/create_menu.py | 1 + addons/wiki/wizard/make_index.py | 1 + addons/wiki/wizard/show_diff.py | 6 +- 162 files changed, 365 insertions(+), 194 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 23635b298ac..57765e895bd 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1496,7 +1496,7 @@ class account_model(osv.osv): for model in self.browse(cr, uid, ids, context): period_id = self.pool.get('account.period').find(cr,uid, context=context) if not period_id: - raise osv.except_osv('No period found !', 'Unable to find a valid period !') + raise osv.except_osv(_('No period found !'), _('Unable to find a valid period !')) period_id = period_id[0] move_id = self.pool.get('account.move').create(cr, uid, { 'ref': model.ref, diff --git a/addons/account/project/wizard/wizard_account_analytic_line.py b/addons/account/project/wizard/wizard_account_analytic_line.py index 795a60f653c..db90e00f3b6 100644 --- a/addons/account/project/wizard/wizard_account_analytic_line.py +++ b/addons/account/project/wizard/wizard_account_analytic_line.py @@ -77,3 +77,4 @@ class account_analytic_line(wizard.interface): } } account_analytic_line('account.analytic.line') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_balance.py b/addons/account/report/account_balance.py index 64db67efea5..7c98f32089a 100644 --- a/addons/account/report/account_balance.py +++ b/addons/account/report/account_balance.py @@ -227,3 +227,4 @@ class account_balance(report_sxw.rml_parse): return self.sum_debit report_sxw.report_sxw('report.account.account.balance', 'account.account', 'addons/account/report/account_balance.rml', parser=account_balance, header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/account_tax_code.py b/addons/account/report/account_tax_code.py index 0afce2942b7..aacefae98e8 100644 --- a/addons/account/report/account_tax_code.py +++ b/addons/account/report/account_tax_code.py @@ -38,3 +38,4 @@ class account_tax_code_report(rml_parse.rml_parse): report_sxw.report_sxw('report.account.tax.code.entries', 'account.tax.code', 'addons/account/report/account_tax_code.rml', parser=account_tax_code_report, header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/aged_trial_balance.py b/addons/account/report/aged_trial_balance.py index ebac5ff7247..c268c643537 100644 --- a/addons/account/report/aged_trial_balance.py +++ b/addons/account/report/aged_trial_balance.py @@ -178,3 +178,4 @@ report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner', 'addons/account/report/aged_trial_balance.rml',parser=aged_trial_report,header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index af193620eb0..34c74df08c6 100644 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -427,3 +427,4 @@ class general_ledger(rml_parse.rml_parse): report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/general_ledger.rml', parser=general_ledger, header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/general_ledger_landscape.py b/addons/account/report/general_ledger_landscape.py index 7b52e44fb48..729f13ad1e4 100644 --- a/addons/account/report/general_ledger_landscape.py +++ b/addons/account/report/general_ledger_landscape.py @@ -406,3 +406,4 @@ class general_ledger_landscape(rml_parse.rml_parse): return currency_total report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/general_ledger_landscape.rml', parser=general_ledger_landscape, header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/invoice.py b/addons/account/report/invoice.py index 011ced7c829..3ca850a148b 100644 --- a/addons/account/report/invoice.py +++ b/addons/account/report/invoice.py @@ -35,3 +35,4 @@ report_sxw.report_sxw( 'addons/account/report/invoice.rml', parser=account_invoice ) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/partner_balance.py b/addons/account/report/partner_balance.py index 172261c16be..852e3cb127f 100644 --- a/addons/account/report/partner_balance.py +++ b/addons/account/report/partner_balance.py @@ -617,3 +617,4 @@ class partner_balance(report_sxw.rml_parse): report_sxw.report_sxw('report.account.partner.balance', 'res.partner', 'account/report/partner_balance.rml',parser=partner_balance, header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/rml_parse.py b/addons/account/report/rml_parse.py index ab3a869ba3d..e0c41e8f286 100644 --- a/addons/account/report/rml_parse.py +++ b/addons/account/report/rml_parse.py @@ -175,3 +175,4 @@ class rml_parse(report_sxw.rml_parse): +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/tax_report.py b/addons/account/report/tax_report.py index e9866ae0c7c..d82f9ab99bd 100644 --- a/addons/account/report/tax_report.py +++ b/addons/account/report/tax_report.py @@ -236,3 +236,4 @@ class tax_report(rml_parse.rml_parse): report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code', 'addons/account/report/tax_report.rml', parser=tax_report, header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py index 634049dbd2e..bf56470df3f 100644 --- a/addons/account/report/third_party_ledger.py +++ b/addons/account/report/third_party_ledger.py @@ -447,3 +447,4 @@ report_sxw.report_sxw('report.account.third_party_ledger', 'res.partner', 'addons/account/report/third_party_ledger.rml',parser=third_party_ledger, header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/sequence.py b/addons/account/sequence.py index c3ac27880e3..26f2e12f468 100644 --- a/addons/account/sequence.py +++ b/addons/account/sequence.py @@ -49,3 +49,4 @@ class ir_sequence(osv.osv): ir_sequence() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/wizard_account_balance_report.py b/addons/account/wizard/wizard_account_balance_report.py index 232d2a80475..1679fcb52bb 100644 --- a/addons/account/wizard/wizard_account_balance_report.py +++ b/addons/account/wizard/wizard_account_balance_report.py @@ -23,6 +23,7 @@ import wizard import pooler import time +from tools.translate import _ period_form = '''
@@ -115,11 +116,11 @@ class wizard_report(wizard.interface): res = cr.dictfetchall() if res: if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']): - raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop']) + raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (res[0]['date_start'], res[0]['date_stop'])) else: return 'report' else: - raise wizard.except_wizard('UserError','Date not in a defined fiscal year') + raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year')) states = { @@ -141,3 +142,4 @@ class wizard_report(wizard.interface): } } wizard_report('account.account.balance.report') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/wizard_aged_trial_balance.py b/addons/account/wizard/wizard_aged_trial_balance.py index 0fa4215ba69..ff02943ddfa 100755 --- a/addons/account/wizard/wizard_aged_trial_balance.py +++ b/addons/account/wizard/wizard_aged_trial_balance.py @@ -26,6 +26,7 @@ import datetime import pooler from mx.DateTime import * +from tools.translate import _ _aged_trial_form = """ @@ -63,7 +64,7 @@ def _calc_dates(self, cr, uid, data, context): res = {} period_length = data['form']['period_length'] if period_length<=0: - raise wizard.except_wizard('UserError', 'You must enter a period length that cannot be 0 or below !') + raise wizard.except_wizard(_('UserError'), _('You must enter a period length that cannot be 0 or below !')) start = datetime.date.fromtimestamp(time.mktime(time.strptime(data['form']['date1'],"%Y-%m-%d"))) start = DateTime(int(start.year),int(start.month),int(start.day)) if data['form']['direction_selection'] == 'past': @@ -110,3 +111,4 @@ class wizard_report(wizard.interface): } wizard_report('account.aged.trial.balance') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/wizard_automatic_reconcile.py b/addons/account/wizard/wizard_automatic_reconcile.py index bc2815bd373..4d270cdc6fe 100644 --- a/addons/account/wizard/wizard_automatic_reconcile.py +++ b/addons/account/wizard/wizard_automatic_reconcile.py @@ -24,6 +24,7 @@ import wizard import netsvc import pooler import time +from tools.translate import _ #TODO: diff --git a/addons/account/wizard/wizard_general_ledger_report.py b/addons/account/wizard/wizard_general_ledger_report.py index 841f5c8d893..47191fa1d2b 100644 --- a/addons/account/wizard/wizard_general_ledger_report.py +++ b/addons/account/wizard/wizard_general_ledger_report.py @@ -24,6 +24,7 @@ import wizard import pooler import locale import time +from tools.translate import _ account_form = ''' @@ -108,12 +109,12 @@ def _check_date(self, cr, uid, data, context): res = cr.dictfetchall() if res: if (data['form']['date_to'] > res[0]['date_stop'] or data['form']['date_to'] < res[0]['date_start']): - raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop']) + raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop']))) else: return 'checkreport' else: - raise wizard.except_wizard('UserError','Date not in a defined fiscal year') + raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year')) def _check_state(self, cr, uid, data, context): @@ -173,3 +174,4 @@ class wizard_report(wizard.interface): } } wizard_report('account.general.ledger.report') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/wizard_partner_balance_report.py b/addons/account/wizard/wizard_partner_balance_report.py index ee34ecbe7fe..c4241f7f4e9 100644 --- a/addons/account/wizard/wizard_partner_balance_report.py +++ b/addons/account/wizard/wizard_partner_balance_report.py @@ -23,6 +23,7 @@ import time import wizard import pooler +from tools.translate import _ period_form = ''' @@ -106,12 +107,12 @@ class wizard_report(wizard.interface): res = cr.dictfetchall() if res: if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']): - raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop']) + raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']), str(res[0]['date_stop']))) else: return 'report' else: - raise wizard.except_wizard('UserError','Date not in a defined fiscal year') + raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year')) states = { 'init': { @@ -125,3 +126,4 @@ class wizard_report(wizard.interface): } } wizard_report('account.partner.balance.report') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/wizard_refund.py b/addons/account/wizard/wizard_refund.py index 90a9ce76c11..b4c8cdd7897 100644 --- a/addons/account/wizard/wizard_refund.py +++ b/addons/account/wizard/wizard_refund.py @@ -24,6 +24,7 @@ import pooler import osv import netsvc import time +from tools.translate import _ sur_form = ''' diff --git a/addons/account/wizard/wizard_state_open.py b/addons/account/wizard/wizard_state_open.py index 9c3e4f516ff..4ba200f9b08 100644 --- a/addons/account/wizard/wizard_state_open.py +++ b/addons/account/wizard/wizard_state_open.py @@ -38,7 +38,7 @@ def _change_inv_state(self, cr, uid, data, context): pool_obj = pooler.get_pool(cr.dbname) data_inv = pool_obj.get('account.invoice').browse(cr, uid, data['ids'][0]) if data_inv.reconciled: - raise wizard.except_wizard('Warning', 'Invoice is already reconciled') + raise wizard.except_wizard(_('Warning'), _('Invoice is already reconciled')) wf_service = netsvc.LocalService("workflow") res = wf_service.trg_validate(uid, 'account.invoice', data['ids'][0], 'open_test', cr) return {} diff --git a/addons/account/wizard/wizard_statement_from_invoice.py b/addons/account/wizard/wizard_statement_from_invoice.py index 665c735f12b..c3b2553503c 100644 --- a/addons/account/wizard/wizard_statement_from_invoice.py +++ b/addons/account/wizard/wizard_statement_from_invoice.py @@ -1,3 +1,4 @@ +# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2008 Camptocamp SA All Rights Reserved. (JGG) @@ -171,3 +172,4 @@ class PopulateStatementFromInv(wizard.interface): }, } PopulateStatementFromInv('populate_statement_from_inv') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/wizard_third_party_ledger.py b/addons/account/wizard/wizard_third_party_ledger.py index 0382cb0ae4c..749e2f66396 100755 --- a/addons/account/wizard/wizard_third_party_ledger.py +++ b/addons/account/wizard/wizard_third_party_ledger.py @@ -23,6 +23,7 @@ import time import wizard import pooler +from tools.translate import _ period_form = ''' @@ -112,12 +113,12 @@ class wizard_report(wizard.interface): res = cr.dictfetchall() if res: if (data['form']['date2'] > res[0]['date_stop'] or data['form']['date2'] < res[0]['date_start']): - raise wizard.except_wizard('UserError','Date to must be set between ' + res[0]['date_start'] + " and " + res[0]['date_stop']) + raise wizard.except_wizard(_('UserError'),_('Date to must be set between %s and %s') % (str(res[0]['date_start']) , str(res[0]['date_stop']))) else: return 'report' else: - raise wizard.except_wizard('UserError','Date not in a defined fiscal year') + raise wizard.except_wizard(_('UserError'),_('Date not in a defined fiscal year')) def _check_state(self, cr, uid, data, context): @@ -142,3 +143,4 @@ class wizard_report(wizard.interface): wizard_report('account.third_party_ledger.report') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/wizard/wizard_use_model.py b/addons/account/wizard/wizard_use_model.py index 93a822c82a3..3815465d367 100644 --- a/addons/account/wizard/wizard_use_model.py +++ b/addons/account/wizard/wizard_use_model.py @@ -23,6 +23,7 @@ import wizard import time import datetime import pooler +from tools.translate import _ model_form = """ @@ -52,7 +53,7 @@ def _create_entries(self, cr, uid, data, context): period_id = pool_obj.get('account.period').find(cr,uid, context=context) if not period_id: - raise wizard.except_wizard('No period found !', 'Unable to find a valid period !') + raise wizard.except_wizard(_('No period found !'), _('Unable to find a valid period !')) period_id = period_id[0] move_id = pool_obj.get('account.move').create(cr, uid, { 'ref': model.ref, diff --git a/addons/account/wizard/wizard_vat.py b/addons/account/wizard/wizard_vat.py index 80d23c23878..209306dc32d 100755 --- a/addons/account/wizard/wizard_vat.py +++ b/addons/account/wizard/wizard_vat.py @@ -88,3 +88,4 @@ class wizard_report(wizard.interface): wizard_report('account.vat.declaration') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_analytic_default/__init__.py b/addons/account_analytic_default/__init__.py index 232beccbca3..cb62f07c026 100644 --- a/addons/account_analytic_default/__init__.py +++ b/addons/account_analytic_default/__init__.py @@ -20,3 +20,4 @@ # ############################################################################## import account_analytic_default +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_analytic_default/account_analytic_default.py b/addons/account_analytic_default/account_analytic_default.py index 4dc2788c52b..ab8323400da 100644 --- a/addons/account_analytic_default/account_analytic_default.py +++ b/addons/account_analytic_default/account_analytic_default.py @@ -106,3 +106,4 @@ class account_invoice_line(osv.osv): return res_prod account_invoice_line() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_analytic_plans/account_analytic_plans.py b/addons/account_analytic_plans/account_analytic_plans.py index 9bd60283136..3694f1d8390 100644 --- a/addons/account_analytic_plans/account_analytic_plans.py +++ b/addons/account_analytic_plans/account_analytic_plans.py @@ -30,6 +30,7 @@ from osv import fields, osv,orm import ir import tools +from tools.translate import _ class one2many_mod2(fields.one2many): def get(self, cr, obj, ids, name, user=None, offset=0, context=None, values=None): @@ -176,7 +177,7 @@ class account_analytic_plan_instance(osv.osv): pids = self.pool.get('account.analytic.plan.instance').search(cr, uid, [('name','=',vals['name']),('code','=',vals['code']),('plan_id','<>',False)]) if pids: - raise osv.except_osv('Error', 'A model having this name and code already exists !') + raise osv.except_osv(_('Error'), _('A model having this name and code already exists !')) res = self.pool.get('account.analytic.plan.line').search(cr,uid,[('plan_id','=',journal.plan_id.id)]) for i in res: @@ -189,7 +190,7 @@ class account_analytic_plan_instance(osv.osv): if self.pool.get('account.analytic.account').search(cr,uid,[('parent_id','child_of',[item.root_analytic_id.id]),('id','=',tempo[2]['analytic_account_id'])]): 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 " + str(item.min_required) + " and " + str(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)))) return super(account_analytic_plan_instance, self).create(cr, uid, vals, context) @@ -374,3 +375,4 @@ class analytic_default(osv.osv): } analytic_default() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_analytic_plans/wizard/create_model.py b/addons/account_analytic_plans/wizard/create_model.py index 04de182e8b6..4ca9cc6c19f 100644 --- a/addons/account_analytic_plans/wizard/create_model.py +++ b/addons/account_analytic_plans/wizard/create_model.py @@ -23,6 +23,7 @@ import wizard import time import netsvc import pooler +from tools.translate import _ info = ''' @@ -35,10 +36,10 @@ def activate(self, cr, uid, data, context): if data['id']: plan = plan_obj.browse(cr, uid, data['id'], context) if (not plan.name) or (not plan.code): - raise wizard.except_wizard('Error', 'Please put a name and a code before saving the model !') + raise wizard.except_wizard(_('Error'), _('Please put a name and a code before saving the model !')) pids = pooler.get_pool(cr.dbname).get('account.analytic.plan').search(cr, uid, [], context=context) if (not pids): - raise wizard.except_wizard('Error', 'No analytic plan defined !') + raise wizard.except_wizard(_('Error'), _('No analytic plan defined !')) plan_obj.write(cr,uid,[data['id']],{'plan_id':pids[0]}) return 'info' else: diff --git a/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py b/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py index 8df03d85218..483e9d54893 100644 --- a/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py +++ b/addons/account_analytic_plans/wizard/wizard_crossovered_analytic.py @@ -23,6 +23,7 @@ import wizard import time import datetime import pooler +from tools.translate import _ form = """ @@ -59,7 +60,7 @@ class wizard_crossovered_analytic(wizard.interface): break if flag: - raise wizard.except_wizard('User Error',"There are no Analytic lines related to Account '" + name +"'" ) + raise wizard.except_wizard(_('User Error'),_('There are no Analytic lines related to Account %s' % name)) return {} states = { diff --git a/addons/account_budget/crossovered_budget.py b/addons/account_budget/crossovered_budget.py index d8212b1da43..80679a6c229 100644 --- a/addons/account_budget/crossovered_budget.py +++ b/addons/account_budget/crossovered_budget.py @@ -25,6 +25,7 @@ import netsvc from mx import DateTime import time import datetime +from tools.translate import _ def strToDate(dt): @@ -161,7 +162,7 @@ class crossovered_budget_lines(osv.osv): for line in self.browse(cr, uid, ids): acc_ids = [x.id for x in line.general_budget_id.account_ids] if not acc_ids: - raise osv.except_osv('Error!',"The General Budget '" + str(line.general_budget_id.name) + "' has no Accounts!" ) + raise osv.except_osv(_('Error!'),_("The General Budget '%s' has no Accounts!" % str(line.general_budget_id.name))) date_to = line.date_to date_from = line.date_from if context.has_key('wizard_date_from'): diff --git a/addons/account_budget/wizard/wizard_budget_report.py b/addons/account_budget/wizard/wizard_budget_report.py index f9fac54df49..681cfb976ea 100644 --- a/addons/account_budget/wizard/wizard_budget_report.py +++ b/addons/account_budget/wizard/wizard_budget_report.py @@ -24,6 +24,7 @@ import time import wizard import datetime import pooler +from tools.translate import _ dates_form = ''' @@ -41,7 +42,7 @@ class wizard_report(wizard.interface): pool_obj = pooler.get_pool(cr.dbname) data_model = pool_obj.get(data['model']).browse(cr,uid,data['id']) if not data_model.dotation_ids: - raise wizard.except_wizard('Insufficient Data!',"No Dotations or Master Budget Expenses Found on Budget '"+ data_model.name +"'!") + raise wizard.except_wizard(_('Insufficient Data!'),_('No Dotations or Master Budget Expenses Found on Budget %s!') % data_model.name) return data['form'] states = { diff --git a/addons/account_date_check/account_date_check.py b/addons/account_date_check/account_date_check.py index 6040df478d5..4ee33dbef85 100644 --- a/addons/account_date_check/account_date_check.py +++ b/addons/account_date_check/account_date_check.py @@ -29,6 +29,7 @@ import ir from mx import DateTime import pooler from tools import config +from tools.translate import _ class account_journal(osv.osv): _inherit='account.journal' @@ -62,7 +63,7 @@ class account_move_line(osv.osv): if not journal.allow_date: period=self.pool.get('account.period').browse(cr,uid,[period_id])[0] if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') and time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'): - raise osv.except_osv('Error','The date of your account move is not in the defined period !') + raise osv.except_osv(_('Error'),_('The date of your account move is not in the defined period !')) else: return True diff --git a/addons/account_payment/account_move_line.py b/addons/account_payment/account_move_line.py index eb45173afa4..cd7578d4527 100644 --- a/addons/account_payment/account_move_line.py +++ b/addons/account_payment/account_move_line.py @@ -21,7 +21,7 @@ ############################################################################## from osv import fields, osv - +from tools.translate import _ class account_move_line(osv.osv): _inherit = "account.move.line" diff --git a/addons/account_payment/report/__init__.py b/addons/account_payment/report/__init__.py index ea612903a30..35127efa0ab 100644 --- a/addons/account_payment/report/__init__.py +++ b/addons/account_payment/report/__init__.py @@ -21,3 +21,4 @@ ############################################################################## import payment_order +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_payment/report/payment_order.py b/addons/account_payment/report/payment_order.py index 1e3e9c3192e..4767c63ba31 100644 --- a/addons/account_payment/report/payment_order.py +++ b/addons/account_payment/report/payment_order.py @@ -31,4 +31,6 @@ class payment_order(report_sxw.rml_parse): 'time': time, }) -report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False) \ No newline at end of file +report_sxw.report_sxw('report.payment.order', 'payment.order', 'addons/account_payment/report/payment_order.rml', parser=payment_order,header=False) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_report/account.py b/addons/account_report/account.py index 989de2a0260..bf8c69754f7 100644 --- a/addons/account_report/account.py +++ b/addons/account_report/account.py @@ -24,6 +24,7 @@ import netsvc from osv import fields, osv import pooler from tools.misc import currency +from tools.translate import _ import mx.DateTime from mx.DateTime import RelativeDateTime, now, DateTime, localtime diff --git a/addons/account_report/wizard/wizard_print_indicators.py b/addons/account_report/wizard/wizard_print_indicators.py index 1a7a8d1da74..304f4ca5ad0 100644 --- a/addons/account_report/wizard/wizard_print_indicators.py +++ b/addons/account_report/wizard/wizard_print_indicators.py @@ -22,6 +22,7 @@ import wizard import pooler +from tools.translate import _ form = ''' @@ -55,7 +56,7 @@ def _load_base(self, cr, uid, data, context): def _check_len(self, cr, uid, data, context): if len(data['form']['base_selection'][0][2])>8: - raise wizard.except_wizard('User Error!',"Please select maximum 8 records to fit the page-width.") + raise wizard.except_wizard(_('User Error!'),_("Please select maximum 8 records to fit the page-width.")) return data['form'] class wizard_print_indicators(wizard.interface): diff --git a/addons/account_voucher/__init__.py b/addons/account_voucher/__init__.py index 43b37238ab9..594c6935d4a 100755 --- a/addons/account_voucher/__init__.py +++ b/addons/account_voucher/__init__.py @@ -23,3 +23,4 @@ import voucher import voucher_account import report +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/report/__init__.py b/addons/account_voucher/report/__init__.py index 9a00c90c1f1..989b721eeac 100755 --- a/addons/account_voucher/report/__init__.py +++ b/addons/account_voucher/report/__init__.py @@ -20,4 +20,6 @@ # ############################################################################## import report_voucher -import report_voucher_amount \ No newline at end of file +import report_voucher_amount + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/report/report_voucher.py b/addons/account_voucher/report/report_voucher.py index 561fdcce485..f6e6dab9244 100755 --- a/addons/account_voucher/report/report_voucher.py +++ b/addons/account_voucher/report/report_voucher.py @@ -64,4 +64,6 @@ report_sxw.report_sxw( 'account.voucher', 'addons/account_voucher/report/report_voucher.rml', parser=report_voucher,header=False -) \ No newline at end of file +) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/report/report_voucher_amount.py b/addons/account_voucher/report/report_voucher_amount.py index 8b02a5e6fe7..585c4f54d04 100755 --- a/addons/account_voucher/report/report_voucher_amount.py +++ b/addons/account_voucher/report/report_voucher_amount.py @@ -43,4 +43,6 @@ report_sxw.report_sxw( 'account.voucher', 'addons/account_voucher/report/report_voucher_amount.rml', parser=report_voucher_amount,header=False -) \ No newline at end of file +) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/voucher.py b/addons/account_voucher/voucher.py index d5a4f987562..099ce18e323 100755 --- a/addons/account_voucher/voucher.py +++ b/addons/account_voucher/voucher.py @@ -28,6 +28,7 @@ import mx.DateTime from mx.DateTime import RelativeDateTime from tools import config +from tools.translate import _ type2journal = { 'rec_voucher':'cash', @@ -180,7 +181,7 @@ class account_voucher(osv.osv): if t['state'] in ('draft', 'cancel'): unlink_ids.append(t['id']) else: - raise osv.except_osv('Invalid action !', 'Cannot delete invoice(s) which are already opened or paid !') + raise osv.except_osv(_('Invalid action !'), _('Cannot delete invoice(s) which are already opened or paid !')) osv.osv.unlink(self, cr, uid, unlink_ids, context=context) return True @@ -604,3 +605,4 @@ class VoucherLine(osv.osv): } VoucherLine() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/voucher_account.py b/addons/account_voucher/voucher_account.py index 5f10563743f..3806690acd9 100644 --- a/addons/account_voucher/voucher_account.py +++ b/addons/account_voucher/voucher_account.py @@ -144,3 +144,4 @@ class Account(osv.osv): } Account() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account_voucher/wizard/__init__.py b/addons/account_voucher/wizard/__init__.py index c42bd05fc89..735296d876b 100644 --- a/addons/account_voucher/wizard/__init__.py +++ b/addons/account_voucher/wizard/__init__.py @@ -20,3 +20,4 @@ # ############################################################################## import open_voucher +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index ba99465579e..1f630053864 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -21,6 +21,7 @@ ############################################################################## from osv import fields,osv from osv import orm +from tools.translate import _ class analytic_user_funct_grid(osv.osv): @@ -94,9 +95,9 @@ class hr_analytic_timesheet(osv.osv): if not a: a = r.product_id.categ_id.property_account_expense_categ.id if not a: - raise osv.except_osv('Error !', - 'There is no expense account define ' \ - 'for this product: "%s" (id:%d)' % \ + raise osv.except_osv(_('Error !'), + _('There is no expense account define ' \ + 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) amount = unit_amount * self.pool.get('product.uom')._compute_price(cr, uid, r.product_id.uom_id.id, r.product_id.standard_price, False) @@ -127,9 +128,9 @@ class hr_analytic_timesheet(osv.osv): if not a: a = r.product_id.categ_id.property_account_expense_categ.id if not a: - raise osv.except_osv('Error !', - 'There is no expense account define ' \ - 'for this product: "%s" (id:%d)' % \ + raise osv.except_osv(_('Error !'), + _('There is no expense account define ' \ + 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) amount = unit_amount * r.product_id.uom_id._compute_price(cr, uid, r.product_id.uom_id.id, r.product_id.standard_price, False) diff --git a/addons/auction/auction.py b/addons/auction/auction.py index 17f89e19d57..176ac3039bb 100644 --- a/addons/auction/auction.py +++ b/addons/auction/auction.py @@ -25,6 +25,7 @@ import netsvc from osv import fields, osv, orm import ir from mx import DateTime +from tools.translate import _ #---------------------------------------------------------- # Auction Artists @@ -627,7 +628,7 @@ class auction_lots(osv.osv): continue partner_r=self.pool.get('res.partner') if not lot.ach_uid.id: - raise orm.except_orm('Missed buyer !', 'The object "%s" has no buyer assigned.' % (lot.name,)) + raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,)) else: partner_ref =lot.ach_uid.id lot_name = lot.obj_num @@ -635,7 +636,7 @@ class auction_lots(osv.osv): contact_addr_id = res['contact'] invoice_addr_id = res['invoice'] if not invoice_addr_id: - raise orm.except_orm('No Invoice Address', 'The Buyer "%s" has no Invoice Address.' % (contact_addr_id,)) + raise orm.except_orm(_('No Invoice Address'), _('The Buyer "%s" has no Invoice Address.') % (contact_addr_id,)) inv = { 'name': 'Auction proforma:' +lot.name, 'journal_id': lot.auction_id.journal_id.id, @@ -754,13 +755,13 @@ class auction_lots(osv.osv): continue partner_r=self.pool.get('res.partner') if not lot.ach_uid.id: - raise orm.except_orm('Missed buyer !', 'The object "%s" has no buyer assigned.' % (lot.name,)) + raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,)) if (lot.auction_id.id,lot.ach_uid.id) in invoices: inv_id = invoices[(lot.auction_id.id,lot.ach_uid.id)] else: add = partner_r.read(cr, uid, [lot.ach_uid.id], ['address'])[0]['address'] if not len(add): - raise orm.except_orm('Missed Address !', 'The Buyer has no Invoice Address.') + raise orm.except_orm(_('Missed Address !'), _('The Buyer has no Invoice Address.')) price = lot.obj_price or 0.0 lot_name =lot.obj_num inv={ diff --git a/addons/auction/barcode/__init__.py b/addons/auction/barcode/__init__.py index a96948744f1..bfa51978b0d 100644 --- a/addons/auction/barcode/__init__.py +++ b/addons/auction/barcode/__init__.py @@ -31,3 +31,4 @@ # __version__ = '0.9' +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/barcode/code128.py b/addons/auction/barcode/code128.py index 1b580d22b8d..64ab5bc46d4 100644 --- a/addons/auction/barcode/code128.py +++ b/addons/auction/barcode/code128.py @@ -319,3 +319,4 @@ class Code128(MultiWidthBarcode): dval = dval + _patterns[c] self.decomposed = dval return self.decomposed +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/barcode/code39.py b/addons/auction/barcode/code39.py index 08e0c9d4b5d..283f68244a4 100644 --- a/addons/auction/barcode/code39.py +++ b/addons/auction/barcode/code39.py @@ -253,3 +253,4 @@ class Extended39(_Code39Base): raise ValueError self.encoded = _encode39(self.encoded, self.checksum) return self.encoded +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/barcode/code93.py b/addons/auction/barcode/code93.py index fc19ee3ee98..bb556829687 100644 --- a/addons/auction/barcode/code93.py +++ b/addons/auction/barcode/code93.py @@ -230,3 +230,4 @@ class Extended93(_Code93Base): raise ValueError self.encoded = _encode93(self.encoded) return self.encoded +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/barcode/common.py b/addons/auction/barcode/common.py index a73ed7d73f5..0ef19a6e64f 100644 --- a/addons/auction/barcode/common.py +++ b/addons/auction/barcode/common.py @@ -703,3 +703,4 @@ class Code11(Barcode): dval = dval + self.patterns[c] + 'i' self.decomposed = dval[:-1] return self.decomposed +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/barcode/fourstate.py b/addons/auction/barcode/fourstate.py index 0751fba5c92..b83e7378f9b 100644 --- a/addons/auction/barcode/fourstate.py +++ b/addons/auction/barcode/fourstate.py @@ -79,3 +79,4 @@ _ozC_patterns = { } #http://www.auspost.com.au/futurepost/ +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/barcode/test.py b/addons/auction/barcode/test.py index d22df49b08d..93a8c2e6d9c 100644 --- a/addons/auction/barcode/test.py +++ b/addons/auction/barcode/test.py @@ -53,3 +53,4 @@ if __name__=='__main__': run() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/barcode/usps.py b/addons/auction/barcode/usps.py index 193e22f68c9..1dc2e89d91e 100644 --- a/addons/auction/barcode/usps.py +++ b/addons/auction/barcode/usps.py @@ -229,3 +229,4 @@ class POSTNET(Barcode): h = self.fbarheight self.rect(left, 0.0, self.barwide, h) left = left + self.barwide + self.spacewide +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/auction/report/buyer_list.py b/addons/auction/report/buyer_list.py index 3079b0fa050..eaa44f22c0c 100644 --- a/addons/auction/report/buyer_list.py +++ b/addons/auction/report/buyer_list.py @@ -25,6 +25,7 @@ import pooler import time from report import report_sxw from osv import osv +from tools.translate import _ class buyer_list(report_sxw.rml_parse): auc_lot_ids=[] diff --git a/addons/auction/wizard/wizard_aie_send.py b/addons/auction/wizard/wizard_aie_send.py index a261892e660..cdb27d5957d 100644 --- a/addons/auction/wizard/wizard_aie_send.py +++ b/addons/auction/wizard/wizard_aie_send.py @@ -30,6 +30,7 @@ import base64 import mimetypes import httplib import threading +from tools.translate import _ login_form = ''' diff --git a/addons/auction/wizard/wizard_aie_send_result.py b/addons/auction/wizard/wizard_aie_send_result.py index a1fc9dce280..c74b9100045 100644 --- a/addons/auction/wizard/wizard_aie_send_result.py +++ b/addons/auction/wizard/wizard_aie_send_result.py @@ -26,6 +26,7 @@ import wizard import netsvc +from tools.translate import _ login_form = ''' diff --git a/addons/audittrail/audittrail.py b/addons/audittrail/audittrail.py index 22c059a7f22..bd3eace7542 100644 --- a/addons/audittrail/audittrail.py +++ b/addons/audittrail/audittrail.py @@ -27,6 +27,7 @@ import netsvc import pooler import string import time,copy +from tools.translate import _ class audittrail_rule(osv.osv): _name = 'audittrail.rule' @@ -59,8 +60,8 @@ class audittrail_rule(osv.osv): obj = self.pool.get(thisrule.object_id.model) if not obj: raise osv.except_osv( - 'WARNING:audittrail is not part of the pool', - 'Change audittrail depends -- Setting rule as DRAFT') + _('WARNING:audittrail is not part of the pool'), + _('Change audittrail depends -- Setting rule as DRAFT')) self.write(cr, uid, [thisrule.id], {"state": "draft"}) val={ "name":'View Log', diff --git a/addons/base_module_merge/wizard/base_module_merge.py b/addons/base_module_merge/wizard/base_module_merge.py index e2c8bb3f107..d056e56d8b8 100644 --- a/addons/base_module_merge/wizard/base_module_merge.py +++ b/addons/base_module_merge/wizard/base_module_merge.py @@ -26,6 +26,7 @@ import pooler import tools import os from xml.dom import minidom +from tools.translate import _ info_start_form = ''' diff --git a/addons/base_module_publish/wizard/base_module_publish.py b/addons/base_module_publish/wizard/base_module_publish.py index 30416b2dde0..954e22e7fce 100644 --- a/addons/base_module_publish/wizard/base_module_publish.py +++ b/addons/base_module_publish/wizard/base_module_publish.py @@ -29,6 +29,7 @@ import base64 import module_zip import tools +from tools.translate import _ intro_form = ''' diff --git a/addons/base_module_publish/wizard/base_module_publish_all.py b/addons/base_module_publish/wizard/base_module_publish_all.py index 09f2be26cf6..1272cf09353 100644 --- a/addons/base_module_publish/wizard/base_module_publish_all.py +++ b/addons/base_module_publish/wizard/base_module_publish_all.py @@ -25,6 +25,7 @@ import pooler import module_zip from base_module_publish import post_multipart from urllib import urlopen +from tools.translate import _ intro_form = ''' @@ -102,7 +103,7 @@ def _upload(self, cr, uid, datas, context): res['module_file']) ]) if result[0] == "1": - raise wizard.except_wizard('Error', 'Login failed!') + raise wizard.except_wizard(_('Error'), _('Login failed!')) elif result[0] == "0": log[0].append(mod.name) elif result[0] == "2": diff --git a/addons/base_module_publish/wizard/module_zip.py b/addons/base_module_publish/wizard/module_zip.py index 4ccb86044df..ec9b3aa00c4 100644 --- a/addons/base_module_publish/wizard/module_zip.py +++ b/addons/base_module_publish/wizard/module_zip.py @@ -21,6 +21,7 @@ ############################################################################## import pooler import addons +from tools.translate import _ def createzip(cr, uid, moduleid, context, b64enc=True, src=True): pool = pooler.get_pool(cr.dbname) diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index 83284d90b0c..83cb1539894 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -24,6 +24,7 @@ import string import time import tools from osv import fields,osv,orm +from tools.translate import _ #class ir_model_fields(osv.osv): # _inherit = 'ir.model.fields' @@ -216,7 +217,7 @@ class report_creator(osv.osv): if reference_model_dict: self.model_set_id = model_dict.get(reference_model_dict.keys()[reference_model_dict.values().index(min(reference_model_dict.values()))]) if model_list and not len(model_dict.keys()) == 1: - raise osv.except_osv("No Related Models!!",'These is/are model(s) (%s) in selection which is/are not related to any other model'%','.join(model_list) ) + raise osv.except_osv(_('No Related Models!!'),_('These is/are model(s) (%s) in selection which is/are not related to any other model') % ','.join(model_list)) if filter_ids and where_list<>[]: where_list.append('and') where_list.append(' ') diff --git a/addons/base_report_designer/wizard/base_report_designer_modify.py b/addons/base_report_designer/wizard/base_report_designer_modify.py index e15a0408ae7..a53be164cee 100644 --- a/addons/base_report_designer/wizard/base_report_designer_modify.py +++ b/addons/base_report_designer/wizard/base_report_designer_modify.py @@ -27,6 +27,7 @@ import pooler import urllib import base64 import tools +from tools.translate import _ intro_form = ''' diff --git a/addons/board/wizard/board_wizard.py b/addons/board/wizard/board_wizard.py index a5cd20da477..02149c8eabc 100644 --- a/addons/board/wizard/board_wizard.py +++ b/addons/board/wizard/board_wizard.py @@ -25,6 +25,7 @@ import time import wizard import osv import pooler +from tools.translate import _ section_form = ''' @@ -42,7 +43,7 @@ def check_views(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) board = pool.get('board.board').browse(cr, uid, data['id']) if not board.line_ids: - raise wizard.except_wizard('User Error!',"Please Insert Dashboard View(s) !") + raise wizard.except_wizard(_('User Error!'),_('Please Insert Dashboard View(s) !')) return data['form'] def board_menu_create(self, cr, uid, data, context): diff --git a/addons/board_auction/__init__.py b/addons/board_auction/__init__.py index e69de29bb2d..cf58786951a 100644 --- a/addons/board_auction/__init__.py +++ b/addons/board_auction/__init__.py @@ -0,0 +1 @@ +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/board_crm_configuration/__init__.py b/addons/board_crm_configuration/__init__.py index 7d41dfe964c..df7a8a9df47 100644 --- a/addons/board_crm_configuration/__init__.py +++ b/addons/board_crm_configuration/__init__.py @@ -20,3 +20,4 @@ # ############################################################################## +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/board_document/__init__.py b/addons/board_document/__init__.py index e69de29bb2d..cf58786951a 100644 --- a/addons/board_document/__init__.py +++ b/addons/board_document/__init__.py @@ -0,0 +1 @@ +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_configuration/__init__.py b/addons/crm_configuration/__init__.py index 80ec139c0f1..f6b8b7c3bc8 100644 --- a/addons/crm_configuration/__init__.py +++ b/addons/crm_configuration/__init__.py @@ -23,3 +23,4 @@ import crm_config import report import wizard +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_configuration/wizard/__init__.py b/addons/crm_configuration/wizard/__init__.py index 4a7862c40f7..3fbc5f7ef54 100644 --- a/addons/crm_configuration/wizard/__init__.py +++ b/addons/crm_configuration/wizard/__init__.py @@ -23,3 +23,4 @@ import meeting_planify import wizard_partner_create import wizard_opportunity_set +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_configuration/wizard/meeting_planify.py b/addons/crm_configuration/wizard/meeting_planify.py index b06b049f837..f2044987ac3 100644 --- a/addons/crm_configuration/wizard/meeting_planify.py +++ b/addons/crm_configuration/wizard/meeting_planify.py @@ -73,3 +73,4 @@ class make_meeting(wizard.interface): make_meeting('crm.case.meeting') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_configuration/wizard/wizard_opportunity_set.py b/addons/crm_configuration/wizard/wizard_opportunity_set.py index 1a3ee4a6a8c..6d3527feda4 100644 --- a/addons/crm_configuration/wizard/wizard_opportunity_set.py +++ b/addons/crm_configuration/wizard/wizard_opportunity_set.py @@ -26,6 +26,7 @@ import wizard import netsvc import ir import pooler +from tools.translate import _ case_form = """ @@ -49,7 +50,7 @@ class make_opportunity(wizard.interface): case_obj = pool.get('crm.case') for case in case_obj.browse(cr, uid, data['ids']): if not case.partner_id: - raise wizard.except_wizard("Warning !", + raise wizard.except_wizard(_('Warning !'), _('You must assign a partner to this lead before converting to opportunity.\n' \ 'You can use the convert to partner button.')) return {'name': case.name, 'probability': case.probability or 20.0, 'planned_revenue':case.planned_revenue} @@ -60,7 +61,7 @@ class make_opportunity(wizard.interface): data_obj = pool.get('ir.model.data') id = section_obj.search(cr, uid, [('code','=','oppor')], context=context) if not id: - raise wizard.except_wizard(_("Error !"), + raise wizard.except_wizard(_('Error !'), _('You did not installed the opportunities tracking when you configured the crm_configuration module.' \ '\nI can not convert the lead to an opportunity, you must create a section with the code \'oppor\'.' )) @@ -106,3 +107,4 @@ class make_opportunity(wizard.interface): make_opportunity('crm.case.opportunity_set') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_configuration/wizard/wizard_partner_create.py b/addons/crm_configuration/wizard/wizard_partner_create.py index 91283c209da..a5e8e0f47b0 100644 --- a/addons/crm_configuration/wizard/wizard_partner_create.py +++ b/addons/crm_configuration/wizard/wizard_partner_create.py @@ -26,6 +26,7 @@ import wizard import netsvc import ir import pooler +from tools.translate import _ case_form = """ @@ -46,7 +47,7 @@ class make_partner(wizard.interface): case_obj = pool.get('crm.case') for case in case_obj.browse(cr, uid, data['ids']): if case.partner_id: - raise wizard.except_wizard("Warning !", + raise wizard.except_wizard(_('Warning !'), _('A partner is already defined on this lead.')) return {} @@ -58,7 +59,7 @@ class make_partner(wizard.interface): for case in case_obj.browse(cr, uid, data['ids']): partner_id = partner_obj.search(cr, uid, [('name', '=', case.partner_name or case.name)]) if partner_id: - raise wizard.except_wizard("Warning !",_('A partner is already existing with the same name.')) + raise wizard.except_wizard(_('Warning !'),_('A partner is already existing with the same name.')) else: partner_id = partner_obj.create(cr, uid, { 'name': case.partner_name or case.name, diff --git a/addons/crm_vertical/__init__.py b/addons/crm_vertical/__init__.py index d680fc633b6..51f5dcf919b 100644 --- a/addons/crm_vertical/__init__.py +++ b/addons/crm_vertical/__init__.py @@ -20,3 +20,4 @@ # ############################################################################## #import crm_vertical +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_vertical/crm_vertical.py b/addons/crm_vertical/crm_vertical.py index 5393c61260e..8b057eb14c4 100644 --- a/addons/crm_vertical/crm_vertical.py +++ b/addons/crm_vertical/crm_vertical.py @@ -26,6 +26,7 @@ from osv import fields,osv,orm import os import mx.DateTime import base64 +from tools.translate import _ # here need to implement inheritance on osv_memory object. after that, it will work well. class crm_menu_config_wizard(osv.osv_memory): @@ -40,7 +41,8 @@ class crm_menu_config_wizard(osv.osv_memory): try: tools.convert_xml_import(cr, 'crm_configuration', tools.file_open(os.path.join('crm_vertical',file_name )), {}, 'init', *args) except Exception, e: - raise osv.except_osv('Error !', e) + raise osv.except_osv(_('Error !'), str(e)) return res crm_menu_config_wizard() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document/document.py b/addons/document/document.py index e86d90e4643..7138eee77d5 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -38,6 +38,7 @@ import string from psycopg2 import Binary from tools import config import tools +from tools.translate import _ def random_name(): random.seed() @@ -376,14 +377,14 @@ class document_directory(osv.osv): return True def write(self, cr, uid, ids, vals, context=None): if not self._check_duplication(cr,uid,vals,ids,op='write'): - raise osv.except_osv('ValidateError', _('Directory name must be unique!')) + raise osv.except_osv(_('ValidateError'), _('Directory name must be unique!')) return super(document_directory,self).write(cr,uid,ids,vals,context=context) def create(self, cr, uid, vals, context=None): if not self._check_duplication(cr,uid,vals): - raise osv.except_osv('ValidateError', _('Directory name must be unique!')) + raise osv.except_osv(_('ValidateError'), _('Directory name must be unique!')) if vals.get('name',False) and (vals.get('name').find('/')+1 or vals.get('name').find('@')+1 or vals.get('name').find('$')+1 or vals.get('name').find('#')+1) : - raise osv.except_osv('ValidateError', _('Directory name contains special characters!')) + raise osv.except_osv(_('ValidateError'), _('Directory name contains special characters!')) return super(document_directory,self).create(cr, uid, vals, context) document_directory() @@ -516,7 +517,7 @@ class document_file(osv.osv): try: os.makedirs(path) except: - raise except_orm('Permission Denied !', 'You do not permissions to write on the server side.') + raise except_orm(_('Permission Denied !'), _('You do not permissions to write on the server side.')) flag = None # This can be improved @@ -534,7 +535,7 @@ class document_file(osv.osv): cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%s where id=%s', (os.path.join(flag,filename),'fs',len(v),id)) return True except Exception,e : - raise except_orm('Error!', str(e)) + raise except_orm(_('Error!'), str(e)) _columns = { 'user_id': fields.many2one('res.users', 'Owner', select=1), @@ -598,7 +599,7 @@ class document_file(osv.osv): if not len(res): return False if not self._check_duplication(cr,uid,vals,ids,'write'): - raise except_orm('ValidateError', 'File name must be unique!') + raise except_orm(_('ValidateError'), _('File name must be unique!')) result = super(document_file,self).write(cr,uid,ids,vals,context=context) cr.commit() try: @@ -651,7 +652,7 @@ class document_file(osv.osv): datas=vals.get('datas',False) vals['file_size']= len(datas) if not self._check_duplication(cr,uid,vals): - raise except_orm('ValidateError', 'File name must be unique!') + raise except_orm(_('ValidateError'), _('File name must be unique!')) result = super(document_file,self).create(cr, uid, vals, context) cr.commit() try: diff --git a/addons/document_ics/__init__.py b/addons/document_ics/__init__.py index 1aa5ae04ca6..faf96b9d189 100644 --- a/addons/document_ics/__init__.py +++ b/addons/document_ics/__init__.py @@ -21,3 +21,4 @@ ############################################################################## import document +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event/event.py b/addons/event/event.py index 30a3d1a2f43..9f12281d8f9 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -25,6 +25,7 @@ import time import netsvc import pooler import tools +from tools.translate import _ class crm_case_log(osv.osv): _inherit = 'crm.case.log' diff --git a/addons/event/wizard/confirm_registration.py b/addons/event/wizard/confirm_registration.py index 5449331763d..3a9a79712c8 100644 --- a/addons/event/wizard/confirm_registration.py +++ b/addons/event/wizard/confirm_registration.py @@ -78,3 +78,4 @@ class confirm_registration(wizard.interface): } confirm_registration('event.confirm_registration') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event_project/wizard/event_task.py b/addons/event_project/wizard/event_task.py index a3048cb3fae..8821f389f86 100644 --- a/addons/event_project/wizard/event_task.py +++ b/addons/event_project/wizard/event_task.py @@ -21,13 +21,14 @@ ############################################################################## import wizard import pooler +from tools.translate import _ def _event_tasks(self, cr, uid, data, context): event_id = data['id'] cr.execute('SELECT project_id FROM event_event WHERE id = %s', (event_id, )) res = cr.fetchone() if not res[0]: - raise wizard.except_wizard('Error !', 'No project defined for this event.\nYou can create one with the retro-planning button !') + raise wizard.except_wizard(_('Error !'), _('No project defined for this event.\nYou can create one with the retro-planning button !')) value = { 'domain': [('project_id', '=', res[0])], 'name': 'Tasks', diff --git a/addons/hr/hr.py b/addons/hr/hr.py index b1de55a6ed5..5489735db29 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -171,3 +171,4 @@ class hr_timesheet(osv.osv): hr_timesheet() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_holidays/hr.py b/addons/hr_holidays/hr.py index 7e2b7592d18..6ce208e11f8 100644 --- a/addons/hr_holidays/hr.py +++ b/addons/hr_holidays/hr.py @@ -34,7 +34,7 @@ import pooler import netsvc import datetime from osv import fields, osv - +from tools.translate import _ def _employee_get(obj,cr,uid,context={}): ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id','=', uid)]) @@ -206,7 +206,7 @@ class hr_holidays(osv.osv): leaves_rest=obj_holidays_per_user.max_leaves - obj_holidays_per_user.leaves_taken if not obj_holidays_per_user.holiday_status.limit: if leaves_rest < leave_asked: - raise osv.except_osv('Attention!','You Cannot Validate leaves while available leaves are less than asked leaves.') + raise osv.except_osv(_('Attention!'),_('You Cannot Validate leaves while available leaves are less than asked leaves.')) self.pool.get('hr.holidays.per.user').write(cr,uid,obj_holidays_per_user.id,{'leaves_taken':obj_holidays_per_user.leaves_taken + leave_asked}) if record.holiday_status.section_id: vals={} diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index d189e25ad0f..a74efd53cdd 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -24,7 +24,7 @@ import time from osv import fields from osv import osv from osv.orm import except_orm - +from tools.translate import _ class hr_employee(osv.osv): _name = "hr.employee" @@ -124,7 +124,7 @@ class hr_analytic_timesheet(osv.osv): raise except_orm(_('ValidateError'), _('No analytic account defined on the project.\nPlease set one or we can not automatically fill the timesheet.')) else: - raise + raise except_orm(_('UnknownError'), str(e)) def on_change_user_id(self, cr, uid, ids, user_id): if not user_id: diff --git a/addons/l10n_be/wizard/__init__.py b/addons/l10n_be/wizard/__init__.py index b12b8d8b7fc..fd9ec7f0bae 100644 --- a/addons/l10n_be/wizard/__init__.py +++ b/addons/l10n_be/wizard/__init__.py @@ -20,4 +20,6 @@ # ############################################################################## import account_vat_declaration -import partner_vat_listing \ No newline at end of file +import partner_vat_listing + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/wizard/account_vat_declaration.py b/addons/l10n_be/wizard/account_vat_declaration.py index 7a6baef2f11..d913cf20e12 100644 --- a/addons/l10n_be/wizard/account_vat_declaration.py +++ b/addons/l10n_be/wizard/account_vat_declaration.py @@ -127,3 +127,4 @@ class wizard_vat_declaration(wizard.interface): } wizard_vat_declaration('wizard.account.xml.vat.declaration') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/wizard/partner_vat_listing.py b/addons/l10n_be/wizard/partner_vat_listing.py index 051ecd1b273..71506be615e 100644 --- a/addons/l10n_be/wizard/partner_vat_listing.py +++ b/addons/l10n_be/wizard/partner_vat_listing.py @@ -24,6 +24,7 @@ import time import datetime import pooler import base64 +from tools.translate import _ form = """ @@ -67,7 +68,7 @@ class wizard_vat(wizard.interface): obj_cmpny = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid).company_id company_vat = obj_cmpny.partner_id.vat if not company_vat: - raise wizard.except_wizard('Data Insufficient','No VAT Number Associated with Main Company!') + raise wizard.except_wizard(_('Data Insufficient'),_('No VAT Number Associated with Main Company!')) cref = company_vat + seq_controlref dnum = cref + seq_declarantnum @@ -75,7 +76,7 @@ class wizard_vat(wizard.interface): p_id_list=pooler.get_pool(cr.dbname).get('res.partner').search(cr,uid,[('vat_subjected','!=',False)]) if not p_id_list: - raise wizard.except_wizard('Data Insufficient!','No partner has a VAT Number asociated with him.') + raise wizard.except_wizard(_('Data Insufficient!'),_('No partner has a VAT Number asociated with him.')) obj_year=pooler.get_pool(cr.dbname).get('account.fiscalyear').browse(cr,uid,data['form']['fyear']) period_ids = pooler.get_pool(cr.dbname).get('account.period').search(cr, uid, [('fiscalyear_id', '=', data['form']['fyear'])]) period = "("+','.join(map(lambda x: str(x), period_ids)) +")" @@ -193,3 +194,4 @@ class wizard_vat(wizard.interface): } wizard_vat('list.vat.detail') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/__init__.py b/addons/l10n_ch/__init__.py index e37210f2e84..7da724eaaff 100755 --- a/addons/l10n_ch/__init__.py +++ b/addons/l10n_ch/__init__.py @@ -41,3 +41,4 @@ import payment import report import bank import account_move_line +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/__terp__.py b/addons/l10n_ch/__terp__.py index a61b19c9308..a7fdbb86511 100755 --- a/addons/l10n_ch/__terp__.py +++ b/addons/l10n_ch/__terp__.py @@ -107,3 +107,4 @@ TODO : "active": False, "installable": True, } +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/account_move_line.py b/addons/l10n_ch/account_move_line.py index 60cc77ccd1e..e602d6bbdb8 100755 --- a/addons/l10n_ch/account_move_line.py +++ b/addons/l10n_ch/account_move_line.py @@ -68,3 +68,4 @@ class AccountMoveLine(osv.osv): return line2bank AccountMoveLine() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/bank.py b/addons/l10n_ch/bank.py index 9d3a715eb15..32310eb00ee 100755 --- a/addons/l10n_ch/bank.py +++ b/addons/l10n_ch/bank.py @@ -43,3 +43,4 @@ class Bank(osv.osv): } Bank() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/company.py b/addons/l10n_ch/company.py index f31ac43cc69..924278cd1a5 100755 --- a/addons/l10n_ch/company.py +++ b/addons/l10n_ch/company.py @@ -47,3 +47,4 @@ class res_company(osv.osv): } res_company() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/dta.py b/addons/l10n_ch/dta.py index af29941b6e7..435a0b2b18b 100755 --- a/addons/l10n_ch/dta.py +++ b/addons/l10n_ch/dta.py @@ -93,3 +93,4 @@ class account_dta_line(osv.osv): account_dta_line() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/invoice.py b/addons/l10n_ch/invoice.py index 3d3202255b3..9d5780f003a 100755 --- a/addons/l10n_ch/invoice.py +++ b/addons/l10n_ch/invoice.py @@ -207,4 +207,6 @@ class account_tax_code(osv.osv): ### The case code of the taxt code 'code': fields.char('Case Code', size=512), } -account_tax_code() \ No newline at end of file +account_tax_code() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/partner.py b/addons/l10n_ch/partner.py index 01af492a287..ce7408921af 100755 --- a/addons/l10n_ch/partner.py +++ b/addons/l10n_ch/partner.py @@ -96,3 +96,4 @@ class res_partner_bank(osv.osv): res_partner_bank() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/payment.py b/addons/l10n_ch/payment.py index c60b5678741..56420e85046 100755 --- a/addons/l10n_ch/payment.py +++ b/addons/l10n_ch/payment.py @@ -41,3 +41,4 @@ class payment_order(osv.osv): return 'l10n_ch','wizard_account_dta_create' return super(payment_order,self).get_wizard(mode) payment_order() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/report/__init__.py b/addons/l10n_ch/report/__init__.py index b8b01fc9b2c..9c21083c668 100755 --- a/addons/l10n_ch/report/__init__.py +++ b/addons/l10n_ch/report/__init__.py @@ -31,3 +31,4 @@ ############################################################################## import bvr +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/report/bvr.py b/addons/l10n_ch/report/bvr.py index f636f1be6e4..c71c62a0da2 100755 --- a/addons/l10n_ch/report/bvr.py +++ b/addons/l10n_ch/report/bvr.py @@ -100,3 +100,4 @@ report_sxw.report_sxw( parser=account_invoice_bvr, header=False) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/report/tiny_sxw2rml.py b/addons/l10n_ch/report/tiny_sxw2rml.py index 1035fa7aa79..e7a5422b6ec 100755 --- a/addons/l10n_ch/report/tiny_sxw2rml.py +++ b/addons/l10n_ch/report/tiny_sxw2rml.py @@ -339,3 +339,4 @@ if __name__ == "__main__": result = style.applyStylesheet(doc, None) xml = style.saveResultToString(result) print xml +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/wizard/__init__.py b/addons/l10n_ch/wizard/__init__.py index 4edc2a644bd..eaeaaf905f8 100755 --- a/addons/l10n_ch/wizard/__init__.py +++ b/addons/l10n_ch/wizard/__init__.py @@ -34,3 +34,4 @@ import dta_wizard import wizard_bvr import bvr_import import journal_config +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/wizard/bvr_import.py b/addons/l10n_ch/wizard/bvr_import.py index d6878040f43..585e996bbed 100755 --- a/addons/l10n_ch/wizard/bvr_import.py +++ b/addons/l10n_ch/wizard/bvr_import.py @@ -35,6 +35,8 @@ import base64 import time from tools import mod10r import re +from tools.translate import _ + ASK_FORM = """ @@ -103,12 +105,12 @@ def _import(obj, cursor, user, data, context): if line[0:3] in ('999', '995'): if find_total: - raise wizard.except_wizard('Error', - 'Too much total record found!') + raise wizard.except_wizard(_('Error'), + _('Too much total record found!')) find_total = True if lines: - raise wizard.except_wizard('Error', - 'Record found after total record!') + raise wizard.except_wizard(_('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': @@ -117,11 +119,11 @@ def _import(obj, cursor, user, data, context): if round(amount - total_amount, 2) >= 0.01 \ or round(cost - total_cost, 2) >= 0.01: - raise wizard.except_wizard('Error', - 'Total record different from the computed!') + raise wizard.except_wizard(_('Error'), + _('Total record different from the computed!')) if int(line[51:63]) != len(records): - raise wizard.except_wizard('Error', - 'Number record different from the computed!') + raise wizard.except_wizard(_('Error'), + _('Number record different from the computed!')) else: record = { 'reference': line[12:39], @@ -132,8 +134,8 @@ def _import(obj, cursor, user, data, context): } if record['reference'] != mod10r(record['reference'][:-1]): - raise wizard.except_wizard('Error', - 'Recursive mod10 is invalid for reference: %s' % \ + raise wizard.except_wizard(_('Error'), + _('Recursive mod10 is invalid for reference: %s') % \ record['reference']) if line[2] == '5': @@ -202,8 +204,8 @@ def _import(obj, cursor, user, data, context): else: account_id = account_payable if not account_id : - raise wizard.except_wizard('Error', - 'The properties account payable account receivable') + raise wizard.except_wizard(_('Error'), + _('The properties account payable account receivable')) values['account_id'] = account_id values['partner_id'] = partner_id @@ -248,3 +250,4 @@ class BVRImport(wizard.interface): } BVRImport('l10n_ch.bvr_import') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/wizard/dta_wizard.py b/addons/l10n_ch/wizard/dta_wizard.py index 76f30d10256..0f1b9d003e3 100755 --- a/addons/l10n_ch/wizard/dta_wizard.py +++ b/addons/l10n_ch/wizard/dta_wizard.py @@ -35,6 +35,7 @@ import base64 import time import pooler import mx.DateTime +from tools.translate import _ FORM = """ @@ -99,7 +100,7 @@ class record: Must instanciate a fields list, field = (name,size) and update a local_values dict. """ - raise "not implemented" + raise _('not implemented') def generate(self): res='' @@ -362,18 +363,18 @@ def _create_dta(obj, cr, uid, data, context): payment = payment_obj.browse(cr, uid, data['id'], context=context) if not payment.mode or payment.mode.type.code != 'dta': - raise wizard.except_wizard('Error', - 'No payment mode or payment type code invalid.') + raise wizard.except_wizard(_('Error'), + _('No payment mode or payment type code invalid.')) bank = payment.mode.bank_id if not bank: - raise wizard.except_wizard('Error', 'No bank account for the company.') + raise wizard.except_wizard(_('Error'), _('No bank account for the company.')) v['comp_bank_name']= bank.bank and bank.bank.name or False v['comp_bank_clearing'] = bank.bank.clearing if not v['comp_bank_clearing']: - raise wizard.except_wizard('Error', - 'You must provide a Clearing Number for your bank account.') + raise wizard.except_wizard(_('Error'), + _('You must provide a Clearing Number for your bank account.')) user = pool.get('res.users').browse(cr,uid,[uid])[0] company= user.company_id @@ -393,8 +394,8 @@ def _create_dta(obj, cr, uid, data, context): else: v['comp_bank_iban'] = '' if not v['comp_bank_iban']: - raise wizard.except_wizard('Error', - 'No IBAN for the company bank account.') + raise wizard.except_wizard(_('Error'), + _('No IBAN for the company bank account.')) dta_line_obj = pool.get('account.dta.line') res_partner_bank_obj = pool.get('res.partner.bank') @@ -405,13 +406,13 @@ def _create_dta(obj, cr, uid, data, context): for pline in payment.line_ids: if not pline.bank_id: - raise wizard.except_wizard('Error', 'No bank account defined\n' \ - 'on line: ' + pline.name) + raise wizard.except_wizard(_('Error'), _('No bank account defined\n' \ + 'on line: %s') % pline.name) if not pline.bank_id.bank: - raise wizard.except_wizard('Error', 'No bank defined\n' \ - 'for the bank account: ' + pline.bank_id.state + '\n' \ - 'on the partner: ' + pline.partner_id.name + '\n' \ - 'on line: ' + pline.name) + raise wizard.except_wizard(_('Error'), _('No bank defined\n' \ + 'for the bank account: %s\n' \ + 'on the partner: %s\n' \ + 'on line: %s') + (pline.bank_id.state, pline.partner_id.name, pline.name)) v['sequence'] = str(seq).rjust(5).replace(' ', '0') v['amount_to_pay']= str(pline.amount_currency).replace('.', ',') @@ -421,10 +422,10 @@ def _create_dta(obj, cr, uid, data, context): v['partner_bank_name'] = pline.bank_id.bank.name or False v['partner_bank_clearing'] = pline.bank_id.bank.clearing or False if not v['partner_bank_name'] : - raise wizard.except_wizard('Error', 'No bank name defined\n' \ - 'for the bank account: ' + pline.bank_id.state + '\n' \ - 'on the partner: ' + pline.partner_id.name + '\n' \ - 'on line: ' + pline.name) + raise wizard.except_wizard(_('Error'), _('No bank name defined\n' \ + 'for the bank account: %s\n' \ + 'on the partner: %s\n' \ + 'on line: %s') % (pline.bank_id.state, pline.partner_id.name, pline.name)) v['partner_bank_iban']= pline.bank_id.iban or False v['partner_bank_number']= pline.bank_id.acc_number \ @@ -470,9 +471,9 @@ def _create_dta(obj, cr, uid, data, context): v['partner_city']= '' v['partner_zip']= '' v['partner_country']= '' - raise wizard.except_wizard('Error', 'No address defined \n' \ - 'for the partner: ' + pline.partner_id.name + '\n' \ - 'on line: ' + pline.name) + raise wizard.except_wizard(_('Error'), _('No address defined \n' \ + 'for the partner: %s\n' \ + 'on line: %s') % (pline.partner_id.name, pline.name)) if pline.order_id.date_planned : date_value = mx.DateTime.strptime(pline.order_id.date_planned, '%Y-%m-%d') @@ -491,11 +492,9 @@ def _create_dta(obj, cr, uid, data, context): v['comp_country'] = co_addr.country_id and co_addr.country_id.code+'-' or '' record_type = record_gt836 if not v['partner_bank_iban']: - raise wizard.except_wizard('Error', 'No IBAN defined \n' \ - 'for the bank account: ' + \ - res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], - context)[0][1] + '\n' \ - 'on line: ' + pline.name) + raise wizard.except_wizard(_('Error'), _('No IBAN defined \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)) if v['partner_bank_code'] : # bank code is swift (BIC address) v['option_id_bank']= 'A' @@ -509,11 +508,9 @@ def _create_dta(obj, cr, uid, data, context): + ' ' + v['partner_bank_city'] \ + ' ' + v['partner_bank_country'] else: - raise wizard.except_wizard('Error', 'You must provide the bank city ' - 'or the bic code for the partner bank: \n' + \ - res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], - context)[0][1] + '\n' \ - 'on line: ' + pline.name) + raise wizard.except_wizard(_('Error'), _('You must provide the bank city ' + '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)) elif elec_pay == 'bvrbank' or elec_pay == 'bvrpost': from tools import mod10r @@ -522,15 +519,13 @@ def _create_dta(obj, cr, uid, data, context): '').rjust(27).replace(' ', '0') if not v['reference'] \ or mod10r(v['reference'][:-1]) != v['reference']: - raise wizard.except_wizard('Error', 'You must provide ' \ - 'a valid BVR reference number \n' + - 'for the line: ' + pline.name) + raise wizard.except_wizard(_('Error'), _('You must provide ' \ + 'a valid BVR reference number \n' \ + 'for the line: %s') % pline.name) if not v['partner_bvr']: - raise wizard.except_wizard('Error', 'You must provide a BVR number\n' - 'for the bank account: ' + \ - res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], - context)[0][1] + '\n' \ - 'on line: ' + pline.name) + raise wizard.except_wizard(_('Error'), _('You must provide a BVR number\n' + '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)) record_type = record_gt826 elif elec_pay == 'bvbank': @@ -538,38 +533,30 @@ def _create_dta(obj, cr, uid, data, context): if v['partner_bank_iban'] : v['partner_bank_number']= v['partner_bank_iban'] else: - raise wizard.except_wizard('Error', 'You must provide ' \ + raise wizard.except_wizard(_('Error'), _('You must provide ' \ 'a bank number \n' \ - 'for the partner bank: ' + \ - res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], - context)[0][1] + '\n' \ - 'on line: ' + pline.name) + '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)) if not v['partner_bank_clearing']: - raise wizard.except_wizard('Error', 'You must provide ' \ + raise wizard.except_wizard(_('Error'), _('You must provide ' \ 'a Clearing Number\n' \ - 'for the partner bank: ' + \ - res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], - context)[0][1] + '\n' \ - 'on line '+ pline.name) + '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)) v['partner_bank_number'] = '/C/'+v['partner_bank_number'] record_type = record_gt827 elif elec_pay == 'bvpost': if not v['partner_post_number']: - raise wizard.except_wizard('Error', 'You must provide ' \ + raise wizard.except_wizard(_('Error'), _('You must provide ' \ 'a post number \n' \ - 'for the partner bank: ' + \ - res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], - context)[0][1] + '\n' \ - 'on line: ' + pline.name) + '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)) v['partner_bank_clearing']= '' v['partner_bank_number'] = '/C/'+v['partner_post_number'] record_type = record_gt827 else: - raise wizard.except_wizard('Error', 'The Bank type ' + elec_pay + \ - 'of the bank account: ' + \ - res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], - context)[0][1] + ' '\ - 'is not supported') + raise wizard.except_wizard(_('Error'), _('The Bank type ' + elec_pay + \ + 'of the bank account: %s ' \ + 'is not supported') % res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] dta_line = record_type(v).generate() @@ -609,3 +596,4 @@ class wizard_dta_create(wizard.interface): } wizard_dta_create('account.dta_create') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/wizard/journal_config.py b/addons/l10n_ch/wizard/journal_config.py index bd130164e00..905cb6e0a4a 100755 --- a/addons/l10n_ch/wizard/journal_config.py +++ b/addons/l10n_ch/wizard/journal_config.py @@ -162,4 +162,6 @@ class Journal(osv.osv): } -Journal() \ No newline at end of file +Journal() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/wizard/wizard_bvr.py b/addons/l10n_ch/wizard/wizard_bvr.py index 6ef2fc38ab7..8c1221d1303 100755 --- a/addons/l10n_ch/wizard/wizard_bvr.py +++ b/addons/l10n_ch/wizard/wizard_bvr.py @@ -33,33 +33,33 @@ import wizard import pooler import re +from tools.translate import _ def _check(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) invoice_obj = pool.get('account.invoice') for invoice in invoice_obj.browse(cr, uid, data['ids'], context): if not invoice.partner_bank: - raise wizard.except_wizard('UserError', - 'No bank specified on invoice:\n' + \ - invoice_obj.name_get(cr, uid, [invoice.id], - context=context)[0][1]) + raise wizard.except_wizard(_('UserError'), + _('No bank specified on invoice:\n%s') % \ + invoice_obj.name_get(cr, uid, [invoice.id], context=context)[0][1]) + if not re.compile('[0-9][0-9]-[0-9]{3,6}-[0-9]').match( invoice.partner_bank.bvr_number or ''): - raise wizard.except_wizard('UserError', - 'Your bank BVR number should be of the form 0X-XXX-X!\n' \ + raise wizard.except_wizard(_('UserError'), + _('Your bank BVR number should be of the form 0X-XXX-X!\n' \ 'Please check your company ' \ - 'information for the invoice:\n' + \ - invoice_obj.name_get(cr, uid, [invoice.id], - context=context)[0][1]) + 'information for the invoice:\n%s') % \ + invoice_obj.name_get(cr, uid, [invoice.id], context=context)[0][1]) + if invoice.partner_bank.bvr_adherent_num \ and not re.compile('[0-9]*$').match( invoice.partner_bank.bvr_adherent_num): - raise wizard.except_wizard('UserError', - 'Your bank BVR adherent number must contain exactly seven' \ + raise wizard.except_wizard(_('UserError'), + _('Your bank BVR adherent number must contain exactly seven' \ 'digits!\nPlease check your company ' \ - 'information for the invoice:\n' + \ - invoice_obj.name_get(cr, uid, [invoice.id], - context=context)[0][1]) + 'information for the invoice:\n%s') % \ + invoice_obj.name_get(cr, uid, [invoice.id], context=context)[0][1]) return {} class wizard_report(wizard.interface): @@ -80,3 +80,4 @@ class ReportInvoiceBVRCheck(wizard.interface): } ReportInvoiceBVRCheck('l10n_ch.invoice.bvr.check') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch_chart_c2c_pcg/__init__.py b/addons/l10n_ch_chart_c2c_pcg/__init__.py index c6caad289e1..6c39925500a 100644 --- a/addons/l10n_ch_chart_c2c_pcg/__init__.py +++ b/addons/l10n_ch_chart_c2c_pcg/__init__.py @@ -23,3 +23,4 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import wizard +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch_chart_c2c_pcg/__terp__.py b/addons/l10n_ch_chart_c2c_pcg/__terp__.py index a96c0f0fbd7..34ddd400b52 100644 --- a/addons/l10n_ch_chart_c2c_pcg/__terp__.py +++ b/addons/l10n_ch_chart_c2c_pcg/__terp__.py @@ -50,3 +50,4 @@ "active": False, "installable": True } +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch_chart_c2c_pcg/wizard/__init__.py b/addons/l10n_ch_chart_c2c_pcg/wizard/__init__.py index db4f7b6a5bd..9110a52dd0c 100755 --- a/addons/l10n_ch_chart_c2c_pcg/wizard/__init__.py +++ b/addons/l10n_ch_chart_c2c_pcg/wizard/__init__.py @@ -4,4 +4,6 @@ # Created by Nicolas Bessi on 12.02.09. # Copyright (c) 2009 CamptoCamp. All rights reserved. # -import config \ No newline at end of file +import config + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch_chart_c2c_pcg/wizard/config.py b/addons/l10n_ch_chart_c2c_pcg/wizard/config.py index 033f2842e11..9503bb03ecd 100755 --- a/addons/l10n_ch_chart_c2c_pcg/wizard/config.py +++ b/addons/l10n_ch_chart_c2c_pcg/wizard/config.py @@ -140,4 +140,6 @@ class Tax_template(osv.osv): } -Tax_template() \ No newline at end of file +Tax_template() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_lu/__init__.py b/addons/l10n_lu/__init__.py index 2962f456334..cb7027eb605 100644 --- a/addons/l10n_lu/__init__.py +++ b/addons/l10n_lu/__init__.py @@ -20,3 +20,4 @@ # ############################################################################## import wizard +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_lu/wizard/__init__.py b/addons/l10n_lu/wizard/__init__.py index da95b8f4763..2d818b6f2fa 100644 --- a/addons/l10n_lu/wizard/__init__.py +++ b/addons/l10n_lu/wizard/__init__.py @@ -20,3 +20,4 @@ # ############################################################################## import print_vat +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_lu/wizard/print_vat.py b/addons/l10n_lu/wizard/print_vat.py index 1e3ad7a5523..69c93f956c7 100644 --- a/addons/l10n_lu/wizard/print_vat.py +++ b/addons/l10n_lu/wizard/print_vat.py @@ -90,3 +90,4 @@ class wizard_report(wizard.interface): } wizard_report('l10n_lu.tax.report.wizard') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/membership/wizard/invoice_membership.py b/addons/membership/wizard/invoice_membership.py index 9767c27f9f4..ddeeb5b84c9 100644 --- a/addons/membership/wizard/invoice_membership.py +++ b/addons/membership/wizard/invoice_membership.py @@ -23,6 +23,7 @@ from osv import fields import wizard import pooler import time +from tools.translate import _ def _invoice_membership(self, cr, uid, data, context): partner_ids = data['ids'] @@ -37,7 +38,7 @@ def _invoice_membership(self, cr, uid, data, context): ) fetchal = cr.fetchall() if not fetchal: - raise wizard.except_wizard('Error !', 'No Address defined for this partner') + raise wizard.except_wizard(_('Error !'), _('No Address defined for this partner')) partner_address_ids = {} for x in range(len(fetchal)): pid = fetchal[x][0] @@ -138,4 +139,4 @@ class wizard_invoice_membership(wizard.interface): wizard_invoice_membership("wizard_invoice_membership") -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/__init__.py b/addons/mrp/__init__.py index 5e33bc5b9b6..75001ba0ceb 100644 --- a/addons/mrp/__init__.py +++ b/addons/mrp/__init__.py @@ -25,3 +25,4 @@ import wizard import report import company import schedulers +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/company.py b/addons/mrp/company.py index ddce1517417..1d3c7cf02ea 100644 --- a/addons/mrp/company.py +++ b/addons/mrp/company.py @@ -46,3 +46,4 @@ class company(osv.osv): company() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index f6d4a685387..216776db173 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -27,6 +27,7 @@ import ir import netsvc import time from mx import DateTime +from tools.translate import _ #---------------------------------------------------------- # Workcenters @@ -492,7 +493,7 @@ class mrp_production(osv.osv): self.write(cr, uid, [production.id], {'bom_id': bom_id, 'routing_id': routing_id}) if not bom_id: - raise osv.except_osv('Error', "Couldn't find bill of material for product") + raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product")) #if bom_point.routing_id and bom_point.routing_id.location_id: # self.write(cr, uid, [production.id], {'location_src_id': bom_point.routing_id.location_id.id}) diff --git a/addons/mrp/report/order.py b/addons/mrp/report/order.py index 3cce8c98fae..5fc82b9f7f0 100644 --- a/addons/mrp/report/order.py +++ b/addons/mrp/report/order.py @@ -37,3 +37,4 @@ class order(report_sxw.rml_parse): report_sxw.report_sxw('report.mrp.production.order','mrp.production','addons/mrp/report/order.rml',parser=order,header=1) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/schedulers.py b/addons/mrp/schedulers.py index d856984f76b..510f9ecc386 100644 --- a/addons/mrp/schedulers.py +++ b/addons/mrp/schedulers.py @@ -237,3 +237,4 @@ class mrp_procurement(osv.osv): cr.close() return {} mrp_procurement() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/wizard/wizard_change_production_qty.py b/addons/mrp/wizard/wizard_change_production_qty.py index 905978cd4de..22fe912e4cf 100644 --- a/addons/mrp/wizard/wizard_change_production_qty.py +++ b/addons/mrp/wizard/wizard_change_production_qty.py @@ -27,6 +27,7 @@ import pooler from osv.osv import except_osv from osv import fields,osv import netsvc +from tools.translate import _ form1 = ''' @@ -47,7 +48,7 @@ def _get_states(self, cr, uid, data, context): prod_obj = pooler.get_pool(cr.dbname).get('mrp.production') prod = prod_obj.browse(cr, uid,data['ids'])[0] if prod.state in ('cancel', 'done'): - raise wizard.except_wizard('Warning !', 'The production is in "%s" state. You can not change the production quantity anymore' % (prod.state).upper() ) + raise wizard.except_wizard(_('Warning !'), _('The production is in "%s" state. You can not change the production quantity anymore') % (prod.state).upper() ) return 'end' if prod.state in ('draft'): #raise wizard.except_wizard('Warning !', 'The production is in "%s" state. You can change the production quantity directly...!!!' % (prod.state).upper() ) @@ -69,12 +70,12 @@ def _change_prod_qty(self, cr, uid, data, context): if not bom_point: bom_id = pool.get('mrp.bom')._bom_find(cr, uid, prod.product_id.id, prod.product_uom.id) if not bom_id: - raise osv.except_osv('Error', "Couldn't find bill of material for product") + raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product")) self.write(cr, uid, [prod.id], {'bom_id': bom_id}) bom_point = pool.get('mrp.bom').browse(cr, uid, [bom_id])[0] if not bom_id: - raise osv.except_osv('Error', "Couldn't find bill of material for product") + raise osv.except_osv(_('Error'), _("Couldn't find bill of material for product")) factor = prod.product_qty * prod.product_uom.factor / bom_point.product_uom.factor res = pool.get('mrp.bom')._bom_explode(cr, uid, bom_point, factor / bom_point.product_qty, []) @@ -114,3 +115,4 @@ class change_production_qty(wizard.interface): change_production_qty('change_production_qty') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 93ce9ec56fe..94a265c6bfb 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -27,6 +27,7 @@ import datetime import netsvc import time from mx import DateTime +from tools.translate import _ #---------------------------------------------------------- # Workcenters @@ -69,7 +70,7 @@ class mrp_production_workcenter_line(osv.osv): elif prod_obj.state =='in_production': return else: - raise osv.except_osv(_('Error!'),_('Production Order Cannot start in [%s] state')%(prod_obj.state,)) + raise osv.except_osv(_('Error!'),_('Production Order Cannot start in [%s] state') % (prod_obj.state,)) else: oper_ids=self.search(cr,uid,[('production_id','=',prod_obj.id)]) obj=self.browse(cr,uid,oper_ids) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 985af84118f..c5cefd61267 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -26,6 +26,8 @@ import netsvc import mx.DateTime from mx.DateTime import RelativeDateTime, today, DateTime, localtime from tools import config +from tools.translate import _ + class mrp_repair(osv.osv): _name = 'mrp.repair' _description = 'Repairs Order' @@ -258,7 +260,7 @@ class mrp_repair(osv.osv): if repair.state in ('draft','cancel') or repair.invoice_id: continue if not (repair.partner_id.id and repair.partner_invoice_id.id): - raise osv.except_osv('No partner !','You have to select a partner in the repair form ! ') + raise osv.except_osv(_('No partner !'),_('You have to select a partner in the repair form !')) comment=repair.quotation_notes if (repair.invoice_method != 'none'): if group and repair.partner_invoice_id.id in invoices_group: diff --git a/addons/mrp_subproduct/__init__.py b/addons/mrp_subproduct/__init__.py index 72406a6df5b..89155c540e0 100644 --- a/addons/mrp_subproduct/__init__.py +++ b/addons/mrp_subproduct/__init__.py @@ -20,3 +20,4 @@ # ############################################################################## import mrp_subproduct +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_subproduct/mrp_subproduct.py index 6c834fa6691..16c9f6b3ac5 100644 --- a/addons/mrp_subproduct/mrp_subproduct.py +++ b/addons/mrp_subproduct/mrp_subproduct.py @@ -81,3 +81,4 @@ class mrp_production(osv.osv): return picking_id mrp_production() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index a3331935463..db2ced31c97 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -219,7 +219,7 @@ class pos_order(osv.osv): def test_order_lines(self, cr, uid, order, context={}): if not order.lines: - raise osv.except_osv("Error", "No order lines defined for this sale.") + raise osv.except_osv(_('Error'), _('No order lines defined for this sale.')) wf_service = netsvc.LocalService("workflow") wf_service.trg_validate(uid, 'pos.order', order.id, 'paid', cr) @@ -415,7 +415,7 @@ class pos_order(osv.osv): order = self.browse(cr, uid, order_id, context) if order.invoice_wanted and not order.partner_id: - raise osv.except_osv("Error", "Cannot create invoice without a partner.") + raise osv.except_osv(_('Error'), _('Cannot create invoice without a partner.')) args = { 'order_id': order_id, @@ -495,7 +495,7 @@ class pos_order(osv.osv): continue if not order.partner_id: - raise osv.except_osv('Error', 'Please provide a partner for the sale.') + raise osv.except_osv(_('Error'), _('Please provide a partner for the sale.')) inv = { 'name': 'Invoice from POS: '+order.name, @@ -587,8 +587,8 @@ class pos_order(osv.osv): income_account = line.product_id.categ_id.\ property_account_income_categ.id else: - raise osv.except_osv('Error !', 'There is no income '\ - 'account defined for this product: "%s" (id:%d)'\ + raise osv.except_osv(_('Error !'), _('There is no income '\ + 'account defined for this product: "%s" (id:%d)') \ % (line.product_id.name, line.product_id.id, )) @@ -684,9 +684,9 @@ class pos_order(osv.osv): # search the account receivable for the payments: account_receivable = order.sale_journal.default_credit_account_id.id if not account_receivable: - raise osv.except_osv('Error !', - 'There is no receivable account defined for this journal:'\ - ' "%s" (id:%d)' % (order.sale_journal.name, order.sale_journal.id, )) + raise osv.except_osv(_('Error !'), + _('There is no receivable account defined for this journal:'\ + ' "%s" (id:%d)') % (order.sale_journal.name, order.sale_journal.id, )) for payment in order.payments: @@ -768,17 +768,17 @@ class pos_order_line(osv.osv): if not product_id: return 0.0 if not pricelist: - raise osv.except_osv('No Pricelist !', - 'You have to select a pricelist in the sale form !\n' - 'Please set one before choosing a product.') + raise osv.except_osv(_('No Pricelist !'), + _('You have to select a pricelist in the sale form !\n' \ + 'Please set one before choosing a product.')) price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product_id, qty or 1.0, partner_id)[pricelist] if price is False: - raise osv.except_osv('No valid pricelist line found !', - "Couldn't find a pricelist line matching this product" - " and quantity.\nYou have to change either the product," - " the quantity or the pricelist.") + raise osv.except_osv(_('No valid pricelist line found !'), + _("Couldn't find a pricelist line matching this product" \ + " and quantity.\nYou have to change either the product," \ + " the quantity or the pricelist.")) return price def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False): diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py index 6f13747327c..314e627ab6f 100644 --- a/addons/point_of_sale/report/pos_invoice.py +++ b/addons/point_of_sale/report/pos_invoice.py @@ -23,6 +23,7 @@ import time from report import report_sxw from osv import osv +from tools.translate import _ class pos_invoice(report_sxw.rml_parse): @@ -43,7 +44,7 @@ class pos_invoice(report_sxw.rml_parse): if order.invoice_id and order.invoice_id not in iids: 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) nids.append(order.invoice_id.id) self.cr.commit() diff --git a/addons/point_of_sale/wizard/wizard_default_journal.py b/addons/point_of_sale/wizard/wizard_default_journal.py index e1c9bcd891c..bfe59251f45 100644 --- a/addons/point_of_sale/wizard/wizard_default_journal.py +++ b/addons/point_of_sale/wizard/wizard_default_journal.py @@ -125,3 +125,4 @@ class wizard_default_journal(wizard.interface): wizard_default_journal('pos.config.journal') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/wizard/wizard_get_sale.py b/addons/point_of_sale/wizard/wizard_get_sale.py index 10aea187b8f..de686c11d49 100644 --- a/addons/point_of_sale/wizard/wizard_get_sale.py +++ b/addons/point_of_sale/wizard/wizard_get_sale.py @@ -22,6 +22,7 @@ import pooler import wizard +from tools.translate import _ picking_form = """ @@ -39,7 +40,7 @@ def _sale_complete(self, cr, uid, data, context): order = pool.get('pos.order').browse(cr, uid, data['id'], context) if order.state in ('paid', 'invoiced'): - raise wizard.except_wizard('UserError', "You can't modify this order. It has already been paid") + raise wizard.except_wizard(_('UserError'), _("You can't modify this order. It has already been paid")) pick = pool.get('stock.picking').browse(cr, uid, data['form']['picking_id'], context) diff --git a/addons/point_of_sale/wizard/wizard_scan_product.py b/addons/point_of_sale/wizard/wizard_scan_product.py index 93955d13f2b..40a8a5b1246 100644 --- a/addons/point_of_sale/wizard/wizard_scan_product.py +++ b/addons/point_of_sale/wizard/wizard_scan_product.py @@ -68,3 +68,4 @@ class pos_scan_product(wizard.interface): pos_scan_product('pos.scan_product') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/process/process.py b/addons/process/process.py index ea350b0bf7e..be53e0a4dc3 100644 --- a/addons/process/process.py +++ b/addons/process/process.py @@ -387,3 +387,4 @@ class process_transition_action(osv.osv): process_transition_action() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product/product.py b/addons/product/product.py index ca23d86b0f1..0eb7d836225 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -27,6 +27,7 @@ import math from _common import rounding from tools import config +from tools.translate import _ def is_pair(x): return not x%2 diff --git a/addons/product_margin/wizard/wizard_product_margin.py b/addons/product_margin/wizard/wizard_product_margin.py index 359c8b4aa49..969066465f9 100644 --- a/addons/product_margin/wizard/wizard_product_margin.py +++ b/addons/product_margin/wizard/wizard_product_margin.py @@ -86,3 +86,4 @@ class product_margins(wizard.interface): } } product_margins('product.margins') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_association/profile_association.py b/addons/profile_association/profile_association.py index 90e2ff374a8..4dbdebd50e1 100644 --- a/addons/profile_association/profile_association.py +++ b/addons/profile_association/profile_association.py @@ -63,3 +63,4 @@ class profile_association_config_install_modules_wizard(osv.osv_memory): 'target':'new', } profile_association_config_install_modules_wizard() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project/company.py b/addons/project/company.py index ceafa04b954..a99981c9e97 100644 --- a/addons/project/company.py +++ b/addons/project/company.py @@ -40,3 +40,4 @@ class res_company(osv.osv): } res_company() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project/project.py b/addons/project/project.py index 3dc09a50c5c..83d61732b2c 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -26,6 +26,7 @@ from mx.DateTime import now import time from osv import fields, osv +from tools.translate import _ class project(osv.osv): _name = "project.project" diff --git a/addons/project/wizard/close_task.py b/addons/project/wizard/close_task.py index c0fcf56084c..589f26d1c44 100644 --- a/addons/project/wizard/close_task.py +++ b/addons/project/wizard/close_task.py @@ -24,6 +24,7 @@ import wizard from tools import email_send as email import pooler from osv import osv +from tools.translate import _ mail_form = """ diff --git a/addons/project_gtd/wizard/project_gtd_daily.py b/addons/project_gtd/wizard/project_gtd_daily.py index 7f27d8865c9..81f6731262a 100644 --- a/addons/project_gtd/wizard/project_gtd_daily.py +++ b/addons/project_gtd/wizard/project_gtd_daily.py @@ -26,6 +26,7 @@ import netsvc import time import pooler from osv import osv +from tools.translate import _ class wiz_timebox_open(wizard.interface): def _open_timebox(self, cr, uid, data, context): @@ -33,7 +34,7 @@ class wiz_timebox_open(wizard.interface): pool = pooler.get_pool(cr.dbname) ids = pool.get('project.gtd.timebox').search(cr, uid, [('user_id','=',uid),('type','=',tbtype)]) if not len(ids): - raise wizard.except_wizard('Error !', 'No timebox of the type "%s" defined !' % (tbtype,)) + raise wizard.except_wizard(_('Error !'), _('No timebox of the type "%s" defined !') % (tbtype,)) view_type = 'form,tree' if len(ids) >= 1: domain = "[('id','in',["+','.join(map(str,ids))+"])]" diff --git a/addons/project_gtd/wizard/project_gtd_empty.py b/addons/project_gtd/wizard/project_gtd_empty.py index e4f3ad4fcf2..cd203240de3 100644 --- a/addons/project_gtd/wizard/project_gtd_empty.py +++ b/addons/project_gtd/wizard/project_gtd_empty.py @@ -26,13 +26,14 @@ import netsvc import time import pooler from osv import osv +from tools.translate import _ class wiz_timebox_empty(wizard.interface): def _empty(self, cr, uid, data, context): pool = pooler.get_pool(cr.dbname) ids = pool.get('project.gtd.timebox').search(cr, uid, [('parent_id','=',data['id'])]) if not len(ids): - raise wizard.except_wizard('Error !', 'No timebox child of this one !') + raise wizard.except_wizard(_('Error !'), _('No timebox child of this one !')) tids = pool.get('project.task').search(cr, uid, [('timebox_id','=',data['id'])]) close = [] up = [] diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index aad2a4d6dca..8b41c6d87d5 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -24,6 +24,7 @@ import time import datetime import pooler import tools +from tools.translate import _ class project_work(osv.osv): @@ -93,7 +94,7 @@ class project_work(osv.osv): def unlink(self, cr, uid, ids, *args, **kwargs): timesheet_id = self.pool.get('project.task.work').browse(cr, uid, ids)[0].hr_analytic_timesheet_id - # delete entry from timesheet too while deleting entry to task. + delete entry from timesheet too while deleting entry to task. list_avail_ids = self.pool.get('hr.analytic.timesheet').search(cr, uid, []) if timesheet_id in list_avail_ids: obj = self.pool.get('hr.analytic.timesheet').unlink(cr, uid, [timesheet_id], *args, **kwargs) diff --git a/addons/report_intrastat/report/__init__.py b/addons/report_intrastat/report/__init__.py index 96309d4d5f7..e0965056b93 100644 --- a/addons/report_intrastat/report/__init__.py +++ b/addons/report_intrastat/report/__init__.py @@ -20,3 +20,4 @@ # ############################################################################## import invoice +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_intrastat/report/invoice.py b/addons/report_intrastat/report/invoice.py index ae742a98aad..692b33d0095 100644 --- a/addons/report_intrastat/report/invoice.py +++ b/addons/report_intrastat/report/invoice.py @@ -34,3 +34,4 @@ class account_invoice_intrastat(report_sxw.rml_parse): report_sxw.report_sxw('report.account.invoice.intrastat', 'account.invoice', 'addons/report_intrastat/report/invoice.rml', parser=account_invoice_intrastat) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/product.py b/addons/sale/product.py index 2f35b598718..438173306b4 100644 --- a/addons/sale/product.py +++ b/addons/sale/product.py @@ -68,3 +68,4 @@ class product_product(osv.osv): } product_product() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/report/__init__.py b/addons/sale/report/__init__.py index 1ec8fde6538..f12997224c5 100644 --- a/addons/sale/report/__init__.py +++ b/addons/sale/report/__init__.py @@ -22,3 +22,4 @@ import sale_prepare_allot import order +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 6e635b96be2..6c845fedbde 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1057,3 +1057,4 @@ class sale_config_picking_policy(osv.osv_memory): sale_config_picking_policy() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/wizard/make_invoice_advance.py b/addons/sale/wizard/make_invoice_advance.py index 95b4fde05f3..33fca23bc47 100644 --- a/addons/sale/wizard/make_invoice_advance.py +++ b/addons/sale/wizard/make_invoice_advance.py @@ -23,6 +23,7 @@ import wizard import pooler from osv import fields, osv +from tools.translate import _ form = """ diff --git a/addons/sale_crm/wizard/makesale.py b/addons/sale_crm/wizard/makesale.py index d2ba03becf9..ef4b80796de 100644 --- a/addons/sale_crm/wizard/makesale.py +++ b/addons/sale_crm/wizard/makesale.py @@ -141,3 +141,4 @@ class make_sale(wizard.interface): make_sale('crm.case.make_order') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale_delivery_report/__init__.py b/addons/sale_delivery_report/__init__.py index bef9ff4838e..d7e6ee5977b 100644 --- a/addons/sale_delivery_report/__init__.py +++ b/addons/sale_delivery_report/__init__.py @@ -22,3 +22,4 @@ import report +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale_delivery_report/report/__init__.py b/addons/sale_delivery_report/report/__init__.py index e3a97d242c9..458426b866d 100644 --- a/addons/sale_delivery_report/report/__init__.py +++ b/addons/sale_delivery_report/report/__init__.py @@ -22,3 +22,4 @@ import shipping +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale_delivery_report/report/shipping.py b/addons/sale_delivery_report/report/shipping.py index 6496d847340..9c7cc3a26f0 100644 --- a/addons/sale_delivery_report/report/shipping.py +++ b/addons/sale_delivery_report/report/shipping.py @@ -72,3 +72,4 @@ class shipping(report_sxw.rml_parse): # return True report_sxw.report_sxw('report.sale.shipping','stock.picking','addons/sale_delivery_report/report/shipping.rml',parser=shipping) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report/picking.py b/addons/stock/report/picking.py index dd2b37cca55..5a0746b80e8 100644 --- a/addons/stock/report/picking.py +++ b/addons/stock/report/picking.py @@ -33,3 +33,4 @@ class picking(report_sxw.rml_parse): }) report_sxw.report_sxw('report.stock.picking.list','stock.picking','addons/stock/report/picking.rml',parser=picking) +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report_stock.py b/addons/stock/report_stock.py index b8ee64a2307..5e5e517121d 100644 --- a/addons/stock/report_stock.py +++ b/addons/stock/report_stock.py @@ -21,6 +21,7 @@ ############################################################################## from osv import osv, fields +from tools.translate import _ # # Check if it works with UoM ??? @@ -80,3 +81,4 @@ class stock_report_prodlots(osv.osv): stock_report_prodlots() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/wizard/inventory_merge.py b/addons/stock/wizard/inventory_merge.py index 80c6f3aca73..5bc5587a8b0 100644 --- a/addons/stock/wizard/inventory_merge.py +++ b/addons/stock/wizard/inventory_merge.py @@ -23,6 +23,7 @@ import wizard import pooler +from tools.translate import _ _form = """ @@ -41,15 +42,15 @@ def do_merge(self, cr, uid, data, context): invent_lines = {} if len(data['ids']) < 2: - raise wizard.except_wizard("Warning", - _("Please select at least two inventories.")) + raise wizard.except_wizard(_('Warning'), + _('Please select at least two inventories.')) for inventory in invent_obj.browse(cr, uid, data['ids'], context=context): if inventory.state == "done": - raise wizard.except_wizard("Warning", - _("Merging is only allowed on draft inventories.")) + raise wizard.except_wizard(_('Warning'), + _('Merging is only allowed on draft inventories.')) for line in inventory.inventory_line_id: key = (line.location_id.id, line.product_id.id, line.product_uom.id) diff --git a/addons/stock/wizard/inventory_merge_zero.py b/addons/stock/wizard/inventory_merge_zero.py index 1b0527ad142..e5b5bed0112 100644 --- a/addons/stock/wizard/inventory_merge_zero.py +++ b/addons/stock/wizard/inventory_merge_zero.py @@ -23,6 +23,7 @@ import wizard import pooler +from tools.translate import _ _form = """ @@ -49,8 +50,8 @@ def do_merge(self, cr, uid, data, context): prod_obj = pooler.get_pool(cr.dbname).get('product.product') if len(data['ids']) <> 1: - raise wizard.except_wizard("Warning", - "Please select one and only one inventory !") + raise wizard.except_wizard(_('Warning'), + _('Please select one and only one inventory !')) loc = str(data['form']['location_id']) diff --git a/addons/stock/wizard/wizard_inventory.py b/addons/stock/wizard/wizard_inventory.py index aebeb216243..e38dcaade52 100644 --- a/addons/stock/wizard/wizard_inventory.py +++ b/addons/stock/wizard/wizard_inventory.py @@ -27,6 +27,7 @@ import pooler from osv.osv import except_osv from osv import fields,osv import netsvc +from tools.translate import _ inventory_form = """ @@ -79,13 +80,13 @@ def _fill_inventory(self, cr, uid, data, context): if(amount): line_ids=inventory_line_obj.search(cr,uid,[('inventory_id','=',data['id']),('location_id','=',location),('product_id','=',product_id),('product_uom','=',uom),('product_qty','=',amount)]) - if not len(line_ids): - inventory_line={'inventory_id':data['id'],'location_id':location,'product_id':product_id,'product_uom':uom,'product_qty':amount} + if not len(line_ids): + inventory_line={'inventory_id':data['id'],'location_id':location,'product_id':product_id,'product_uom':uom,'product_qty':amount} inventory_line_obj.create(cr, uid, inventory_line) product_ids.append(product_id) if(len(product_ids)==0): - raise wizard.except_wizard('Message ! ','No product in this location.') + raise wizard.except_wizard(_('Message !'), _('No product in this location.')) return {} @@ -108,3 +109,4 @@ fill_inventory("stock.fill_inventory") +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/wizard/wizard_invoice_onshipping.py b/addons/stock/wizard/wizard_invoice_onshipping.py index f2775c1be5c..d307a9da07b 100644 --- a/addons/stock/wizard/wizard_invoice_onshipping.py +++ b/addons/stock/wizard/wizard_invoice_onshipping.py @@ -26,6 +26,7 @@ import ir import pooler from osv.osv import except_osv import netsvc +from tools.translate import _ invoice_form = """ @@ -67,9 +68,9 @@ def _get_type(obj, cr, uid, data, context): usage = 'customer' pick = picking_obj.browse(cr, uid, data['id'], context) if pick.invoice_state=='invoiced': - raise wizard.except_wizard('UserError','Invoice is already created.') + raise wizard.except_wizard(_('UserError'),_('Invoice is already created.')) if pick.invoice_state=='none': - raise wizard.except_wizard('UserError','Invoice cannot be created from Packing.') + raise wizard.except_wizard(_('UserError'),_('Invoice cannot be created from Packing.')) if pick.move_lines: usage=pick.move_lines[0].location_id.usage @@ -103,7 +104,7 @@ def _create_invoice(obj, cr, uid, data, context): invoice_ids = res.values() if not invoice_ids: - raise wizard.except_wizard('Error','Invoice is not created') + raise wizard.except_wizard(_('Error'),_('Invoice is not created')) if type == 'out_invoice': xml_id = 'action_invoice_tree5' diff --git a/addons/stock/wizard/wizard_location_product.py b/addons/stock/wizard/wizard_location_product.py index 3982d766c86..b250fa22ea0 100755 --- a/addons/stock/wizard/wizard_location_product.py +++ b/addons/stock/wizard/wizard_location_product.py @@ -69,3 +69,4 @@ class product_by_location(wizard.interface): } } product_by_location('stock.location.products') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_location/__init__.py b/addons/stock_location/__init__.py index 1df18818534..bbb46d38ccf 100644 --- a/addons/stock_location/__init__.py +++ b/addons/stock_location/__init__.py @@ -22,3 +22,4 @@ import stock +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_location/__terp__.py b/addons/stock_location/__terp__.py index f6a7803ea71..2d7fbba4e55 100644 --- a/addons/stock_location/__terp__.py +++ b/addons/stock_location/__terp__.py @@ -47,3 +47,4 @@ This module may be useful for different purposes: 'certificate': '0046505115101', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_location/stock.py b/addons/stock_location/stock.py index d47ebcc92a6..40ff92f321c 100644 --- a/addons/stock_location/stock.py +++ b/addons/stock_location/stock.py @@ -68,3 +68,4 @@ class stock_location(osv.osv): return path.location_dest_id, path.auto, path.delay return super(stock_location, self).chained_location_get(cr, uid, location, partner, product, context) stock_location() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki/__init__.py b/addons/wiki/__init__.py index 608266dc774..afe66302b95 100644 --- a/addons/wiki/__init__.py +++ b/addons/wiki/__init__.py @@ -1,3 +1,5 @@ import wiki -import wizard \ No newline at end of file +import wizard + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index 8bcf87aa63a..61b62327d6e 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -148,3 +148,4 @@ class History(osv.osv): diff = difflib.HtmlDiff() return diff.make_file(line1, line2, "Revision-%s" % (v1), "Revision-%s" % (v2), context=False) History() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki/wizard/__init__.py b/addons/wiki/wizard/__init__.py index 9e1135a08be..69ae1a9e60f 100644 --- a/addons/wiki/wizard/__init__.py +++ b/addons/wiki/wizard/__init__.py @@ -2,3 +2,4 @@ import open_page import create_menu import show_diff import make_index +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki/wizard/create_menu.py b/addons/wiki/wizard/create_menu.py index 87db868eb2c..faae94eb926 100644 --- a/addons/wiki/wizard/create_menu.py +++ b/addons/wiki/wizard/create_menu.py @@ -77,3 +77,4 @@ class wizard_create_menu(wizard.interface): } wizard_create_menu('wiki.create.menu') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki/wizard/make_index.py b/addons/wiki/wizard/make_index.py index 72f39f3f374..da91b7f7ca7 100644 --- a/addons/wiki/wizard/make_index.py +++ b/addons/wiki/wizard/make_index.py @@ -100,3 +100,4 @@ class make_index(wizard.interface): } make_index('wiki.make.index') +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki/wizard/show_diff.py b/addons/wiki/wizard/show_diff.py index d893604a972..c5653b8541a 100644 --- a/addons/wiki/wizard/show_diff.py +++ b/addons/wiki/wizard/show_diff.py @@ -21,6 +21,7 @@ ############################################################################## from osv import fields,osv +from tools.translate import _ class showdiff(osv.osv_memory): _name = 'wizard.wiki.history.show_diff' @@ -41,7 +42,7 @@ class showdiff(osv.osv_memory): nids.sort() diff = history.getDiff(cr, uid, ids[0], nids[-1]) else: - raise osv.except_osv('Warning', "You need to select minimum 1 or maximum 2 history revision!") + raise osv.except_osv(_('Warning'), _('You need to select minimum 1 or maximum 2 history revision!')) return diff _columns = { @@ -50,4 +51,5 @@ class showdiff(osv.osv_memory): _defaults = { 'diff': _get_diff } -showdiff() \ No newline at end of file +showdiff() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: