diff --git a/addons/account/account.py b/addons/account/account.py index b0271a4fee1..ac50c25cd6b 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -278,7 +278,7 @@ class account_account(osv.osv): # ON l.account_id = tmp.id # or make _get_children_and_consol return a query and join on that request = ("SELECT l.account_id as id, " +\ - ' , '.join(map(mapping.__getitem__, field_names)) + + ', '.join(map(mapping.__getitem__, field_names)) + " FROM account_move_line l" \ " WHERE l.account_id IN %s " \ + filters + @@ -1538,7 +1538,7 @@ class account_tax_code(osv.osv): if context is None: context = {} move_state = ('posted', ) - if context.get('state', False) == 'all': + if context.get('state', 'all') == 'all': move_state = ('draft', 'posted', ) if context.get('fiscalyear_id', False): fiscalyear_id = context['fiscalyear_id'] diff --git a/addons/account/invoice.py b/addons/account/invoice.py index b5b6fe5977e..4cdaeab9a49 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -1078,7 +1078,9 @@ class account_invoice(osv.osv): def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None): invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'address_invoice_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id']) - + obj_invoice_line = self.pool.get('account.invoice.line') + obj_invoice_tax = self.pool.get('account.invoice.tax') + obj_journal = self.pool.get('account.journal') new_ids = [] for invoice in invoices: del invoice['id'] @@ -1090,18 +1092,18 @@ class account_invoice(osv.osv): 'in_refund': 'in_invoice', # Supplier Refund } - invoice_lines = self.pool.get('account.invoice.line').read(cr, uid, invoice['invoice_line']) + invoice_lines = obj_invoice_line.read(cr, uid, invoice['invoice_line']) invoice_lines = self._refund_cleanup_lines(cr, uid, invoice_lines) - tax_lines = self.pool.get('account.invoice.tax').read(cr, uid, invoice['tax_line']) + tax_lines = obj_invoice_tax.read(cr, uid, invoice['tax_line']) tax_lines = filter(lambda l: l['manual'], tax_lines) tax_lines = self._refund_cleanup_lines(cr, uid, tax_lines) if journal_id: refund_journal_ids = [journal_id] elif invoice['type'] == 'in_invoice': - refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','purchase_refund')]) + refund_journal_ids = obj_journal.search(cr, uid, [('type','=','purchase_refund')]) else: - refund_journal_ids = self.pool.get('account.journal').search(cr, uid, [('type','=','sale_refund')]) + refund_journal_ids = obj_journal.search(cr, uid, [('type','=','sale_refund')]) if not date: date = time.strftime('%Y-%m-%d') diff --git a/addons/account/project/report/analytic_balance.py b/addons/account/project/report/analytic_balance.py index 01cefdd03c8..42e36744cb8 100644 --- a/addons/account/project/report/analytic_balance.py +++ b/addons/account/project/report/analytic_balance.py @@ -119,12 +119,12 @@ class account_analytic_balance(report_sxw.rml_parse): return (debit-credit) def _sum_all(self, accounts, date1, date2, option): + account_analytic_obj = self.pool.get('account.analytic.account') ids = map(lambda x: x['id'], accounts) if not ids: return 0.0 if not self.acc_sum_list: - account_analytic_obj = self.pool.get('account.analytic.account') ids2 = account_analytic_obj.search(self.cr, self.uid,[('parent_id', 'child_of', ids)]) self.acc_sum_list = ids2 else: diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py index fc0953b93fa..02cd614ee5d 100644 --- a/addons/account/wizard/account_move_journal.py +++ b/addons/account/wizard/account_move_journal.py @@ -91,9 +91,9 @@ class account_move_journal(osv.osv_memory):
-