mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms_api_rest: added user language to countries and segmentations
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user