[IMP]pms_api_rest: added user language to countries and segmentations

This commit is contained in:
braisab
2023-09-21 12:35:57 +02:00
committed by Darío Lodeiros
parent 5bae4cd590
commit 9bd4003177
2 changed files with 2 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ class ResCountryService(Component):
def get_countries(self):
result_countries = []
ResCountriesInfo = self.env.datamodels["res.country.info"]
for country in self.env["res.country"].search([]):
for country in self.env["res.country"].with_context(lang=self.env.user.lang).search([]):
result_countries.append(
ResCountriesInfo(
id=country.id,

View File

@@ -24,7 +24,7 @@ class PmsPartnerCategoriesService(Component):
def get_categories(self):
result_categories = []
ResPartnerCategoryInfo = self.env.datamodels["res.partner.category.info"]
for category in self.env["res.partner.category"].search([]):
for category in self.env["res.partner.category"].with_context(lang=self.env.user.lang).search([]):
result_categories.append(
ResPartnerCategoryInfo(
id=category.id,