Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Multi currency

Odebírat

Get notified when there's activity on this post

This question has been flagged
accountingmulticurrencyodooV17
1652 Zobrazení
Avatar
Alain kazadi

Hi everyone, I'm new to odoo. For my accounting entries, I do a multiple conversion on the debit, credit and balance lines for an operation carried out in a currency other than the one selected. How can I solve this?


def _get_report_vals(self, dates, entry_type, journal_id, company_id, prev_period, last_period, currency_id, fold_account_ids):
move_lines = []
domain = []
compare_period = []
if not isinstance(fold_account_ids, list):
fold_account_ids = [int(x) for x in fold_account_ids.split(',')] if fold_account_ids else []
if journal_id and journal_id not in ['0', 'undefined']:
domain += [('move_id.journal_id', '=', int(journal_id))]
if company_id and company_id not in ['0', 'undefined']:
domain += [('move_id.company_id', '=', int(company_id))]
if entry_type == 'all':
domain += [('move_id.state', 'in', ['draft', 'posted'])]
elif entry_type == 'draft':
domain += [('move_id.state', '=', 'draft')]
elif entry_type == 'posted':
domain += [('move_id.state', '=', 'posted')]
date_from, date_to = date_utils.get_month(fields.Date.context_today(self))
string = format_date(self.env, fields.Date.to_string(date_to), date_format='MMM YYYY')
quarter_names = get_quarter_names('abbreviated', locale=get_lang(self.env).code)
if dates == 'this_month':
string = format_date(self.env, fields.Date.to_string(date_to), date_format='MMM YYYY')
domain += [('date', '>=', date_from), ('date', '<=', date_to)]
elif dates == 'this_quarter':
date_from, date_to = date_utils.get_quarter(fields.Date.context_today(self))
string = u'%s\N{NO-BREAK SPACE}%s' % (quarter_names[date_utils.get_quarter_number(date_to)], date_to.year)
domain += [('date', '>=', date_from), ('date', '<=', date_to)]
elif dates == 'this_fin_year':
company_fiscalyear_dates = self.env.company.compute_fiscalyear_dates(fields.Date.context_today(self))
date_from = company_fiscalyear_dates['date_from']
date_to = company_fiscalyear_dates['date_to']
string = date_to.strftime('%Y')
domain += [('date', '>=', date_from), ('date', '<=', date_to)]
elif dates == 'last_month':
date_from, date_to = date_utils.get_month(fields.Date.context_today(self))
date_from = date_from - relativedelta(months=1)
date_to = date_to - relativedelta(months=1)
string = format_date(self.env, fields.Date.to_string(date_to), date_format='MMM YYYY')
domain += [('date', '>=', date_from), ('date', '<=', date_to)]
elif dates == 'last_quarter':
date_from, date_to = date_utils.get_quarter(fields.Date.context_today(self))
date_from = date_from - relativedelta(months=1)
date_from, date_to = date_utils.get_quarter(date_from)
string = u'%s\N{NO-BREAK SPACE}%s' % (quarter_names[date_utils.get_quarter_number(date_to)], date_to.year)
domain += [('date', '>=', date_from), ('date', '<=', date_to)]
elif dates == 'last_fin_year':
company_fiscalyear_dates = self.env.company.compute_fiscalyear_dates(fields.Date.context_today(self))
date_from = company_fiscalyear_dates['date_from']
date_to = company_fiscalyear_dates['date_to']
date_from = date_from - relativedelta(years=1)
date_to = date_to - relativedelta(years=1)
string = date_to.strftime('%Y')
domain += [('date', '>=', date_from), ('date', '<=', date_to)]
line_data = {}
selected_currency = currency_id or self.env.company.currency_id
if selected_currency and selected_currency not in ['0', 'undefined']:
selected_currency = self.env['res.currency'].browse(int(selected_currency))
else:
selected_currency = self.env.company.currency_id
rates_conversion = self.env['ir.config_parameter'].sudo().get_param('account_report_with_multi_currency.rates_conversion_date_selection')
if rates_conversion == 'transaction_date':
for mo_line in self.env['account.move.line'].search(domain, order='account_code asc'):
if mo_line.account_id not in line_data:
line_data[mo_line.account_id] = {}
line_data[mo_line.account_id]['debit'] = mo_line.currency_id._convert(mo_line.debit, selected_currency, self.env.company, mo_line.date or fields.Date.context_today(self))
line_data[mo_line.account_id]['credit'] = mo_line.currency_id._convert(mo_line.credit, selected_currency, self.env.company, mo_line.date or fields.Date.context_today(self))
line_data[mo_line.account_id]['amount_currency'] = mo_line.currency_id._convert(mo_line.amount_currency, selected_currency, self.env.company, mo_line.date or fields.Date.context_today(self))
line_data[mo_line.account_id]['date'] = mo_line.date
line_data[mo_line.account_id]['partner'] = ''
line_data[mo_line.account_id]['name'] = ''
line_data[mo_line.account_id]['account_id'] = mo_line.account_id.id

