Skip to content

Commit

Permalink
[ADD]pms_api_rest: PMS API Client conexion data
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioLodeiros committed Feb 26, 2024
1 parent f6ab196 commit 7779f5f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pms_api_rest/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,26 @@ class ResUsers(models.Model):
store=True,
readonly=False,
)

pms_api_client = fields.Boolean(
string="PMS API Client",
help="PMS API Client",
)
url_endpoint_prices = fields.Char(
string="URL Endpoint Prices",
help="URL Endpoint Prices",
)
url_endpoint_availability = fields.Char(
string="URL Endpoint Availability",
help="URL Endpoint Availability",
)
url_endpoint_rules = fields.Char(
string="URL Endpoint Rules",
help="URL Endpoint Rules",
)
external_public_token = fields.Char(
string="External Public Token",
help="External Public Token",
)

def _get_default_avail_rule_fields(self):
default_avail_rule_fields = self.env["ir.model.fields"].search(
Expand Down
26 changes: 26 additions & 0 deletions pms_api_rest/views/res_users_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,37 @@
options="{'no_create': True}"
domain="['&',('model_id', '=', 'pms.availability.plan.rule'), ('name', 'in', ('min_stay', 'max_stay', 'quota', 'max_stay_arrival', 'closed_arrival', 'closed', 'closed_departure', 'min_stay_arrival', 'max_avail'))]"
/>
</group>
<group string="Clien API configuration">
<field
name="pms_api_client"
string="PMS API Client"
help="This user is used to PMS API's client (channel managers, precheckin apps, booking engines, etc.)"
/>
<field
name="url_endpoint_prices"
string="Prices Endpoint"
help="URL endpoint to get prices"
attrs="{'invisible': [('pms_api_client', '=', False)]}"
/>
<field
name="url_endpoint_availability"
string="Availability Endpoint"
help="URL endpoint to get availability"
attrs="{'invisible': [('pms_api_client', '=', False)]}"
/>
<field
name="url_endpoint_rules"
string="Reservations Endpoint"
help="URL endpoint to get reservations"
attrs="{'invisible': [('pms_api_client', '=', False)]}"
/>
<field
name="external_public_token"
string="Rules Endpoint"
help="URL endpoint to get rules"
attrs="{'invisible': [('pms_api_client', '=', False)]}"
/>
</group>
</group>
</xpath>
Expand Down

0 comments on commit 7779f5f

Please sign in to comment.