Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
3 ตอบกลับ
7418 มุมมอง

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 ?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

This is what someone might be looking for:

from odoo.tools import get_lang

get_lang(self.env).code


อวตาร
ละทิ้ง