else:
line_data[mo_line.account_id]['debit'] += mo_line.currency_id._convert(mo_line.debit, selected_currency, self.env.company, mo_line.date or fields.Date.context_today(self))
line_data[mo_line.account_id]['credit'] += mo_line.currency_id._convert(mo_line.credit, selected_currency, self.env.company, mo_line.date or fields.Date.context_today(self))
line_data[mo_line.account_id]['amount_currency'] += mo_line.currency_id._convert(mo_line.amount_currency, selected_currency, self.env.company, mo_line.date or fields.Date.context_today(self))
else:
for mo_line in self.env['account.move.line'].search(domain, order='account_code asc'):
if mo_line.account_id not in line_data:
line_data[mo_line.account_id] = {}
line_data[mo_line.account_id]['debit'] = mo_line.currency_id._convert(mo_line.debit, selected_currency, self.env.company, date_from or fields.Date.context_today(self))
line_data[mo_line.account_id]['credit'] = mo_line.currency_id._convert(mo_line.credit, selected_currency, self.env.company, date_from or fields.Date.context_today(self))
line_data[mo_line.account_id]['amount_currency'] = mo_line.currency_id._convert(mo_line.amount_currency, selected_currency, self.env.company, date_from or fields.Date.context_today(self))
line_data[mo_line.account_id]['date'] = mo_line.date
line_data[mo_line.account_id]['partner'] = ''
line_data[mo_line.account_id]['name'] = ''
line_data[mo_line.account_id]['account_id'] = mo_line.account_id.id
else:
line_data[mo_line.account_id]['debit'] += mo_line.currency_id._convert(mo_line.debit, selected_currency, self.env.company, date_from or fields.Date.context_today(self))
line_data[mo_line.account_id]['credit'] += mo_line.currency_id._convert(mo_line.credit, selected_currency, self.env.company, date_from or fields.Date.context_today(self))
line_data[mo_line.account_id]['amount_currency'] += mo_line.currency_id._convert(mo_line.amount_currency, selected_currency, self.env.company, date_from or fields.Date.context_today(self))
# line_data = self.env['account.move.line'].read_group(domain, ['account_id', 'debit', 'credit', 'date', 'partner_id', 'amount_currency', 'move_name'], ['account_id'])
for account in line_data:
lines = self.env['account.move.line'].search(domain + [('account_id', '=', account.id)])
move_line_list = []
for line in lines:
move_line_data = {}
move_line_data['id'] = line.id
move_line_data['move_name'] = line.move_id.name
move_line_data['move_id'] = line.move_id.id
move_line_data['model'] = line.move_id._name
move_line_data['date'] = line.date
move_line_data['name'] = line.name
move_line_data['partner_id'] = line.partner_id.name
# move_line_data['is_foldernle'] = True if line.account_id.id in fold_account_ids else False
if rates_conversion == 'transaction_date':
move_line_data['debit'] = line.currency_id._convert(line.debit, selected_currency, self.env.company, line.date or fields.Date.context_today(self))
move_line_data['credit'] = line.currency_id._convert(line.credit, selected_currency, self.env.company, line.date or fields.Date.context_today(self))
move_line_data['amount_currency'] = line.currency_id._convert(line.amount_currency, selected_currency, self.env.company, line.date or fields.Date.context_today(self))
move_line_data['total'] = line.currency_id._convert(line.debit - line.credit, selected_currency, self.env.company, line.date or fields.Date.context_today(self))
else:
move_line_data['debit'] = line.currency_id._convert(line.debit, selected_currency, self.env.company, date_from or fields.Date.context_today(self))
move_line_data['credit'] = line.currency_id._convert(line.credit, selected_currency, self.env.company, date_from or fields.Date.context_today(self))
move_line_data['amount_currency'] = line.currency_id._convert(line.amount_currency, selected_currency, self.env.company, date_from or fields.Date.context_today(self))
move_line_data['total'] = line.currency_id._convert(line.debit - line.credit, selected_currency, self.env.company, date_from or fields.Date.context_today(self))

move_line_list.append(move_line_data)

partner = self.env['res.partner']
if 'partner_id' in line_data[account]:
partner = self.env['res.partner'].browse(line_data[account]['partner_id'][0])
vals = {
'name': line_data[account]['name'],
'account': account.display_name,
'debit': line_data[account]['debit'],
'credit': line_data[account]['credit'],
'amount_currency': line_data[account]['amount_currency'],
'date': line_data[account]['date'],
'partner': partner.display_name,
'lines': move_line_list,
'account_id': account.id,
'model': "account.move.line"
}
move_lines.append(vals)
# currency_id = self.env.company.currency_id
return {
'move_lines': move_lines,
'string': string,
'report_currency_id': selected_currency,
'currency_id': selected_currency.id,
'compare_period': compare_period,
'fold_account_ids': fold_account_ids if fold_account_ids else []
}
0
Avatar
Zrušit
Lars Aam

I don't know why you struggle with this. Odoo manage foreign currency very efficient in accounting.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Odoo Multicurrency Conceptually
accounting multicurrency
Avatar
1
kvě 23
6659
Doing journal entry in difference currency not auto transferring to main currency
accounting multicurrency
Avatar
Avatar
2
led 23
4492
How to work with currency conversion (multi currency)? Vyřešeno
accounting multicurrency
Avatar
Avatar
1
srp 15
8253
"Accounting and Finance" multicurrency supports?
accounting multicurrency
Avatar
Avatar
Avatar
Avatar
3
bře 15
7373
Multi-Currency Partner Ledger Odoo 16
accounting multicurrency partnerledger
Avatar
Avatar
Avatar
Avatar
Avatar
4
kvě 24
4026
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now