diff --git a/addons/account/report/general_ledger.py b/addons/account/report/general_ledger.py index 8ba9f25ea1a..3dfe8c5ea97 100755 --- a/addons/account/report/general_ledger.py +++ b/addons/account/report/general_ledger.py @@ -126,7 +126,7 @@ class general_ledger(rml_parse.rml_parse): # self.query = self.pool.get('account.move.line')._query_get(self.cr, self.uid, context=ctx) - for child_id in account.search(self.cr, self.uid, + for child_id in self.pool.get('account.account').search(self.cr, self.uid, [('parent_id', 'child_of', [account.id])]): child_account = self.pool.get('account.account').browse(self.cr, self.uid, child_id) sold_account = self._sum_solde_account(child_account,form) @@ -349,14 +349,19 @@ class general_ledger(rml_parse.rml_parse): def _sum_currency_amount_account(self, account, form): + self._set_get_account_currency_code(account.id) + self.cr.execute("select sum(aml.amount_currency) from account_move_line as aml "\ + "LEFT JOIN account_account aa on aml.account_id=%d "\ + "AND aml.currency_id = aa.currency_id"%account.id) + total = self.cr.fetchone() + if self.account_currency: - return_field = str(self.tot_currency) + self.account_currency - self.tot_currency = 0.0 + return_field = str(total[0]) + self.account_currency return return_field else: - self.tot_currency = 0.0 - return ' ' + currency_total = self.tot_currency = 0.0 + return currency_total report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/general_ledger.rml', parser=general_ledger, header=False) diff --git a/addons/account/report/general_ledger.rml b/addons/account/report/general_ledger.rml index 63ef37e3991..da82c739c0d 100755 --- a/addons/account/report/general_ledger.rml +++ b/addons/account/report/general_ledger.rml @@ -138,6 +138,7 @@ [[sum_solde_account(o, data['form']) or '0.0' ]] + @@ -242,7 +243,7 @@ - + [[ o.code ]] [[ o.name ]] @@ -250,10 +251,13 @@ [[ sum_debit_account(o, data['form']) or '0.0' ]] - [[sum_credit_account(o, data['form']) or '0.0' ]] + [[ sum_credit_account(o, data['form']) or '0.0' ]] - [[sum_solde_account(o, data['form']) or '0.0' ]] + [[ sum_solde_account(o, data['form']) or '0.0' ]] + + + [[ sum_currency_amount_account(o, data['form']) or '0.0' ]] diff --git a/addons/account/report/general_ledger_landscape.py b/addons/account/report/general_ledger_landscape.py index bdc75d0aaef..a36a1ea0d3b 100755 --- a/addons/account/report/general_ledger_landscape.py +++ b/addons/account/report/general_ledger_landscape.py @@ -261,7 +261,8 @@ class general_ledger_landscape(rml_parse.rml_parse): # if l['amount_currency'] != None: - self.tot_currency = self.tot_currency + l['amount_currency'] + self.tot_currency = self.tot_currency + l['amount_currency'] + return res def _sum_debit_account(self, account, form): @@ -336,10 +337,12 @@ class general_ledger_landscape(rml_parse.rml_parse): return sum_solde def _set_get_account_currency_code(self, account_id): + print"====account_id=====",account_id self.cr.execute("SELECT c.code as code "\ "FROM res_currency c,account_account as ac "\ "WHERE ac.id = %s AND ac.currency_id = c.id"%(account_id)) result = self.cr.fetchone() + print"====result====",result if result: self.account_currency = result[0] else: @@ -347,13 +350,18 @@ class general_ledger_landscape(rml_parse.rml_parse): def _sum_currency_amount_account(self, account, form): + self._set_get_account_currency_code(account.id) + self.cr.execute("select sum(aml.amount_currency) from account_move_line as aml "\ + "LEFT JOIN account_account aa on aml.account_id=%d "\ + "AND aml.currency_id = aa.currency_id"%account.id) + total = self.cr.fetchone() + if self.account_currency: - return_field = str(self.tot_currency) + self.account_currency - self.tot_currency = 0.0 + return_field = str(total[0]) + self.account_currency return return_field else: - self.tot_currency = 0.0 - return ' ' + currency_total = self.tot_currency = 0.0 + 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) diff --git a/addons/account/report/general_ledger_landscape.rml b/addons/account/report/general_ledger_landscape.rml index da5257370dd..439dff350bb 100755 --- a/addons/account/report/general_ledger_landscape.rml +++ b/addons/account/report/general_ledger_landscape.rml @@ -145,12 +145,13 @@ [[ repeatIn(objects, 'a') ]] [[ repeatIn(get_children_accounts(a,data['form']), 'o') ]] + - + [[ o.code ]] [[ o.name ]] @@ -163,6 +164,10 @@ [[ sum_solde_account(o, data['form']) or '0.0' ]] + + + [[ sum_currency_amount_account(o, data['form']) or '0.0' ]] + diff --git a/addons/account/report/overdue.py b/addons/account/report/overdue.py index c37e2c98363..bf456e8256f 100644 --- a/addons/account/report/overdue.py +++ b/addons/account/report/overdue.py @@ -42,6 +42,7 @@ class Overdue(report_sxw.rml_parse): 'time' : time, 'adr_get' : self._adr_get, 'getLines' : self._lines_get, + 'tel_get' : self._tel_get, }) def _adr_get(self, partner, type): @@ -51,6 +52,20 @@ class Overdue(report_sxw.rml_parse): adr_id = addresses and addresses[type] or False return adr_id and res_partner_address.read(self.cr, self.uid, [adr_id])[0] or False + def _tel_get(self,partner): + if not partner: + return False + res_partner_address = pooler.get_pool(self.cr.dbname).get('res.partner.address') + res_partner = pooler.get_pool(self.cr.dbname).get('res.partner') + addresses = res_partner.address_get(self.cr, self.uid, [partner.id], ['invoice']) + adr_id = addresses and addresses['invoice'] or False + if adr_id: + adr=res_partner_address.read(self.cr, self.uid, [adr_id])[0] + return adr['phone'] + else: + return partner.address and partner.address[0].phone or False + return False + def _lines_get(self, partner): moveline_obj = pooler.get_pool(self.cr.dbname).get('account.move.line') movelines = moveline_obj.search(self.cr, self.uid, diff --git a/addons/account/report/overdue.rml b/addons/account/report/overdue.rml index fc6dde92f50..f9f213f0d89 100644 --- a/addons/account/report/overdue.rml +++ b/addons/account/report/overdue.rml @@ -110,7 +110,7 @@ - Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at +32 81 81 37 00. + Would your payment have been carried out after this mail was sent, please consider the present one as void. Do not hesitate to contact our accounting departement at [[ tel_get(company.partner_id) ]]. diff --git a/addons/account_budget/__terp__.py b/addons/account_budget/__terp__.py index 9231b606400..b7957697226 100644 --- a/addons/account_budget/__terp__.py +++ b/addons/account_budget/__terp__.py @@ -1,13 +1,13 @@ # -*- encoding: utf-8 -*- { - "name" : "Crossovered Budget Management", + "name" : "Budget Management", "version" : "1.0", "author" : "Tiny", "website" : "http://tinyerp.com/module_crossovered_budget.html", "category" : "Generic Modules/Accounting", "description": """This module allow accountants to manage analytic and crossovered budgets. - Once the Master Budgets and the Budgets defined (in Financial Management/Configuration/Budgets/), the Project Managers can set the planned amount on each Analytic Account. + Once the Master Budgets and the Budgets defined (in Financial Management/Budgets/), the Project Managers can set the planned amount on each Analytic Account. The accountant has the possibility to see the total of amount planned for each Budget and Master Budget in order to ensure the total planned is not greater/lower than what he planned for this Budget/Master Budget. Each list of record can also be switched to a graphical view of it. diff --git a/addons/account_budget/crossovered_budget_view.xml b/addons/account_budget/crossovered_budget_view.xml index 178f8dd0696..ed7b1efb5bb 100644 --- a/addons/account_budget/crossovered_budget_view.xml +++ b/addons/account_budget/crossovered_budget_view.xml @@ -76,7 +76,7 @@ form - +