mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms_api_rest: new field code in document types datamodel
This commit is contained in:
@@ -7,3 +7,4 @@ class PmsIdCategoryInfo(Datamodel):
|
|||||||
_name = "pms.id.category.info"
|
_name = "pms.id.category.info"
|
||||||
id = fields.Integer(required=False, allow_none=True)
|
id = fields.Integer(required=False, allow_none=True)
|
||||||
documentType = fields.String(required=False, allow_none=True)
|
documentType = fields.String(required=False, allow_none=True)
|
||||||
|
code = fields.String(required=False, allow_none=True)
|
||||||
|
|||||||
@@ -24,11 +24,12 @@ class PmsIdCategoryService(Component):
|
|||||||
def get_id_categories(self):
|
def get_id_categories(self):
|
||||||
result_id_categories = []
|
result_id_categories = []
|
||||||
PmsIdCategoryInfo = self.env.datamodels["pms.id.category.info"]
|
PmsIdCategoryInfo = self.env.datamodels["pms.id.category.info"]
|
||||||
for id_category in self.env["res.partner.id_category"].search([]):
|
for id_category in self.env["res.partner.id_category"].with_context(lang=self.env.user.lang).search([]):
|
||||||
result_id_categories.append(
|
result_id_categories.append(
|
||||||
PmsIdCategoryInfo(
|
PmsIdCategoryInfo(
|
||||||
id=id_category.id,
|
id=id_category.id,
|
||||||
documentType=id_category.name,
|
documentType=id_category.name,
|
||||||
|
code=id_category.code,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return result_id_categories
|
return result_id_categories
|
||||||
|
|||||||
Reference in New Issue
Block a user