mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD]pms_api_rest: add otas parameter in get agency service
This commit is contained in:
@@ -6,6 +6,7 @@ from odoo.addons.datamodel.core import Datamodel
|
|||||||
class PmsAgencySearchParam(Datamodel):
|
class PmsAgencySearchParam(Datamodel):
|
||||||
_name = "pms.agency.search.param"
|
_name = "pms.agency.search.param"
|
||||||
name = fields.String(required=False, allow_none=True)
|
name = fields.String(required=False, allow_none=True)
|
||||||
|
otas = fields.Boolean(required=False, allow_none=True)
|
||||||
|
|
||||||
|
|
||||||
class PmsAgencyInfo(Datamodel):
|
class PmsAgencyInfo(Datamodel):
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ class PmsAgencyService(Component):
|
|||||||
)
|
)
|
||||||
def get_agencies(self, agencies_search_param):
|
def get_agencies(self, agencies_search_param):
|
||||||
domain = [("is_agency", "=", True)]
|
domain = [("is_agency", "=", True)]
|
||||||
|
if agencies_search_param.otas:
|
||||||
|
domain.append(("sale_channel_id.is_on_line", "=", True))
|
||||||
if agencies_search_param.name:
|
if agencies_search_param.name:
|
||||||
domain.append(("name", "like", agencies_search_param.name))
|
domain.append(("name", "like", agencies_search_param.name))
|
||||||
result_agencies = []
|
result_agencies = []
|
||||||
|
|||||||
Reference in New Issue
Block a user