Odoo Help

1

How to change language settings using XML?

By
Dariusz Kubiak
on 7/17/13, 7:39 AM 3,344 views

I want to change default settings for Polish (which is current user language) on my_module installation. XML below does not work.

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="0">
        <record model="res.lang" id="2">
            <field name="grouping">[3,0]</field>
            <field name="decimal_point">,</field>
            <field name="thousands_sep">.</field>
        </record>
    </data>
</openerp>

IntegrityError: null value in column "name" violates not-null constraint

3

Remya

--Remya--
5833
| 7 8 8
Thiruvananthapuram, India
--Remya--

Working as an Senior ODOO developer. http://in.linkedin.com/pub/remya-r/69/a23/298

Remya
On 7/17/13, 8:57 AM

If you want to select language through interface other xml. Below its screenshot.

image description

or

eg< xml:lang="en">The quick brown fox jumps over the lazy dog.

Tag is xml:lang="Code of the language"

2

Remya

--Remya--
5833
| 7 8 8
Thiruvananthapuram, India
--Remya--

Working as an Senior ODOO developer. http://in.linkedin.com/pub/remya-r/69/a23/298

Remya
On 7/17/13, 8:16 AM

You select language for each user. whether it is english or polish

1
Sandy Carter
On 12/17/13, 2:02 PM

You have to create a link to the polish language in ir.model.data before you can access it.

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="1">

       <!-- Create link to the language with name "lang_pl" in ir.model.data -->
       <record id="mymodule_lang_pl" model="ir.model.data">
            <field name="name">lang_pl</field>
            <field name="noupdate">TRUE</field>
            <field name="module">mymodule</field>
            <field name="model">res.lang</field>
            <field name="res_id" model="res.lang" search="[('code', '=', 'pl_PL')]"/>
       </record>

        <!-- Access link by name "lang_pl" -->
        <record id="lang_pl" model="res.lang">
            <field name="grouping">[3,0]</field>
            <field name="decimal_point">,</field>
            <field name="thousands_sep">.</field>
        </record>

    </data>
</openerp>

Make sure that at time of module install, the language exists in res.lang

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 7/17/13, 7:39 AM
Seen: 3344 times
Last updated: 3/16/15, 8:10 AM