odoocurrencyodoo-14

Odoo - Can't Change Default Currency Company


I want to change the company currency by opening Setting->Companies->Currency. But when I already change the currency and hit save button, I get this warning dialog

You cannot change the currency of the company since some journal items already exist

How to solve this problem?


Solution

  • You cannot change the currency of the company since some journal items already exist

    reference code - Source Code

    #forbid the change of currency_id if there are already some accounting entries existing
    if 'currency_id' in values and values['currency_id'] != company.currency_id.id:
        if self.env['account.move.line'].search([('company_id', '=', company.id)]):
            raise UserError(_('You cannot change the currency of the company since some journal items already exist'))