Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7398 Lượt xem

I need to get the current company language to be used in some official reports which can’t be based on the current user language, can anyone help me ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Technically you can access the current company language by using the script env.user.company_id.partner_id.lang

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

A company is related to a partner. You can retrieve the language from that partner.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

This is what someone might be looking for:

from odoo.tools import get_lang

get_lang(self.env).code


Ảnh đại diện
Huỷ bỏ