hello Dear guys,
i have problem with the account_partner_ledger.py now calculated the amount_currency in total show on partner ledger but i have problem with currency Symbol wont show the currency symbol used shown company default currency in the codes any solutions ?
my code how can add the currency symbol for amount__currency ??
# Sum query
debit_field = 'debit_cash_basis' if options.get('cash_basis') else 'debit'
credit_field = 'credit_cash_basis' if options.get('cash_basis') else 'credit'
amount_currency = 'amount_currency_cash_basis' if options.get('cash_basis') else 'amount_currency'
balance_field = 'balance_cash_basis' if options.get('cash_basis') else 'balance'
tables, where_clause, params = self.env['account.move.line']._query_get(
[('account_id.internal_type', 'in', account_types)])
query = '''
SELECT
\"account_move_line\".partner_id,
SUM(ROUND(\"account_move_line\".''' + debit_field + ''' * currency_table.rate, currency_table.precision)) AS debit,
SUM(ROUND(\"account_move_line\".''' + credit_field + ''' * currency_table.rate, currency_table.precision)) AS credit,
SUM(ROUND(\"account_move_line\".''' + amount_currency + ''' * currency_table.rate, currency_table.precision)) AS amount_currency,
SUM(ROUND(\"account_move_line\".''' + balance_field + ''' * currency_table.rate, currency_table.precision)) AS balance
FROM %s
LEFT JOIN currency_table ON currency_table.company_id = \"account_move_line\".company_id
WHERE %s
AND \"account_move_line\".partner_id IS NOT NULL
GROUP BY \"account_move_line\".partner_id
''' % (tables, where_clause)
if line_id:
query = query.replace('WHERE', 'WHERE \"account_move_line\".partner_id = %s AND ')
params = [str(line_id)] + params
if options.get("unreconciled"):
query = query.replace("WHERE", 'WHERE \"account_move_line\".full_reconcile_id IS NULL AND ')
self._cr.execute(with_currency_table + query, params)
query_res = self._cr.dictfetchall()
return dict((res['partner_id'], res) for res in query_res)