diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index d9b78795998..db7f3e05065 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -26,6 +26,7 @@ from osv import fields, osv from tools.translate import _ import decimal_precision as dp import tools +from operator import itemgetter class account_move_line(osv.osv): _name = "account.move.line" @@ -901,7 +902,7 @@ class account_move_line(osv.osv): fields['period_id'] = all_journal fields['journal_id'] = all_journal - from operator import itemgetter + fld = sorted(fld, key=itemgetter(1)) widths = { diff --git a/addons/account/company.py b/addons/account/company.py index 8e14fe53c3a..0a3cc15663a 100644 --- a/addons/account/company.py +++ b/addons/account/company.py @@ -33,7 +33,7 @@ class res_company(osv.osv): method=True, view_load=True, domain="[('type', '=', 'payable')]", - help="This Account is used for transferring Profit/Loss(If It is Profit : Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profit & Loss Report"), + help="This Account is used for transferring Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be deducted.), Which is calculated from Profit & Loss Report"), } _defaults = { diff --git a/addons/account/project/project.py b/addons/account/project/project.py index f082672310e..5a58eca97a4 100644 --- a/addons/account/project/project.py +++ b/addons/account/project/project.py @@ -28,11 +28,11 @@ from osv import osv class account_analytic_journal(osv.osv): _name = 'account.analytic.journal' _columns = { - 'name' : fields.char('Journal Name', size=64, required=True), - 'code' : fields.char('Journal Code', size=8), - 'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."), + 'name': fields.char('Journal Name', size=64, required=True), + 'code': fields.char('Journal Code', size=8), + 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the analytic journal without removing it."), 'type': fields.selection([('sale','Sale'), ('purchase','Purchase'), ('cash','Cash'), ('general','General'), ('situation','Situation')], 'Type', size=32, required=True, help="Gives the type of the analytic journal. When it needs for a document (eg: an invoice) to create analytic entries, OpenERP will look for a matching journal of the same type."), - 'line_ids' : fields.one2many('account.analytic.line', 'journal_id', 'Lines'), + 'line_ids': fields.one2many('account.analytic.line', 'journal_id', 'Lines'), 'company_id': fields.many2one('res.company', 'Company', required=True), } _defaults = { diff --git a/addons/account/report/account_aged_partner_balance.py b/addons/account/report/account_aged_partner_balance.py index 457ce7bb27f..95842b92623 100644 --- a/addons/account/report/account_aged_partner_balance.py +++ b/addons/account/report/account_aged_partner_balance.py @@ -137,7 +137,7 @@ class aged_trial_report(rml_parse.rml_parse, common_report_header): future_past[i[0]] = i[1] # Use one query per period and store results in history (a list variable) - # Each history will contain : history[1] = {'': } + # Each history will contain: history[1] = {'': } history = [] for i in range(5): args_list = (tuple(move_state), tuple(self.ACCOUNT_TYPE), tuple(partner_ids),self.date_from,) diff --git a/addons/account/report/account_central_journal.py b/addons/account/report/account_central_journal.py index 35f1e666c6f..4e28e2d5140 100644 --- a/addons/account/report/account_central_journal.py +++ b/addons/account/report/account_central_journal.py @@ -72,7 +72,7 @@ class journal_print(report_sxw.rml_parse, common_report_header): if self.target_move == 'posted': move_state = ['posted'] - self.cr.execute('SELECT a.currency_id ,a.code, a.name, c.code AS currency_code, l.currency_id, l.amount_currency, SUM(debit) AS debit, SUM(credit) AS credit \ + self.cr.execute('SELECT a.currency_id, a.code, a.name, c.code AS currency_code, l.currency_id, l.amount_currency, SUM(debit) AS debit, SUM(credit) AS credit \ from account_move_line l \ LEFT JOIN account_move am ON (l.move_id=am.id) \ LEFT JOIN account_account a ON (l.account_id=a.id) \ diff --git a/addons/account/report/account_general_journal.py b/addons/account/report/account_general_journal.py index e81bd994c0a..843bedaaf63 100644 --- a/addons/account/report/account_general_journal.py +++ b/addons/account/report/account_general_journal.py @@ -87,7 +87,7 @@ class journal_print(report_sxw.rml_parse, common_report_header): move_state = ['draft','posted'] if self.target_move == 'posted': move_state = ['posted'] - self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.code AS currency_code,l.currency_id , ' + self.cr.execute('SELECT j.code, j.name, l.amount_currency,c.code AS currency_code,l.currency_id, ' 'SUM(l.debit) AS debit, SUM(l.credit) AS credit ' 'FROM account_move_line l ' 'LEFT JOIN account_move am ON (l.move_id=am.id) ' @@ -111,7 +111,7 @@ class journal_print(report_sxw.rml_parse, common_report_header): def _get_account(self, data): if data['model'] == 'account.journal.period': return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).company_id.name - return super(journal_print ,self)._get_account(data) + return super(journal_print, self)._get_account(data) def _get_fiscalyear(self, data): if data['model'] == 'account.journal.period': diff --git a/addons/account/report/account_partner_ledger.py b/addons/account/report/account_partner_ledger.py index 0038eb1278f..72f38d46cf7 100644 --- a/addons/account/report/account_partner_ledger.py +++ b/addons/account/report/account_partner_ledger.py @@ -286,7 +286,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): # return 0.0 # result_tmp = 0.0 # result_init = 0.0 -# if self.reconcil : +# if self.reconcil: # RECONCILE_TAG = " " # else: # RECONCILE_TAG = "AND reconcile_id IS NULL" @@ -317,7 +317,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): # "AND m.state IN %s " # "AND account_id IN %s" \ # " " + RECONCILE_TAG + " " \ -# "AND " + self.query + " " , +# "AND " + self.query + " ", # (tuple(self.partner_ids), tuple(move_state) ,tuple(self.account_ids),)) # contemp = self.cr.fetchone() # if contemp != None: @@ -335,7 +335,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): # return 0.0 # result_tmp = 0.0 # result_init = 0.0 -# if self.reconcil : +# if self.reconcil: # RECONCILE_TAG = " " # else: # RECONCILE_TAG = "AND reconcile_id IS NULL" @@ -366,7 +366,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): # "AND m.state IN %s " # "AND account_id IN %s" \ # " " + RECONCILE_TAG + " " \ -# "AND " + self.query + " " , +# "AND " + self.query + " ", # (tuple(self.partner_ids), tuple(move_state), tuple(self.account_ids),)) # contemp = self.cr.fetchone() # if contemp != None: diff --git a/addons/account/report/account_report.py b/addons/account/report/account_report.py index dd8e0a2ce4e..dd0ec133598 100644 --- a/addons/account/report/account_report.py +++ b/addons/account/report/account_report.py @@ -74,7 +74,7 @@ class temp_range(osv.osv): _description = 'A Temporary table used for Dashboard view' _columns = { - 'name' : fields.char('Range',size=64) + 'name': fields.char('Range',size=64) } temp_range() @@ -177,7 +177,7 @@ class report_invoice_created(osv.osv): ('cancel','Cancelled') ],'State', readonly=True), 'origin': fields.char('Source Document', size=64, readonly=True, help="Reference of the document that generated this invoice report."), - 'create_date' : fields.datetime('Create Date', readonly=True) + 'create_date': fields.datetime('Create Date', readonly=True) } _order = 'create_date' diff --git a/addons/account/wizard/account_report_balance_sheet.py b/addons/account/wizard/account_report_balance_sheet.py index a4ad0c58524..9dc04bdad10 100644 --- a/addons/account/wizard/account_report_balance_sheet.py +++ b/addons/account/wizard/account_report_balance_sheet.py @@ -35,7 +35,7 @@ class account_bs_report(osv.osv_memory): _columns = { 'display_type': fields.boolean("Landscape Mode"), 'reserve_account_id': fields.many2one('account.account', 'Reserve & Profit/Loss Account',required = True, - help='This Account is used for trasfering Profit/Loss(If It is Profit : Amount will be added, Loss : Amount will be duducted.), Which is calculated from Profilt & Loss Report', domain = [('type','=','payable')]), + help='This Account is used for trasfering Profit/Loss(If It is Profit: Amount will be added, Loss : Amount will be duducted.), Which is calculated from Profilt & Loss Report', domain = [('type','=','payable')]), } _defaults={ diff --git a/addons/account/wizard/account_report_common.py b/addons/account/wizard/account_report_common.py index 038973c4ed8..517fbf248e5 100644 --- a/addons/account/wizard/account_report_common.py +++ b/addons/account/wizard/account_report_common.py @@ -100,7 +100,7 @@ class account_common_report(osv.osv_memory): return self.pool.get('account.journal').search(cr, uid ,[]) _defaults = { - 'fiscalyear_id' : _get_fiscalyear, + 'fiscalyear_id': _get_fiscalyear, 'journal_ids': _get_all_journal, 'filter': 'filter_no', 'chart_account_id': _get_account, diff --git a/addons/account/wizard/account_report_common_partner.py b/addons/account/wizard/account_report_common_partner.py index d9f3934d9a4..3fafb400bb1 100644 --- a/addons/account/wizard/account_report_common_partner.py +++ b/addons/account/wizard/account_report_common_partner.py @@ -28,7 +28,7 @@ class account_common_partner_report(osv.osv_memory): _columns = { 'result_selection': fields.selection([('customer','Receivable Accounts'), ('supplier','Payable Accounts'), - ('customer_supplier' ,'Receivable and Payable Accounts')], + ('customer_supplier','Receivable and Payable Accounts')], "Partner's", required=True), }