Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Language Code Error In odoo19 , when Migrate a module from version 18 to Version 19

Subscribe

Get notified when there's activity on this post

This question has been flagged
mailerrortemplatesodoo18odoo19
4 Replies
697 Views
Avatar
Kalana Piyumantha

Invalid language code: ${object.employee_id.partner_id.lang}, 

 How Can i Solve this I tried this way also, 

<field name="lang">{{object.employee_id.partner_id.lang}}</field>
odoo.tools.convert.ParseError: while parsing file:/e:/odoo19e/custom/payroll-custom/vkd_employee_resignation/data/mail_templates.xml:3

Oops! We couldn't save your template due to an issue with this value: {{object.employee_id.partner_id.lang}}. Correct it and try again.

But there is a error too, Can Someone Help me to solve this??

0
Avatar
Discard
Codesphere Tech

Hello,
Is the partner_id is custom field in Employee model?

Kalana Piyumantha
Author

Any other Solution? I think this is not a Practical one, Because as a good practice we cannot change the core modules, only our custom modules, 

Are there any simply Soltions to this??

<field name="lang">{{object.employee_id.partner_id.lang}}</field>
Kunjan Patel

Hello,
I have edited the answer.
I hope this helps.

Codesphere Tech

Is this custom field "partner_id"? Please reply this

Avatar
Ramiz Belim
Best Answer

Hello,
The error occurs because partner_id.lang is not always considered a valid language code at the mail template rendering stage, and sometimes Odoo validation fails when accessing nested fields this way inside <field name="lang">.

Instead, you should directly use the employee language field, which is already validated by Odoo. This approach is also used in Odoo Enterprise:

<field name="lang">{{ object.employee_id.lang }}</field>


0
Avatar
Discard
Avatar
Redian Software Pvt Ltd
Best Answer

In Odoo 19, language codes must follow the strict ISO format ll_CC.

If your module from Odoo 18 includes old or custom codes like en_UK, en_in, fr_BE@euro, or any non-standard code, Odoo 19 will raise a Language Code Error.

Fix:

  • Update all language codes in XML, demo data, and PO files to valid formats (e.g., en_GB, en_US, sw_KE, hi_IN).

  • Rename PO translation files accordingly.

  • Remove or clean invalid res.lang entries.

Once all codes follow xx_YY format, the module will install correctly in Odoo 19.

0
Avatar
Discard
Avatar
Kunjan Patel
Best Answer
Hello Kalana Piyumantha,
I hope you are doing well

Simple Fix for Dynamic Lang in Odoo 19
1. Best Solution: Use partner_to field - Odoo auto-detects lang from partner
  <field name="partner_to">{{object.employee_id.partner_id.id}}</field>
2. Or: Remove/leave lang field empty in your custom module override
  <field name="lang"></field>

I hope this information helps you 

Thanks & Regards,
Kunjan Patel
0
Avatar
Discard
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer

Hi,

That error usually means that the language data for your database (in res.lang) doesn’t match what v19 expects — Odoo prohibits changing language codes on upgrade via res.lang.csv, so the import fails. 

To solve this:

  • Don’t attempt to modify existing language codes when migrating. Keep the original code values in res.lang.

  • If you need a new language, add it after the upgrade via Settings → Languages.

  • If the module provides custom translations, ensure their .po / .csv files use valid, consistent language codes recognized by Odoo.

Hope it helps.

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

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

Sign up
Related Posts Replies Views Activity
import error occurd when migrating from v18 to v19 .ImportError: cannot import name 'decimal_precision' from 'odoo.addons' (unknown location)
error import odoo18 odoo19
Avatar
Avatar
1
Dec 25
212
Error when sending email with template in Odoo 9
mail error templates template odoo9
Avatar
2
Oct 17
5222
Change User Mail Template
mail templates
Avatar
Avatar
2
May 24
3731
odoo server error
mail error
Avatar
0
Sep 23
2185
odoo 16 saas
odoo18 odoo19
Avatar
0
Jul 23
5
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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