diff --git a/.copier-answers.yml b/.copier-answers.yml
index 7671798888..2cd562b036 100644
--- a/.copier-answers.yml
+++ b/.copier-answers.yml
@@ -1,8 +1,9 @@
# Do NOT update manually; changes here will be overwritten by Copier
-_commit: v1.21.1
+_commit: v1.29
_src_path: gh:oca/oca-addons-repo-template
ci: GitHub
convert_readme_fragments_to_markdown: false
+enable_checklog_odoo: false
generate_requirements_txt: true
github_check_license: true
github_ci_extra_env: {}
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
index 6578458712..afd7524ef0 100644
--- a/.github/workflows/pre-commit.yml
+++ b/.github/workflows/pre-commit.yml
@@ -13,8 +13,8 @@ jobs:
pre-commit:
runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-python@v2
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Get python version
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 3bf18e843c..5d0f95283c 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
name: Detect unreleased dependencies
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
@@ -50,7 +50,7 @@ jobs:
ports:
- 5432:5432
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install addons and dependencies
diff --git a/.gitignore b/.gitignore
index 0090721f5d..6ec07a054b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -25,6 +25,19 @@ var/
*.egg
*.eggs
+# Windows installers
+*.msi
+
+# Debian packages
+*.deb
+
+# Redhat packages
+*.rpm
+
+# MacOS packages
+*.dmg
+*.pkg
+
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d3eef51355..d9739fad44 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -5,7 +5,7 @@ exclude: |
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
- .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
+ .svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|^eslint.config.cjs|^prettier.config.cjs|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
@@ -39,7 +39,7 @@ repos:
language: fail
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
- repo: https://github.com/oca/maintainer-tools
- rev: 9a170331575a265c092ee6b24b845ec508e8ef75
+ rev: d5fab7ee87fceee858a3d01048c78a548974d935
hooks:
# update the NOT INSTALLABLE ADDONS section above
- id: oca-update-pre-commit-excluded-addons
@@ -58,6 +58,8 @@ repos:
hooks:
- id: oca-checks-odoo-module
- id: oca-checks-po
+ args:
+ - --disable=po-pretty-format
- repo: https://github.com/myint/autoflake
rev: v1.6.1
hooks:
@@ -73,25 +75,35 @@ repos:
rev: 22.8.0
hooks:
- id: black
- - repo: https://github.com/pre-commit/mirrors-prettier
- rev: v2.7.1
+ - repo: local
hooks:
- id: prettier
name: prettier (with plugin-xml)
+ entry: prettier
+ args:
+ - --write
+ - --list-different
+ - --ignore-unknown
+ types: [text]
+ files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
+ language: node
additional_dependencies:
- "prettier@2.7.1"
- "@prettier/plugin-xml@2.2.0"
- args:
- - --plugin=@prettier/plugin-xml
- files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
- - repo: https://github.com/pre-commit/mirrors-eslint
- rev: v8.24.0
+ - repo: local
hooks:
- id: eslint
- verbose: true
+ name: eslint
+ entry: eslint
args:
- --color
- --fix
+ verbose: true
+ types: [javascript]
+ language: node
+ additional_dependencies:
+ - "eslint@8.24.0"
+ - "eslint-plugin-jsdoc@"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
diff --git a/multi_pms_properties/models.py b/multi_pms_properties/models.py
index 25a475e43d..2409834244 100644
--- a/multi_pms_properties/models.py
+++ b/multi_pms_properties/models.py
@@ -21,13 +21,13 @@ def _valid_field_parameter(self, field, name):
@api.model_create_multi
def create(self, vals_list):
- records = super(BaseModel, self).create(vals_list)
+ records = super().create(vals_list)
if self._check_pms_properties_auto:
records._check_pms_properties()
return records
def write(self, vals):
- res = super(BaseModel, self).write(vals)
+ res = super().write(vals)
check_pms_properties = False
for fname in vals:
field = self._fields.get(fname)
diff --git a/multi_pms_properties/tests/test_multi_pms_properties.py b/multi_pms_properties/tests/test_multi_pms_properties.py
index 10f81e0226..f19a3488ab 100644
--- a/multi_pms_properties/tests/test_multi_pms_properties.py
+++ b/multi_pms_properties/tests/test_multi_pms_properties.py
@@ -12,10 +12,10 @@
@common.tagged("-at_install", "post_install")
-class TestMultiPMSProperties(common.SavepointCase):
+class TestMultiPMSProperties(common.TransactionCase):
@classmethod
def setUpClass(cls):
- super(TestMultiPMSProperties, cls).setUpClass()
+ super().setUpClass()
model_classes = [ParentTester, ChildTester]
setup_test_model(cls.env, model_classes)
for mdl_cls in model_classes:
diff --git a/pms/__manifest__.py b/pms/__manifest__.py
index 58fcb9f632..8fdf66d512 100644
--- a/pms/__manifest__.py
+++ b/pms/__manifest__.py
@@ -92,7 +92,6 @@
"views/res_company_views.xml",
"views/traveller_report_template.xml",
"wizards/wizard_split_join_swap_reservation.xml",
- "views/precheckin_portal_templates.xml",
"wizards/wizard_massive_changes.xml",
"wizards/wizard_advanced_filters.xml",
"wizards/folio_payment_link_views.xml",
diff --git a/pms/init_hook.py b/pms/init_hook.py
index 5592fe58f7..ab344e799c 100644
--- a/pms/init_hook.py
+++ b/pms/init_hook.py
@@ -3,14 +3,13 @@
def pre_init_hook(cr):
- with Environment.manage():
- env = Environment(cr, SUPERUSER_ID, {})
- ResConfig = env["res.config.settings"]
- default_values = ResConfig.default_get(list(ResConfig.fields_get()))
- default_values.update(
- {"group_product_pricelist": True, "group_sale_pricelist": True}
- )
- ResConfig.sudo().create(default_values).execute()
- env["ir.config_parameter"].sudo().set_param(
- "product.product_pricelist_setting", "advanced"
- )
+ env = Environment(cr, SUPERUSER_ID, {})
+ ResConfig = env["res.config.settings"]
+ default_values = ResConfig.default_get(list(ResConfig.fields_get()))
+ default_values.update(
+ {"group_product_pricelist": True, "group_sale_pricelist": True}
+ )
+ ResConfig.sudo().create(default_values).execute()
+ env["ir.config_parameter"].sudo().set_param(
+ "product.product_pricelist_setting", "advanced"
+ )
diff --git a/pms/models/account_analytic_line.py b/pms/models/account_analytic_line.py
index cdaa2ad88f..6a18ca011d 100644
--- a/pms/models/account_analytic_line.py
+++ b/pms/models/account_analytic_line.py
@@ -1,4 +1,4 @@
-from odoo import fields, models, api
+from odoo import api, fields, models
class AccountAnalyticDistribution(models.Model):
@@ -14,15 +14,23 @@ class AccountAnalyticDistribution(models.Model):
@api.model
def default_get(self, fields):
res = super().default_get(fields)
- if "pms_property_id" in fields and self.env.context.get("default_analytic_distribution"):
+ if "pms_property_id" in fields and self.env.context.get(
+ "default_analytic_distribution"
+ ):
distribution = self.env.context["default_analytic_distribution"]
if distribution.keys():
property_ids = self.env["pms.property"].search(
- [("analytic_account_id", "in", [int(x) for x in distribution.keys()])]
+ [
+ (
+ "analytic_account_id",
+ "in",
+ [int(x) for x in distribution.keys()],
+ )
+ ]
)
if property_ids:
res["pms_property_id"] = property_ids[0].id
- res['company_id'] = property_ids[0].company_id.id
+ res["company_id"] = property_ids[0].company_id.id
return res
def _get_distribution(self, vals):
diff --git a/pms/models/account_bank_statement.py b/pms/models/account_bank_statement.py
index 2c2eecd5fd..c50f812e71 100644
--- a/pms/models/account_bank_statement.py
+++ b/pms/models/account_bank_statement.py
@@ -21,7 +21,6 @@ class AccountBankStatement(models.Model):
check_pms_properties=True,
)
- # pylint: disable=W8110
@api.depends("journal_id")
def _compute_pms_property_id(self):
for record in self:
@@ -29,22 +28,3 @@ def _compute_pms_property_id(self):
record.pms_property_id = record.journal_id.pms_property_ids[0]
elif not record.pms_property_id:
record.pms_property_id = False
-
- def button_post(self):
- """
- Override the default method to add autoreconcile payments and statement lines
- """
- lines_of_moves_to_post = self.line_ids.filtered(
- lambda line: line.move_id.state != "posted"
- )
- super(AccountBankStatement, self).button_post()
- for line in lines_of_moves_to_post:
- payment_move_line = line._get_payment_move_lines_to_reconcile()
- statement_move_line = line.move_id.line_ids.filtered(
- lambda line: line.account_id.reconcile
- or line.account_id == line.journal_id.suspense_account_id
- )
- if payment_move_line and statement_move_line:
- statement_move_line.account_id = payment_move_line.account_id
- lines_to_reconcile = payment_move_line + statement_move_line
- lines_to_reconcile.reconcile()
diff --git a/pms/models/account_bank_statement_line.py b/pms/models/account_bank_statement_line.py
index 576fe52d54..d44db048c0 100644
--- a/pms/models/account_bank_statement_line.py
+++ b/pms/models/account_bank_statement_line.py
@@ -37,9 +37,7 @@ class AccountBankStatementLine(models.Model):
@api.model
def _prepare_move_line_default_vals(self, counterpart_account_id=None):
- line_vals_list = super(
- AccountBankStatementLine, self
- )._prepare_move_line_default_vals(counterpart_account_id)
+ line_vals_list = super()._prepare_move_line_default_vals(counterpart_account_id)
if self.folio_ids:
for line in line_vals_list:
line.update(
@@ -49,36 +47,6 @@ def _prepare_move_line_default_vals(self, counterpart_account_id=None):
)
return line_vals_list
- def _get_payment_move_lines_to_reconcile(self):
- self.ensure_one()
- payment_move_line = False
- folio_ids = self.folio_ids and self.folio_ids.ids or False
- domain = [("move_id.folio_ids", "in", folio_ids)] if folio_ids else []
- domain.extend(
- [
- ("move_id.ref", "=", self.payment_ref),
- ("date", "=", self.date),
- ("reconciled", "=", False),
- "|",
- (
- "account_id",
- "=",
- self.journal_id.payment_debit_account_id.id,
- ),
- (
- "account_id",
- "=",
- self.journal_id.payment_credit_account_id.id,
- ),
- ("journal_id", "=", self.journal_id.id),
- ]
- )
- to_reconcile_move_lines = self.env["account.move.line"].search(domain)
- # We try to reconcile by amount
- for record in to_reconcile_move_lines:
- payment_move_line = record if record.balance == self.amount else False
- return payment_move_line
-
def _create_counterpart_and_new_aml(
self, counterpart_moves, counterpart_aml_dicts, new_aml_dicts
):
diff --git a/pms/models/account_move_line.py b/pms/models/account_move_line.py
index e49198bc61..d7a81805b5 100644
--- a/pms/models/account_move_line.py
+++ b/pms/models/account_move_line.py
@@ -8,8 +8,6 @@ class AccountMoveLine(models.Model):
_inherit = "account.move.line"
_check_pms_properties_auto = True
- # Fields declaration
- # TODO: REVIEW why not a Many2one?
name = fields.Char(
compute="_compute_name",
store=True,
@@ -59,7 +57,6 @@ class AccountMoveLine(models.Model):
)
move_id = fields.Many2one(check_pms_properties=True)
- # pylint: disable=W8110
@api.depends("account_id", "partner_id", "product_id", "pms_property_id")
def _compute_analytic_distribution(self):
properties = self.mapped("pms_property_id")
@@ -70,6 +67,7 @@ def _compute_analytic_distribution(self):
super(
AccountMoveLine, records.with_context(pms_property_id=pms_property.id)
)._compute_analytic_distribution()
+ return
@api.depends("move_id.payment_reference", "quantity")
def _compute_name(self):
@@ -130,7 +128,7 @@ def reconcile(self):
Reconcile the account move
"""
# Update partner in payments and statement lines
- res = super(AccountMoveLine, self).reconcile()
+ res = super().reconcile()
for record in self:
if record.payment_id:
old_payment_partner = record.payment_id.partner_id
@@ -145,10 +143,11 @@ def reconcile(self):
if old_payment_partner:
record.payment_id.message_post(
body=_(
- f"""
- Partner modify automatically from invoice:
- {old_payment_partner.name} to {new_payment_partner.name}
- """
+ "Partner modify automatically from"
+ " invoice: {old_partner} to {new_partner}"
+ ).format(
+ old_partner=old_payment_partner.name,
+ new_partner=new_payment_partner.name,
)
)
if record.statement_line_id:
@@ -164,10 +163,11 @@ def reconcile(self):
if old_statement_partner:
record.statement_line_id.message_post(
body=_(
- f"""
- Partner modify automatically from invoice:
- {old_statement_partner.name} to {new_payment_partner.name}
- """
+ "Partner modify automatically from "
+ "invoice: {old_partner} to {new_partner}"
+ ).format(
+ old_partner=old_statement_partner.name,
+ new_partner=new_payment_partner.name,
)
)
return res
@@ -176,7 +176,7 @@ def _get_lock_date_protected_fields(self):
"""Inherited from account.move.line
to avoid to lock partner_id in reconciliation_fnames
"""
- lock_types = super(AccountMoveLine, self)._get_lock_date_protected_fields()
+ lock_types = super()._get_lock_date_protected_fields()
reconciliation_fnames = lock_types.get("reconciliation", [])
# Remove partner_id from reconciliation_fnames
# because it is not a protected field
diff --git a/pms/models/account_payment.py b/pms/models/account_payment.py
index 380d1630a0..a27ace4964 100644
--- a/pms/models/account_payment.py
+++ b/pms/models/account_payment.py
@@ -83,9 +83,7 @@ def _compute_folio_ids(self):
rec.folio_ids = False
def _prepare_move_line_default_vals(self, write_off_line_vals=None):
- line_vals_list = super(AccountPayment, self)._prepare_move_line_default_vals(
- write_off_line_vals
- )
+ line_vals_list = super()._prepare_move_line_default_vals(write_off_line_vals)
if self.folio_ids:
for line in line_vals_list:
line.update(
@@ -97,7 +95,7 @@ def _prepare_move_line_default_vals(self, write_off_line_vals=None):
# pylint: disable=W8110
def _synchronize_to_moves(self, changed_fields):
- super(AccountPayment, self)._synchronize_to_moves(changed_fields)
+ super()._synchronize_to_moves(changed_fields)
if "folio_ids" in changed_fields:
for pay in self.with_context(skip_account_move_synchronization=True):
pay.move_id.write(
@@ -124,7 +122,7 @@ def action_draft(self):
)
else:
downpayment_invoices.unlink()
- return super(AccountPayment, self).action_draft()
+ return super().action_draft()
@api.model
def auto_invoice_downpayments(self, offset=0):
diff --git a/pms/models/ir_pms_property.py b/pms/models/ir_pms_property.py
index 97250bbfb8..954c237933 100644
--- a/pms/models/ir_pms_property.py
+++ b/pms/models/ir_pms_property.py
@@ -136,4 +136,4 @@ def create(self, vals_list):
"field_id": field_id.id,
}
)
- return super(IrPmsProperty, self).create(vals)
+ return super().create(vals)
diff --git a/pms/models/mail_compose_message.py b/pms/models/mail_compose_message.py
index 24af8478ad..ba5c03e792 100644
--- a/pms/models/mail_compose_message.py
+++ b/pms/models/mail_compose_message.py
@@ -8,7 +8,7 @@ class MailComposeMessage(models.TransientModel):
_inherit = "mail.compose.message"
def send_mail(self, auto_commit=False):
- res = super(MailComposeMessage, self).send_mail(auto_commit=auto_commit)
+ res = super().send_mail(auto_commit=auto_commit)
if (
self._context.get("default_model") == "pms.folio"
and self._context.get("active_model") == "pms.reservation"
diff --git a/pms/models/pms_board_service_line.py b/pms/models/pms_board_service_line.py
index 09cfa93cc9..7e314c68a4 100644
--- a/pms/models/pms_board_service_line.py
+++ b/pms/models/pms_board_service_line.py
@@ -75,7 +75,7 @@ def create(self, vals_list):
"pms_property_ids": properties,
}
)
- return super(PmsBoardServiceLine, self).create(vals_list)
+ return super().create(vals_list)
def write(self, vals):
properties = False
@@ -90,7 +90,7 @@ def write(self, vals):
"pms_property_ids": properties,
}
)
- return super(PmsBoardServiceLine, self).write(vals)
+ return super().write(vals)
@api.constrains("adults", "children")
def _check_adults_children(self):
diff --git a/pms/models/pms_board_service_room_type.py b/pms/models/pms_board_service_room_type.py
index 2338a99dc0..4155574a9f 100644
--- a/pms/models/pms_board_service_room_type.py
+++ b/pms/models/pms_board_service_room_type.py
@@ -132,14 +132,14 @@ def create(self, vals_list):
vals["pms_board_service_id"]
)
)
- return super(PmsBoardServiceRoomType, self).create(vals_list)
+ return super().create(vals_list)
def write(self, vals):
if "pms_board_service_id" in vals and "board_service_line_ids" not in vals:
vals.update(
self.prepare_board_service_reservation_ids(vals["pms_board_service_id"])
)
- return super(PmsBoardServiceRoomType, self).write(vals)
+ return super().write(vals)
@api.model
def prepare_board_service_reservation_ids(self, board_service_id):
diff --git a/pms/models/pms_checkin_partner.py b/pms/models/pms_checkin_partner.py
index 3e9f0394c7..e450b36629 100644
--- a/pms/models/pms_checkin_partner.py
+++ b/pms/models/pms_checkin_partner.py
@@ -620,7 +620,7 @@ def _compute_sign_on(self):
# pylint: disable=W8110
def _compute_access_url(self):
- super(PmsCheckinPartner, self)._compute_access_url()
+ super()._compute_access_url()
for checkin in self:
checkin.access_url = "/my/folios/%s/reservations/%s/checkins/%s" % (
checkin.folio_id.id,
@@ -787,7 +787,7 @@ def create(self, vals_list):
if len(reservation.checkin_partner_ids) < (
reservation.adults + reservation.children
):
- records += super(PmsCheckinPartner, self).create(vals)
+ records += super().create(vals)
elif len(dummy_checkins) > 0:
dummy_checkins[0].write(vals)
records += dummy_checkins[0]
diff --git a/pms/models/pms_property.py b/pms/models/pms_property.py
index 7846af0eac..ab22d6703c 100644
--- a/pms/models/pms_property.py
+++ b/pms/models/pms_property.py
@@ -263,7 +263,6 @@ def _compute_free_room_ids(self):
current_lines = self.env.context.get("current_lines", False)
if current_lines and not isinstance(current_lines, list):
current_lines = [current_lines]
-
pricelist_id = self.env.context.get("pricelist_id", False)
room_type_id = self.env.context.get("room_type_id", False)
class_id = self._context.get("class_id", False)
diff --git a/pms/models/pms_reservation.py b/pms/models/pms_reservation.py
index 4c22084ca8..5cd20fc40a 100644
--- a/pms/models/pms_reservation.py
+++ b/pms/models/pms_reservation.py
@@ -1111,7 +1111,7 @@ def _compute_ready_for_checkin(self):
# pylint: disable=W8110
def _compute_access_url(self):
- super(PmsReservation, self)._compute_access_url()
+ super()._compute_access_url()
for reservation in self:
reservation.access_url = "/my/reservations/%s" % (reservation.id)
@@ -1162,7 +1162,7 @@ def _compute_checkout(self):
# pylint: disable=W8110
def _compute_precheckin_url(self):
- super(PmsReservation, self)._compute_access_url()
+ super()._compute_access_url()
for reservation in self:
reservation.access_url = "/my/reservations/precheckin/%s" % (reservation.id)
@@ -1990,9 +1990,7 @@ def name_search(self, name="", args=None, operator="ilike", limit=100):
("folio_id.name", operator, name),
("preferred_room_id.name", operator, name),
]
- return super(PmsReservation, self).name_search(
- name="", args=args, operator="ilike", limit=limit
- )
+ return super().name_search(name="", args=args, operator="ilike", limit=limit)
def name_get(self):
result = []
@@ -2073,7 +2071,7 @@ def create(self, vals_list):
if "state" in vals:
reservation_state = vals["state"]
vals.pop("state")
- records = super(PmsReservation, self).create(vals_list)
+ records = super().create(vals_list)
for record in records:
record._check_capacity()
if (
@@ -2143,7 +2141,7 @@ def write(self, vals):
folios_to_update_channel = self.get_folios_to_update_channel(vals)
lines_to_update_channel = self.get_lines_to_update_channel(vals)
services_to_update_channel = self.get_services_to_update_channel(vals)
- res = super(PmsReservation, self).write(vals)
+ res = super().write(vals)
if folios_to_update_channel:
folios_to_update_channel.sale_channel_origin_id = vals[
"sale_channel_origin_id"
diff --git a/pms/models/pms_room.py b/pms/models/pms_room.py
index 64e0390f0d..a2ab9edcda 100644
--- a/pms/models/pms_room.py
+++ b/pms/models/pms_room.py
@@ -311,7 +311,7 @@ def create(self, vals_list):
vals.update({"short_name": short_name})
else:
vals.update({"short_name": vals["name"]})
- return super(PmsRoom, self).create(vals_list)
+ return super().create(vals_list)
def write(self, vals):
if vals.get("name") and not vals.get("short_name"):
@@ -320,7 +320,7 @@ def write(self, vals):
vals.update({"short_name": short_name})
else:
vals.update({"short_name": vals["name"]})
- return super(PmsRoom, self).write(vals)
+ return super().write(vals)
def calculate_short_name(self, vals):
short_name = vals["name"][:2].upper()
diff --git a/pms/models/pms_service.py b/pms/models/pms_service.py
index b24ed37140..8c487e74c4 100644
--- a/pms/models/pms_service.py
+++ b/pms/models/pms_service.py
@@ -552,9 +552,7 @@ def name_search(self, name="", args=None, operator="ilike", limit=100):
("reservation_id.name", operator, name),
("name", operator, name),
]
- return super(PmsService, self).name_search(
- name="", args=args, operator="ilike", limit=limit
- )
+ return super().name_search(name="", args=args, operator="ilike", limit=limit)
def _get_display_price(self, product):
folio = self.folio_id
@@ -638,14 +636,14 @@ def create(self, vals_list):
folio = self.env["pms.folio"].browse(vals["folio_id"])
if folio.sale_channel_origin_id:
vals["sale_channel_origin_id"] = folio.sale_channel_origin_id.id
- return super(PmsService, self).create(vals_list)
+ return super().create(vals_list)
def write(self, vals):
folios_to_update_channel = self.env["pms.folio"]
lines_to_update_channel = self.env["pms.service.line"]
if "sale_channel_origin_id" in vals:
folios_to_update_channel = self.get_folios_to_update_channel(vals)
- res = super(PmsService, self).write(vals)
+ res = super().write(vals)
if folios_to_update_channel:
folios_to_update_channel.sale_channel_origin_id = vals[
"sale_channel_origin_id"
diff --git a/pms/models/product_pricelist.py b/pms/models/product_pricelist.py
index 04f4137ce8..8267a69138 100644
--- a/pms/models/product_pricelist.py
+++ b/pms/models/product_pricelist.py
@@ -73,9 +73,7 @@ class ProductPricelist(models.Model):
)
def _get_applicable_rules_domain(self, products, date, **kwargs):
- domain = super(ProductPricelist, self)._get_applicable_rules_domain(
- products, date, **kwargs
- )
+ domain = super()._get_applicable_rules_domain(products, date, **kwargs)
consumption_date = kwargs.get("consumption_date")
if consumption_date:
domain.extend(
@@ -105,7 +103,7 @@ def _compute_price_rule(self, products, qty, uom=None, date=False, **kwargs):
"""
consumption_date = kwargs.get("consumption_date")
if not consumption_date:
- return super(ProductPricelist, self)._compute_price_rule(
+ return super()._compute_price_rule(
products, qty, uom=uom, date=date, **kwargs
)
self.ensure_one()
@@ -159,81 +157,6 @@ def _compute_price_rule(self, products, qty, uom=None, date=False, **kwargs):
return results
- # V14.0
- # def _compute_price_rule_get_items(
- # self, products_qty_partner, date, uom_id, prod_tmpl_ids, prod_ids, categ_ids
- # ):
- # board_service = True if self._context.get("board_service") else False
- # if (
- # "property" in self._context
- # and self._context["property"]
- # and self._context.get("consumption_date")
- # ):
- # self.env.cr.execute(
- # """
- # SELECT item.id
- # FROM product_pricelist_item item
- # LEFT JOIN product_category categ
- # ON item.categ_id = categ.id
- # LEFT JOIN product_pricelist_pms_property_rel cab
- # ON item.pricelist_id = cab.product_pricelist_id
- # LEFT JOIN product_pricelist_item_pms_property_rel lin
- # ON item.id = lin.product_pricelist_item_id
- # WHERE (lin.pms_property_id = %s OR lin.pms_property_id IS NULL)
- # AND (cab.pms_property_id = %s OR cab.pms_property_id IS NULL)
- # AND (item.product_tmpl_id IS NULL
- # OR item.product_tmpl_id = ANY(%s))
- # AND (item.product_id IS NULL OR item.product_id = ANY(%s))
- # AND (item.categ_id IS NULL OR item.categ_id = ANY(%s))
- # AND (item.pricelist_id = %s)
- # AND (item.date_start IS NULL OR item.date_start <=%s)
- # AND (item.date_end IS NULL OR item.date_end >=%s)
- # AND (item.date_start_consumption IS NULL
- # OR item.date_start_consumption <=%s)
- # AND (item.date_end_consumption IS NULL
- # OR item.date_end_consumption >=%s)
- # GROUP BY item.id
- # ORDER BY item.applied_on,
- # /* REVIEW: priotrity date sale / date consumption */
- # item.date_end - item.date_start ASC,
- # item.date_end_consumption - item.date_start_consumption ASC,
- # NULLIF((SELECT COUNT(1)
- # FROM product_pricelist_item_pms_property_rel l
- # WHERE item.id = l.product_pricelist_item_id)
- # + (SELECT COUNT(1)
- # FROM product_pricelist_pms_property_rel c
- # WHERE item.pricelist_id = c.product_pricelist_id),0)
- # NULLS LAST,
- # item.id DESC;
- # """,
- # (
- # self._context["property"],
- # self._context["property"],
- # prod_tmpl_ids,
- # prod_ids,
- # categ_ids,
- # self.id,
- # date,
- # date,
- # self._context["consumption_date"],
- # self._context["consumption_date"],
- # ),
- # )
- # item_ids = [x[0] for x in self.env.cr.fetchall()]
- # items = self.env["product.pricelist.item"].browse(item_ids)
- # if board_service:
- # items = items.filtered(
- # lambda x: x.board_service_room_type_id.id
- # == self._context.get("board_service")
- # )
- # else:
- # items = items.filtered(lambda x: not x.board_service_room_type_id.id)
- # else:
- # items = super(ProductPricelist, self)._compute_price_rule_get_items(
- # products_qty_partner, date, uom_id, prod_tmpl_ids, prod_ids, categ_ids
- # )
- # return items
-
@api.constrains("is_pms_available", "availability_plan_id")
def _check_is_pms_available(self):
for record in self:
diff --git a/pms/models/product_pricelist_item.py b/pms/models/product_pricelist_item.py
index 1b26a9a46a..33c79273fc 100644
--- a/pms/models/product_pricelist_item.py
+++ b/pms/models/product_pricelist_item.py
@@ -5,6 +5,9 @@
class ProductPricelistItem(models.Model):
_inherit = "product.pricelist.item"
+ _order = (
+ "applied_on, min_quantity desc, categ_id desc, has_properties desc, id desc"
+ )
_check_pms_properties_auto = True
pms_property_ids = fields.Many2many(
@@ -40,10 +43,7 @@ class ProductPricelistItem(models.Model):
check_pms_properties=True,
)
product_id = fields.Many2one(
- string="Product",
- help="Product associated with the item",
- index=True,
- check_pms_properties=True,
+ string="Product", help="Product associated with the item", index=True
)
product_tmpl_id = fields.Many2one(
string="Product Template",
@@ -66,6 +66,13 @@ class ProductPricelistItem(models.Model):
readonly=False,
compute="_compute_allowed_board_service_room_type_ids",
)
+ has_properties = fields.Boolean(compute="_compute_has_properties", store=True)
+
+ @api.depends("pms_property_ids")
+ def _compute_has_properties(self):
+ """Compute if the pricelist has properties associated."""
+ for record in self:
+ record.has_properties = len(record.pms_property_ids) != 0
@api.depends("board_service_room_type_id")
def _compute_allowed_board_service_product_ids(self):
diff --git a/pms/models/product_product.py b/pms/models/product_product.py
index 70ae1e7581..51e4cf4fba 100644
--- a/pms/models/product_product.py
+++ b/pms/models/product_product.py
@@ -21,7 +21,7 @@ class ProductProduct(models.Model):
@api.depends_context("consumption_date", "board_service_line_id")
# pylint: disable=W8110
def _compute_product_price(self):
- super(ProductProduct, self)._compute_product_price()
+ super()._compute_product_price()
@api.depends_context("consumption_date", "board_service_line_id")
def _compute_board_price(self):
@@ -56,6 +56,4 @@ def price_compute(
):
if self._context.get("board_service_line_id"):
price_type = "board_price"
- return super(ProductProduct, self).price_compute(
- price_type, uom, currency, company, date
- )
+ return super().price_compute(price_type, uom, currency, company, date)
diff --git a/pms/models/product_template.py b/pms/models/product_template.py
index 3fa4a39e7e..c15478d9f8 100644
--- a/pms/models/product_template.py
+++ b/pms/models/product_template.py
@@ -130,7 +130,7 @@ def write(self, vals):
vals["is_pms_available"] = True
vals["per_day"] = True
vals["consumed_on"] = "before"
- return super(ProductTemplate, self).write(vals)
+ return super().write(vals)
def _get_mmdd_selection(self):
lang = self.env.lang or "en_US"
@@ -152,7 +152,7 @@ def _get_mmdd_selection(self):
options = []
for month in range(1, 13):
for day in range(1, days_by_month[month] + 1):
- mmdd = f"{month:02d}-{day:02d}"
+ mmdd = "{month:02d}-{day:02d}".format(month=month, day=day)
dt = date(2024, month, day) # Dummy year
label = babel.dates.format_date(dt, format="d MMMM", locale=lang)
options.append((mmdd, label.capitalize()))
diff --git a/pms/models/res_partner.py b/pms/models/res_partner.py
index d7d314d661..85dd8a4577 100644
--- a/pms/models/res_partner.py
+++ b/pms/models/res_partner.py
@@ -751,7 +751,7 @@ def create(self, vals_list):
check_missing_document = self._check_document_partner_required(vals)
if check_missing_document:
raise ValidationError(_("A document identification is required"))
- return super(ResPartner, self).create(vals_list)
+ return super().create(vals_list)
def write(self, vals):
check_missing_document = self._check_document_partner_required(
diff --git a/pms/security/ir.model.access.csv b/pms/security/ir.model.access.csv
index 9500e98e45..3f9e79aa4a 100644
--- a/pms/security/ir.model.access.csv
+++ b/pms/security/ir.model.access.csv
@@ -55,7 +55,6 @@ user_access_pms_massive_changes_wizard,user_access_pms_massive_changes_wizard,mo
user_access_pms_advanced_filters_wizard,user_access_pms_advanced_filters_wizard,model_pms_advanced_filters_wizard,pms.group_pms_user,1,1,1,1
user_access_pms_booking_engine,user_access_pms_booking_engine,model_pms_booking_engine,pms.group_pms_user,1,1,1,1
user_access_pms_folio_availability_wizard,user_access_pms_folio_availability_wizard,model_pms_folio_availability_wizard,pms.group_pms_user,1,1,1,1
-user_access_pms_num_rooms_selection,user_access_pms_num_rooms_selection,model_pms_num_rooms_selection,pms.group_pms_user,1,1,1,1
user_access_pms_folio_sale_line,user_access_pms_folio_sale_line,model_folio_sale_line,pms.group_pms_user,1,1,1,1
user_access_folio_make_invoice_advance,user_access_folio_make_invoice_advance,model_folio_advance_payment_inv,pms.group_pms_user,1,1,1,1
user_access_wizard_payment_folio,user_access_wizard_payment_folio,model_wizard_payment_folio,pms.group_pms_user,1,1,1,1
diff --git a/pms/static/src/js/folio_portal_sidebar.js b/pms/static/src/js/folio_portal_sidebar.js
deleted file mode 100644
index c73bb61efd..0000000000
--- a/pms/static/src/js/folio_portal_sidebar.js
+++ /dev/null
@@ -1,150 +0,0 @@
-odoo.define("account.FolioPortalSidebar", function (require) {
- "use strict";
-
- const dom = require("web.dom");
- var publicWidget = require("web.public.widget");
- var PortalSidebar = require("portal.PortalSidebar");
- var utils = require("web.utils");
-
- publicWidget.registry.FolioPortalSidebar = PortalSidebar.extend({
- selector: ".o_portal_folio_sidebar",
-
- /**
- * @class
- */
- init: function (parent, options) {
- this._super.apply(this, arguments);
- this.authorizedTextTag = ["em", "b", "i", "u"];
- this.spyWatched = $('body[data-target=".navspy"]');
- },
- /**
- * @override
- */
- start: function () {
- var def = this._super.apply(this, arguments);
- var $spyWatcheElement = this.$el.find('[data-id="portal_sidebar"]');
- this._setElementId($spyWatcheElement);
- // Nav Menu ScrollSpy
- this._generateMenu();
- // After signature, automatically open the popup for payment
- if (
- $.bbq.getState("allow_payment") === "yes" &&
- this.$("#o_sale_portal_paynow").length
- ) {
- this.el.querySelector("#o_sale_portal_paynow").click();
- $.bbq.removeState("allow_payment");
- }
- return def;
- },
-
- // --------------------------------------------------------------------------
- // Private
- // ---------------------------------------------------------------------------
-
- /**
- * create an unique id and added as a attribute of spyWatched element
- *
- * @private
- * @param {String} prefix
- * @param {Object} $el
- *
- */
- _setElementId: function (prefix, $el) {
- var id = _.uniqueId(prefix);
- this.spyWatched.find($el).attr("id", id);
- return id;
- },
- /**
- * Generate the new spy menu
- *
- * @private
- *
- */
- _generateMenu: function () {
- var self = this,
- lastLI = false,
- lastUL = null,
- $bsSidenav = this.$el.find(".bs-sidenav");
-
- $(
- "#quote_content [id^=quote_header_], #quote_content [id^=quote_]",
- this.spyWatched
- ).attr("id", "");
- _.each(
- this.spyWatched.find("#quote_content h2, #quote_content h3"),
- function (el) {
- var id, text;
- switch (el.tagName.toLowerCase()) {
- case "h2":
- id = self._setElementId("quote_header_", el);
- text = self._extractText($(el));
- if (!text) {
- break;
- }
- lastLI = $("
")
- .append(
- $(
- ' '
- ).text(text)
- )
- .appendTo($bsSidenav);
- lastUL = false;
- break;
- case "h3":
- id = self._setElementId("quote_", el);
- text = self._extractText($(el));
- if (!text) {
- break;
- }
- if (lastLI) {
- if (!lastUL) {
- lastUL = $("").appendTo(
- lastLI
- );
- }
- $("")
- .append(
- $(
- ' '
- ).text(text)
- )
- .appendTo(lastUL);
- }
- break;
- }
- el.setAttribute("data-anchor", true);
- }
- );
- this.trigger_up("widgets_start_request", {$target: $bsSidenav});
- },
- /**
- * Extract text of menu title for sidebar
- *
- * @private
- * @param {Object} $node
- *
- */
- _extractText: function ($node) {
- var self = this;
- var rawText = [];
- _.each($node.contents(), function (el) {
- var current = $(el);
- if ($.trim(current.text())) {
- var tagName = current.prop("tagName");
- if (
- _.isUndefined(tagName) ||
- (!_.isUndefined(tagName) &&
- _.contains(self.authorizedTextTag, tagName.toLowerCase()))
- ) {
- rawText.push($.trim(current.text()));
- }
- }
- });
- return rawText.join(" ");
- },
- });
-});
diff --git a/pms/static/src/js/payment_form.js b/pms/static/src/js/payment_form.js
index 40d6abf9b5..3c64a501b7 100644
--- a/pms/static/src/js/payment_form.js
+++ b/pms/static/src/js/payment_form.js
@@ -20,11 +20,11 @@ odoo.define("pms.payment_form", (require) => {
* @returns {Object} The extended transaction route params
*/
_prepareTransactionRouteParams: function (code, paymentOptionId, flow) {
- const transactionRouteParams = this._super(...arguments);
+ const transactionRouteParams = this._super(code, paymentOptionId, flow);
return {
...transactionRouteParams,
pms_folio_id: this.txContext.pmsFolioId
- ? parseInt(this.txContext.pmsFolioId)
+ ? parseInt(this.txContext.pmsFolioId, 10)
: undefined,
};
},
diff --git a/pms/static/src/js/pms_list_controller.js b/pms/static/src/js/pms_list_controller.js
deleted file mode 100644
index 74db950656..0000000000
--- a/pms/static/src/js/pms_list_controller.js
+++ /dev/null
@@ -1,41 +0,0 @@
-odoo.define("booking.engine.tree", function (require) {
- "use strict";
- var ListController = require("web.ListController");
- var ListView = require("web.ListView");
- var viewRegistry = require("web.view_registry");
-
- function renderBookingEngineButton() {
- if (this.$buttons) {
- var self = this;
- this.$buttons.on("click", ".o_button_booking_engine", function () {
- self.do_action({
- name: "Booking Engine",
- type: "ir.actions.act_window",
- res_model: "pms.booking.engine",
- target: "new",
- views: [[false, "form"]],
- context: {is_modal: true},
- });
- });
- }
- }
-
- var BookingEngineRequestListController = ListController.extend({
- start: function () {
- return this._super.apply(this, arguments);
- },
- buttons_template: "BookingEngineRequestListView.buttons",
- renderButtons: function () {
- this._super.apply(this, arguments);
- renderBookingEngineButton.apply(this, arguments);
- },
- });
-
- var BookingEngineRequestListView = ListView.extend({
- config: _.extend({}, ListView.prototype.config, {
- Controller: BookingEngineRequestListController,
- }),
- });
-
- viewRegistry.add("pms_booking_engine_request_tree", BookingEngineRequestListView);
-});
diff --git a/pms/static/src/js/widgets/datepicker/bootstrap-datepicker.js b/pms/static/src/js/widgets/datepicker/bootstrap-datepicker.js
deleted file mode 100644
index 4f45b56314..0000000000
--- a/pms/static/src/js/widgets/datepicker/bootstrap-datepicker.js
+++ /dev/null
@@ -1,1197 +0,0 @@
-/* =========================================================
- * bootstrap-datepicker.js
- * http://www.eyecon.ro/bootstrap-datepicker
- * =========================================================
- * Copyright 2012 Stefan Petre
- * Improvements by Andrew Rowls
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ========================================================= */
-
-!(function ($) {
- function UTCDate() {
- return new Date(Date.UTC.apply(Date, arguments));
- }
- function UTCToday() {
- var today = new Date();
- return UTCDate(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate());
- }
-
- // Picker object
-
- var Datepicker = function (element, options) {
- var that = this;
-
- this.element = $(element);
- this.language = options.language || this.element.data("date-language") || "en";
- this.language = this.language in dates ? this.language : "en";
- this.isRTL = dates[this.language].rtl || false;
- this.format = DPGlobal.parseFormat(
- options.format || this.element.data("date-format") || "mm/dd/yyyy"
- );
- this.isInline = false;
- this.isInput = this.element.is("input");
- this.component = this.element.is(".date")
- ? this.element.find(".add-on")
- : false;
- this.hasInput = this.component && this.element.find("input").length;
- if (this.component && this.component.length === 0) this.component = false;
-
- this._attachEvents();
-
- this.forceParse = true;
- if ("forceParse" in options) {
- this.forceParse = options.forceParse;
- } else if ("dateForceParse" in this.element.data()) {
- this.forceParse = this.element.data("date-force-parse");
- }
-
- this.picker = $(DPGlobal.template)
- .appendTo(this.isInline ? this.element : "body")
- .on({
- click: $.proxy(this.click, this),
- mousedown: $.proxy(this.mousedown, this),
- });
-
- if (this.isInline) {
- this.picker.addClass("datepicker-inline");
- } else {
- this.picker.addClass("datepicker-dropdown dropdown-menu");
- }
- if (this.isRTL) {
- this.picker.addClass("datepicker-rtl");
- this.picker
- .find(".prev i, .next i")
- .toggleClass("icon-arrow-left icon-arrow-right");
- }
- $(document).on("mousedown", function (e) {
- // Clicked outside the datepicker, hide it
- if ($(e.target).closest(".datepicker").length === 0) {
- that.hide();
- }
- });
-
- this.autoclose = false;
- if ("autoclose" in options) {
- this.autoclose = options.autoclose;
- } else if ("dateAutoclose" in this.element.data()) {
- this.autoclose = this.element.data("date-autoclose");
- }
-
- this.keyboardNavigation = true;
- if ("keyboardNavigation" in options) {
- this.keyboardNavigation = options.keyboardNavigation;
- } else if ("dateKeyboardNavigation" in this.element.data()) {
- this.keyboardNavigation = this.element.data("date-keyboard-navigation");
- }
-
- this.viewMode = this.startViewMode = 0;
- switch (options.startView || this.element.data("date-start-view")) {
- case 2:
- case "decade":
- this.viewMode = this.startViewMode = 2;
- break;
- case 1:
- case "year":
- this.viewMode = this.startViewMode = 1;
- break;
- }
-
- this.todayBtn =
- options.todayBtn || this.element.data("date-today-btn") || false;
- this.todayHighlight =
- options.todayHighlight ||
- this.element.data("date-today-highlight") ||
- false;
-
- this.weekStart =
- (options.weekStart ||
- this.element.data("date-weekstart") ||
- dates[this.language].weekStart ||
- 0) % 7;
- this.weekEnd = (this.weekStart + 6) % 7;
- this.startDate = -Infinity;
- this.endDate = Infinity;
- this.daysOfWeekDisabled = [];
- this.setStartDate(options.startDate || this.element.data("date-startdate"));
- this.setEndDate(options.endDate || this.element.data("date-enddate"));
- this.setDaysOfWeekDisabled(
- options.daysOfWeekDisabled ||
- this.element.data("date-days-of-week-disabled")
- );
- this.fillDow();
- this.fillMonths();
- this.update();
- this.showMode();
-
- if (this.isInline) {
- this.show();
- }
- };
-
- Datepicker.prototype = {
- constructor: Datepicker,
-
- _events: [],
- _attachEvents: function () {
- this._detachEvents();
- if (this.isInput) {
- // Single input
- this._events = [
- [
- this.element,
- {
- focus: $.proxy(this.show, this),
- keyup: $.proxy(this.update, this),
- keydown: $.proxy(this.keydown, this),
- },
- ],
- ];
- } else if (this.component && this.hasInput) {
- // Component: input + button
- this._events = [
- // For components that are not readonly, allow keyboard nav
- [
- this.element.find("input"),
- {
- focus: $.proxy(this.show, this),
- keyup: $.proxy(this.update, this),
- keydown: $.proxy(this.keydown, this),
- },
- ],
- [
- this.component,
- {
- click: $.proxy(this.show, this),
- },
- ],
- ];
- } else if (this.element.is("div")) {
- // Inline datepicker
- this.isInline = true;
- } else {
- this._events = [
- [
- this.element,
- {
- click: $.proxy(this.show, this),
- },
- ],
- ];
- }
- for (var i = 0, el, ev; i < this._events.length; i++) {
- el = this._events[i][0];
- ev = this._events[i][1];
- el.on(ev);
- }
- },
- _detachEvents: function () {
- for (var i = 0, el, ev; i < this._events.length; i++) {
- el = this._events[i][0];
- ev = this._events[i][1];
- el.off(ev);
- }
- this._events = [];
- },
-
- show: function (e) {
- this.picker.show();
- this.height = this.component
- ? this.component.outerHeight()
- : this.element.outerHeight();
- this.update();
- this.place();
- $(window).on("resize", $.proxy(this.place, this));
- if (e) {
- e.stopPropagation();
- e.preventDefault();
- }
- this.element.trigger({
- type: "show",
- date: this.date,
- });
- },
-
- hide: function (e) {
- if (this.isInline) return;
- this.picker.hide();
- $(window).off("resize", this.place);
- this.viewMode = this.startViewMode;
- this.showMode();
- if (!this.isInput) {
- $(document).off("mousedown", this.hide);
- }
-
- if (
- this.forceParse &&
- ((this.isInput && this.element.val()) ||
- (this.hasInput && this.element.find("input").val()))
- )
- this.setValue();
- this.element.trigger({
- type: "hide",
- date: this.date,
- });
- },
-
- remove: function () {
- this._detachEvents();
- this.picker.remove();
- delete this.element.data().datepicker;
- },
-
- getDate: function () {
- var d = this.getUTCDate();
- return new Date(d.getTime() + d.getTimezoneOffset() * 60000);
- },
-
- getUTCDate: function () {
- return this.date;
- },
-
- setDate: function (d) {
- this.setUTCDate(new Date(d.getTime() - d.getTimezoneOffset() * 60000));
- },
-
- setUTCDate: function (d) {
- this.date = d;
- this.setValue();
- },
-
- setValue: function () {
- var formatted = this.getFormattedDate();
- if (!this.isInput) {
- if (this.component) {
- this.element.find("input").val(formatted);
- }
- this.element.data("date", formatted);
- } else {
- this.element.val(formatted);
- }
- },
-
- getFormattedDate: function (format) {
- if (format === undefined) format = this.format;
- return DPGlobal.formatDate(this.date, format, this.language);
- },
-
- setStartDate: function (startDate) {
- this.startDate = startDate || -Infinity;
- if (this.startDate !== -Infinity) {
- this.startDate = DPGlobal.parseDate(
- this.startDate,
- this.format,
- this.language
- );
- }
- this.update();
- this.updateNavArrows();
- },
-
- setEndDate: function (endDate) {
- this.endDate = endDate || Infinity;
- if (this.endDate !== Infinity) {
- this.endDate = DPGlobal.parseDate(
- this.endDate,
- this.format,
- this.language
- );
- }
- this.update();
- this.updateNavArrows();
- },
-
- setDaysOfWeekDisabled: function (daysOfWeekDisabled) {
- this.daysOfWeekDisabled = daysOfWeekDisabled || [];
- if (!$.isArray(this.daysOfWeekDisabled)) {
- this.daysOfWeekDisabled = this.daysOfWeekDisabled.split(/,\s*/);
- }
- this.daysOfWeekDisabled = $.map(this.daysOfWeekDisabled, function (d) {
- return parseInt(d, 10);
- });
- this.update();
- this.updateNavArrows();
- },
-
- place: function () {
- if (this.isInline) return;
- var zIndex =
- parseInt(
- this.element
- .parents()
- .filter(function () {
- return $(this).css("z-index") != "auto";
- })
- .first()
- .css("z-index")
- ) + 10;
- var offset = this.component
- ? this.component.offset()
- : this.element.offset();
- var height = this.component
- ? this.component.outerHeight(true)
- : this.element.outerHeight(true);
- this.picker.css({
- top: offset.top + height,
- left: offset.left,
- zIndex: zIndex,
- });
- },
-
- update: function () {
- var date,
- fromArgs = false;
- if (
- arguments &&
- arguments.length &&
- (typeof arguments[0] === "string" || arguments[0] instanceof Date)
- ) {
- date = arguments[0];
- fromArgs = true;
- } else {
- date = this.isInput
- ? this.element.val()
- : this.element.data("date") || this.element.find("input").val();
- }
-
- this.date = DPGlobal.parseDate(date, this.format, this.language);
-
- if (fromArgs) this.setValue();
-
- var oldViewDate = this.viewDate;
- if (this.date < this.startDate) {
- this.viewDate = new Date(this.startDate);
- } else if (this.date > this.endDate) {
- this.viewDate = new Date(this.endDate);
- } else {
- this.viewDate = new Date(this.date);
- }
-
- if (oldViewDate && oldViewDate.getTime() != this.viewDate.getTime()) {
- this.element.trigger({
- type: "changeDate",
- date: this.viewDate,
- });
- }
- this.fill();
- },
-
- fillDow: function () {
- var dowCnt = this.weekStart,
- html = "";
- while (dowCnt < this.weekStart + 7) {
- html +=
- '' +
- dates[this.language].daysMin[dowCnt++ % 7] +
- " ";
- }
- html += " ";
- this.picker.find(".datepicker-days thead").append(html);
- },
-
- fillMonths: function () {
- var html = "",
- i = 0;
- while (i < 12) {
- html +=
- '' +
- dates[this.language].monthsShort[i++] +
- " ";
- }
- this.picker.find(".datepicker-months td").html(html);
- },
-
- fill: function () {
- var d = new Date(this.viewDate),
- year = d.getUTCFullYear(),
- month = d.getUTCMonth(),
- startYear =
- this.startDate !== -Infinity
- ? this.startDate.getUTCFullYear()
- : -Infinity,
- startMonth =
- this.startDate !== -Infinity
- ? this.startDate.getUTCMonth()
- : -Infinity,
- endYear =
- this.endDate !== Infinity
- ? this.endDate.getUTCFullYear()
- : Infinity,
- endMonth =
- this.endDate !== Infinity ? this.endDate.getUTCMonth() : Infinity,
- currentDate = this.date && this.date.valueOf(),
- today = new Date();
- this.picker
- .find(".datepicker-days thead th:eq(1)")
- .text(dates[this.language].months[month] + " " + year);
- this.picker
- .find("tfoot th.today")
- .text(dates[this.language].today)
- .toggle(this.todayBtn !== false);
- this.updateNavArrows();
- this.fillMonths();
- var prevMonth = UTCDate(year, month - 1, 28, 0, 0, 0, 0),
- day = DPGlobal.getDaysInMonth(
- prevMonth.getUTCFullYear(),
- prevMonth.getUTCMonth()
- );
- prevMonth.setUTCDate(day);
- prevMonth.setUTCDate(
- day - ((prevMonth.getUTCDay() - this.weekStart + 7) % 7)
- );
- var nextMonth = new Date(prevMonth);
- nextMonth.setUTCDate(nextMonth.getUTCDate() + 42);
- nextMonth = nextMonth.valueOf();
- var html = [];
- var clsName;
- while (prevMonth.valueOf() < nextMonth) {
- if (prevMonth.getUTCDay() == this.weekStart) {
- html.push("");
- }
- clsName = "";
- if (
- prevMonth.getUTCFullYear() < year ||
- (prevMonth.getUTCFullYear() == year &&
- prevMonth.getUTCMonth() < month)
- ) {
- clsName += " old";
- } else if (
- prevMonth.getUTCFullYear() > year ||
- (prevMonth.getUTCFullYear() == year &&
- prevMonth.getUTCMonth() > month)
- ) {
- clsName += " new";
- }
- // Compare internal UTC date with local today, not UTC today
- if (
- this.todayHighlight &&
- prevMonth.getUTCFullYear() == today.getFullYear() &&
- prevMonth.getUTCMonth() == today.getMonth() &&
- prevMonth.getUTCDate() == today.getDate()
- ) {
- clsName += " today";
- }
- if (currentDate && prevMonth.valueOf() == currentDate) {
- clsName += " active";
- }
- if (
- prevMonth.valueOf() < this.startDate ||
- prevMonth.valueOf() > this.endDate ||
- $.inArray(prevMonth.getUTCDay(), this.daysOfWeekDisabled) !== -1
- ) {
- clsName += " disabled";
- }
- html.push(
- '' + prevMonth.getUTCDate() + " "
- );
- if (prevMonth.getUTCDay() == this.weekEnd) {
- html.push(" ");
- }
- prevMonth.setUTCDate(prevMonth.getUTCDate() + 1);
- }
- this.picker.find(".datepicker-days tbody").empty().append(html.join(""));
- var currentYear = this.date && this.date.getUTCFullYear();
-
- var months = this.picker
- .find(".datepicker-months")
- .find("th:eq(1)")
- .text(year)
- .end()
- .find("span")
- .removeClass("active");
- if (currentYear && currentYear == year) {
- months.eq(this.date.getUTCMonth()).addClass("active");
- }
- if (year < startYear || year > endYear) {
- months.addClass("disabled");
- }
- if (year == startYear) {
- months.slice(0, startMonth).addClass("disabled");
- }
- if (year == endYear) {
- months.slice(endMonth + 1).addClass("disabled");
- }
-
- html = "";
- year = parseInt(year / 10, 10) * 10;
- var yearCont = this.picker
- .find(".datepicker-years")
- .find("th:eq(1)")
- .text(year + "-" + (year + 9))
- .end()
- .find("td");
- year -= 1;
- for (var i = -1; i < 11; i++) {
- html +=
- ' endYear ? " disabled" : "") +
- '">' +
- year +
- " ";
- year += 1;
- }
- yearCont.html(html);
- },
-
- updateNavArrows: function () {
- var d = new Date(this.viewDate),
- year = d.getUTCFullYear(),
- month = d.getUTCMonth();
- switch (this.viewMode) {
- case 0:
- if (
- this.startDate !== -Infinity &&
- year <= this.startDate.getUTCFullYear() &&
- month <= this.startDate.getUTCMonth()
- ) {
- this.picker.find(".prev").css({visibility: "hidden"});
- } else {
- this.picker.find(".prev").css({visibility: "visible"});
- }
- if (
- this.endDate !== Infinity &&
- year >= this.endDate.getUTCFullYear() &&
- month >= this.endDate.getUTCMonth()
- ) {
- this.picker.find(".next").css({visibility: "hidden"});
- } else {
- this.picker.find(".next").css({visibility: "visible"});
- }
- break;
- case 1:
- case 2:
- if (
- this.startDate !== -Infinity &&
- year <= this.startDate.getUTCFullYear()
- ) {
- this.picker.find(".prev").css({visibility: "hidden"});
- } else {
- this.picker.find(".prev").css({visibility: "visible"});
- }
- if (
- this.endDate !== Infinity &&
- year >= this.endDate.getUTCFullYear()
- ) {
- this.picker.find(".next").css({visibility: "hidden"});
- } else {
- this.picker.find(".next").css({visibility: "visible"});
- }
- break;
- }
- },
-
- click: function (e) {
- e.stopPropagation();
- e.preventDefault();
- var target = $(e.target).closest("span, td, th");
- if (target.length == 1) {
- switch (target[0].nodeName.toLowerCase()) {
- case "th":
- switch (target[0].className) {
- case "switch":
- this.showMode(1);
- break;
- case "prev":
- case "next":
- var dir =
- DPGlobal.modes[this.viewMode].navStep *
- (target[0].className == "prev" ? -1 : 1);
- switch (this.viewMode) {
- case 0:
- this.viewDate = this.moveMonth(
- this.viewDate,
- dir
- );
- break;
- case 1:
- case 2:
- this.viewDate = this.moveYear(
- this.viewDate,
- dir
- );
- break;
- }
- this.fill();
- break;
- case "today":
- var date = new Date();
- date = UTCDate(
- date.getFullYear(),
- date.getMonth(),
- date.getDate(),
- 0,
- 0,
- 0
- );
-
- this.showMode(-2);
- var which = this.todayBtn == "linked" ? null : "view";
- this._setDate(date, which);
- break;
- }
- break;
- case "span":
- if (!target.is(".disabled")) {
- this.viewDate.setUTCDate(1);
- if (target.is(".month")) {
- var month = target.parent().find("span").index(target);
- this.viewDate.setUTCMonth(month);
- this.element.trigger({
- type: "changeMonth",
- date: this.viewDate,
- });
- } else {
- var year = parseInt(target.text(), 10) || 0;
- this.viewDate.setUTCFullYear(year);
- this.element.trigger({
- type: "changeYear",
- date: this.viewDate,
- });
- }
- this.showMode(-1);
- this.fill();
- }
- break;
- case "td":
- if (target.is(".day") && !target.is(".disabled")) {
- var day = parseInt(target.text(), 10) || 1;
- var year = this.viewDate.getUTCFullYear(),
- month = this.viewDate.getUTCMonth();
- if (target.is(".old")) {
- if (month === 0) {
- month = 11;
- year -= 1;
- } else {
- month -= 1;
- }
- } else if (target.is(".new")) {
- if (month == 11) {
- month = 0;
- year += 1;
- } else {
- month += 1;
- }
- }
- this._setDate(UTCDate(year, month, day, 0, 0, 0, 0));
- }
- break;
- }
- }
- },
-
- _setDate: function (date, which) {
- if (!which || which == "date") this.date = date;
- if (!which || which == "view") this.viewDate = date;
- this.fill();
- this.setValue();
- this.element.trigger({
- type: "changeDate",
- date: this.date,
- });
- var element;
- if (this.isInput) {
- element = this.element;
- } else if (this.component) {
- element = this.element.find("input");
- }
- if (element) {
- element.change();
- if (this.autoclose && (!which || which == "date")) {
- this.hide();
- }
- }
- },
-
- moveMonth: function (date, dir) {
- if (!dir) return date;
- var new_date = new Date(date.valueOf()),
- day = new_date.getUTCDate(),
- month = new_date.getUTCMonth(),
- mag = Math.abs(dir),
- new_month,
- test;
- dir = dir > 0 ? 1 : -1;
- if (mag == 1) {
- test =
- dir == -1
- ? // If going back one month, make sure month is not current month
- // (eg, Mar 31 -> Feb 31 == Feb 28, not Mar 02)
- function () {
- return new_date.getUTCMonth() == month;
- }
- : // If going forward one month, make sure month is as expected
- // (eg, Jan 31 -> Feb 31 == Feb 28, not Mar 02)
- function () {
- return new_date.getUTCMonth() != new_month;
- };
- new_month = month + dir;
- new_date.setUTCMonth(new_month);
- // Dec -> Jan (12) or Jan -> Dec (-1) -- limit expected date to 0-11
- if (new_month < 0 || new_month > 11) new_month = (new_month + 12) % 12;
- } else {
- // For magnitudes >1, move one month at a time...
- for (var i = 0; i < mag; i++)
- // ...which might decrease the day (eg, Jan 31 to Feb 28, etc)...
- new_date = this.moveMonth(new_date, dir);
- // ...then reset the day, keeping it in the new month
- new_month = new_date.getUTCMonth();
- new_date.setUTCDate(day);
- test = function () {
- return new_month != new_date.getUTCMonth();
- };
- }
- // Common date-resetting loop -- if date is beyond end of month, make it
- // end of month
- while (test()) {
- new_date.setUTCDate(--day);
- new_date.setUTCMonth(new_month);
- }
- return new_date;
- },
-
- moveYear: function (date, dir) {
- return this.moveMonth(date, dir * 12);
- },
-
- dateWithinRange: function (date) {
- return date >= this.startDate && date <= this.endDate;
- },
-
- keydown: function (e) {
- if (this.picker.is(":not(:visible)")) {
- if (e.keyCode == 27)
- // Allow escape to hide and re-show picker
- this.show();
- return;
- }
- var dateChanged = false,
- dir,
- day,
- month,
- newDate,
- newViewDate;
- switch (e.keyCode) {
- case 27: // Escape
- this.hide();
- e.preventDefault();
- break;
- case 37: // Left
- case 39: // Right
- if (!this.keyboardNavigation) break;
- dir = e.keyCode == 37 ? -1 : 1;
- if (e.ctrlKey) {
- newDate = this.moveYear(this.date, dir);
- newViewDate = this.moveYear(this.viewDate, dir);
- } else if (e.shiftKey) {
- newDate = this.moveMonth(this.date, dir);
- newViewDate = this.moveMonth(this.viewDate, dir);
- } else {
- newDate = new Date(this.date);
- newDate.setUTCDate(this.date.getUTCDate() + dir);
- newViewDate = new Date(this.viewDate);
- newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir);
- }
- if (this.dateWithinRange(newDate)) {
- this.date = newDate;
- this.viewDate = newViewDate;
- this.setValue();
- this.update();
- e.preventDefault();
- dateChanged = true;
- }
- break;
- case 38: // Up
- case 40: // Down
- if (!this.keyboardNavigation) break;
- dir = e.keyCode == 38 ? -1 : 1;
- if (e.ctrlKey) {
- newDate = this.moveYear(this.date, dir);
- newViewDate = this.moveYear(this.viewDate, dir);
- } else if (e.shiftKey) {
- newDate = this.moveMonth(this.date, dir);
- newViewDate = this.moveMonth(this.viewDate, dir);
- } else {
- newDate = new Date(this.date);
- newDate.setUTCDate(this.date.getUTCDate() + dir * 7);
- newViewDate = new Date(this.viewDate);
- newViewDate.setUTCDate(this.viewDate.getUTCDate() + dir * 7);
- }
- if (this.dateWithinRange(newDate)) {
- this.date = newDate;
- this.viewDate = newViewDate;
- this.setValue();
- this.update();
- e.preventDefault();
- dateChanged = true;
- }
- break;
- case 13: // Enter
- this.hide();
- e.preventDefault();
- break;
- case 9: // Tab
- this.hide();
- break;
- }
- if (dateChanged) {
- this.element.trigger({
- type: "changeDate",
- date: this.date,
- });
- var element;
- if (this.isInput) {
- element = this.element;
- } else if (this.component) {
- element = this.element.find("input");
- }
- if (element) {
- element.change();
- }
- }
- },
-
- showMode: function (dir) {
- if (dir) {
- this.viewMode = Math.max(0, Math.min(2, this.viewMode + dir));
- }
- /*
- Vitalets: fixing bug of very special conditions:
- jquery 1.7.1 + webkit + show inline datepicker in bootstrap popover.
- Method show() does not set display css correctly and datepicker is not shown.
- Changed to .css('display', 'block') solve the problem.
- See https://github.com/vitalets/x-editable/issues/37
-
- In jquery 1.7.2+ everything works fine.
- */
- // this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
- this.picker
- .find(">div")
- .hide()
- .filter(".datepicker-" + DPGlobal.modes[this.viewMode].clsName)
- .css("display", "block");
- this.updateNavArrows();
- },
- };
-
- $.fn.datepicker = function (option) {
- var args = Array.apply(null, arguments);
- args.shift();
- return this.each(function () {
- var $this = $(this),
- data = $this.data("datepicker"),
- options = typeof option === "object" && option;
- if (!data) {
- $this.data(
- "datepicker",
- (data = new Datepicker(
- this,
- $.extend({}, $.fn.datepicker.defaults, options)
- ))
- );
- }
- if (typeof option === "string" && typeof data[option] === "function") {
- data[option].apply(data, args);
- }
- });
- };
-
- $.fn.datepicker.defaults = {};
- $.fn.datepicker.Constructor = Datepicker;
- var dates = ($.fn.datepicker.dates = {
- en: {
- days: [
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
- "Sunday",
- ],
- daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
- daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],
- months: [
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec",
- ],
- today: "Today",
- },
- });
-
- var DPGlobal = {
- modes: [
- {
- clsName: "days",
- navFnc: "Month",
- navStep: 1,
- },
- {
- clsName: "months",
- navFnc: "FullYear",
- navStep: 1,
- },
- {
- clsName: "years",
- navFnc: "FullYear",
- navStep: 10,
- },
- ],
- isLeapYear: function (year) {
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
- },
- getDaysInMonth: function (year, month) {
- return [
- 31,
- DPGlobal.isLeapYear(year) ? 29 : 28,
- 31,
- 30,
- 31,
- 30,
- 31,
- 31,
- 30,
- 31,
- 30,
- 31,
- ][month];
- },
- validParts: /dd?|DD?|mm?|MM?|yy(?:yy)?/g,
- nonpunctuation: /[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,
- parseFormat: function (format) {
- // IE treats \0 as a string end in inputs (truncating the value),
- // so it's a bad format delimiter, anyway
- var separators = format.replace(this.validParts, "\0").split("\0"),
- parts = format.match(this.validParts);
- if (!separators || !separators.length || !parts || parts.length === 0) {
- throw new Error("Invalid date format.");
- }
- return {separators: separators, parts: parts};
- },
- parseDate: function (date, format, language) {
- if (date instanceof Date) return date;
- if (/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(date)) {
- var part_re = /([\-+]\d+)([dmwy])/,
- parts = date.match(/([\-+]\d+)([dmwy])/g),
- part,
- dir;
- date = new Date();
- for (var i = 0; i < parts.length; i++) {
- part = part_re.exec(parts[i]);
- dir = parseInt(part[1]);
- switch (part[2]) {
- case "d":
- date.setUTCDate(date.getUTCDate() + dir);
- break;
- case "m":
- date = Datepicker.prototype.moveMonth.call(
- Datepicker.prototype,
- date,
- dir
- );
- break;
- case "w":
- date.setUTCDate(date.getUTCDate() + dir * 7);
- break;
- case "y":
- date = Datepicker.prototype.moveYear.call(
- Datepicker.prototype,
- date,
- dir
- );
- break;
- }
- }
- return UTCDate(
- date.getUTCFullYear(),
- date.getUTCMonth(),
- date.getUTCDate(),
- 0,
- 0,
- 0
- );
- }
- var parts = (date && date.match(this.nonpunctuation)) || [],
- date = new Date(),
- parsed = {},
- setters_order = ["yyyy", "yy", "M", "MM", "m", "mm", "d", "dd"],
- setters_map = {
- yyyy: function (d, v) {
- return d.setUTCFullYear(v);
- },
- yy: function (d, v) {
- return d.setUTCFullYear(2000 + v);
- },
- m: function (d, v) {
- v -= 1;
- while (v < 0) v += 12;
- v %= 12;
- d.setUTCMonth(v);
- while (d.getUTCMonth() != v) d.setUTCDate(d.getUTCDate() - 1);
- return d;
- },
- d: function (d, v) {
- return d.setUTCDate(v);
- },
- },
- val,
- filtered,
- part;
- setters_map.M = setters_map.MM = setters_map.mm = setters_map.m;
- setters_map.dd = setters_map.d;
- date = UTCDate(
- date.getFullYear(),
- date.getMonth(),
- date.getDate(),
- 0,
- 0,
- 0
- );
- var fparts = format.parts.slice();
- // Remove noop parts
- if (parts.length != fparts.length) {
- fparts = $(fparts)
- .filter(function (i, p) {
- return $.inArray(p, setters_order) !== -1;
- })
- .toArray();
- }
- // Process remainder
- if (parts.length == fparts.length) {
- for (var i = 0, cnt = fparts.length; i < cnt; i++) {
- val = parseInt(parts[i], 10);
- part = fparts[i];
- if (isNaN(val)) {
- switch (part) {
- case "MM":
- filtered = $(dates[language].months).filter(
- function () {
- var m = this.slice(0, parts[i].length),
- p = parts[i].slice(0, m.length);
- return m == p;
- }
- );
- val =
- $.inArray(filtered[0], dates[language].months) + 1;
- break;
- case "M":
- filtered = $(dates[language].monthsShort).filter(
- function () {
- var m = this.slice(0, parts[i].length),
- p = parts[i].slice(0, m.length);
- return m == p;
- }
- );
- val =
- $.inArray(
- filtered[0],
- dates[language].monthsShort
- ) + 1;
- break;
- }
- }
- parsed[part] = val;
- }
- for (var i = 0, s; i < setters_order.length; i++) {
- s = setters_order[i];
- if (s in parsed && !isNaN(parsed[s]))
- setters_map[s](date, parsed[s]);
- }
- }
- return date;
- },
- formatDate: function (date, format, language) {
- var val = {
- d: date.getUTCDate(),
- D: dates[language].daysShort[date.getUTCDay()],
- DD: dates[language].days[date.getUTCDay()],
- m: date.getUTCMonth() + 1,
- M: dates[language].monthsShort[date.getUTCMonth()],
- MM: dates[language].months[date.getUTCMonth()],
- yy: date.getUTCFullYear().toString().substring(2),
- yyyy: date.getUTCFullYear(),
- };
- val.dd = (val.d < 10 ? "0" : "") + val.d;
- val.mm = (val.m < 10 ? "0" : "") + val.m;
- var date = [],
- seps = $.extend([], format.separators);
- for (var i = 0, cnt = format.parts.length; i < cnt; i++) {
- if (seps.length) date.push(seps.shift());
- date.push(val[format.parts[i]]);
- }
- return date.join("");
- },
- headTemplate:
- "" +
- "" +
- ' ' +
- ' ' +
- ' ' +
- " " +
- " ",
- contTemplate: ' ',
- footTemplate: ' ',
- };
- DPGlobal.template =
- '' +
- '
' +
- '
' +
- DPGlobal.headTemplate +
- " " +
- DPGlobal.footTemplate +
- "
" +
- "
" +
- '
' +
- '
' +
- DPGlobal.headTemplate +
- DPGlobal.contTemplate +
- DPGlobal.footTemplate +
- "
" +
- "
" +
- '
' +
- '
' +
- DPGlobal.headTemplate +
- DPGlobal.contTemplate +
- DPGlobal.footTemplate +
- "
" +
- "
" +
- "
";
-
- $.fn.datepicker.DPGlobal = DPGlobal;
-})(window.jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/datepicker.css b/pms/static/src/js/widgets/datepicker/datepicker.css
deleted file mode 100644
index 52af922532..0000000000
--- a/pms/static/src/js/widgets/datepicker/datepicker.css
+++ /dev/null
@@ -1,278 +0,0 @@
-.datepicker {
- padding: 4px;
- margin-top: 1px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- direction: ltr;
-}
-.datepicker-inline {
- width: 220px;
-}
-.datepicker.datepicker-rtl {
- direction: rtl;
-}
-.datepicker.datepicker-rtl table tr td span {
- float: right;
-}
-.datepicker-dropdown {
- top: 0;
- left: 0;
-}
-.datepicker-dropdown:before {
- content: "";
- display: inline-block;
- border-left: 7px solid transparent;
- border-right: 7px solid transparent;
- border-bottom: 7px solid #ccc;
- border-bottom-color: rgba(0, 0, 0, 0.2);
- position: absolute;
- top: -7px;
- left: 6px;
-}
-.datepicker-dropdown:after {
- content: "";
- display: inline-block;
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- border-bottom: 6px solid #ffffff;
- position: absolute;
- top: -6px;
- left: 7px;
-}
-.datepicker > div {
- display: none;
-}
-.datepicker.days div.datepicker-days {
- display: block;
-}
-.datepicker.months div.datepicker-months {
- display: block;
-}
-.datepicker.years div.datepicker-years {
- display: block;
-}
-.datepicker table {
- margin: 0;
-}
-.datepicker td,
-.datepicker th {
- text-align: center;
- width: 20px;
- height: 20px;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- border: none;
-}
-.table-striped .datepicker table tr td,
-.table-striped .datepicker table tr th {
- background-color: transparent;
-}
-.datepicker table tr td.day:hover {
- background: #eeeeee;
- cursor: pointer;
-}
-.datepicker table tr td.old,
-.datepicker table tr td.new {
- color: #999999;
-}
-.datepicker table tr td.disabled,
-.datepicker table tr td.disabled:hover {
- background: none;
- color: #999999;
- cursor: default;
-}
-.datepicker table tr td.today,
-.datepicker table tr td.today:hover,
-.datepicker table tr td.today.disabled,
-.datepicker table tr td.today.disabled:hover {
- background-color: #fde19a;
- background-image: -moz-linear-gradient(top, #fdd49a, #fdf59a);
- background-image: -ms-linear-gradient(top, #fdd49a, #fdf59a);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fdd49a), to(#fdf59a));
- background-image: -webkit-linear-gradient(top, #fdd49a, #fdf59a);
- background-image: -o-linear-gradient(top, #fdd49a, #fdf59a);
- background-image: linear-gradient(top, #fdd49a, #fdf59a);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fdd49a', endColorstr='#fdf59a', GradientType=0);
- border-color: #fdf59a #fdf59a #fbed50;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
-}
-.datepicker table tr td.today:hover,
-.datepicker table tr td.today:hover:hover,
-.datepicker table tr td.today.disabled:hover,
-.datepicker table tr td.today.disabled:hover:hover,
-.datepicker table tr td.today:active,
-.datepicker table tr td.today:hover:active,
-.datepicker table tr td.today.disabled:active,
-.datepicker table tr td.today.disabled:hover:active,
-.datepicker table tr td.today.active,
-.datepicker table tr td.today:hover.active,
-.datepicker table tr td.today.disabled.active,
-.datepicker table tr td.today.disabled:hover.active,
-.datepicker table tr td.today.disabled,
-.datepicker table tr td.today:hover.disabled,
-.datepicker table tr td.today.disabled.disabled,
-.datepicker table tr td.today.disabled:hover.disabled,
-.datepicker table tr td.today[disabled],
-.datepicker table tr td.today:hover[disabled],
-.datepicker table tr td.today.disabled[disabled],
-.datepicker table tr td.today.disabled:hover[disabled] {
- background-color: #fdf59a;
-}
-.datepicker table tr td.today:active,
-.datepicker table tr td.today:hover:active,
-.datepicker table tr td.today.disabled:active,
-.datepicker table tr td.today.disabled:hover:active,
-.datepicker table tr td.today.active,
-.datepicker table tr td.today:hover.active,
-.datepicker table tr td.today.disabled.active,
-.datepicker table tr td.today.disabled:hover.active {
- background-color: #fbf069 \9;
-}
-.datepicker table tr td.active,
-.datepicker table tr td.active:hover,
-.datepicker table tr td.active.disabled,
-.datepicker table tr td.active.disabled:hover {
- background-color: #006dcc;
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
- background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
- background-image: linear-gradient(top, #0088cc, #0044cc);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
- border-color: #0044cc #0044cc #002a80;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
- color: #fff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-}
-.datepicker table tr td.active:hover,
-.datepicker table tr td.active:hover:hover,
-.datepicker table tr td.active.disabled:hover,
-.datepicker table tr td.active.disabled:hover:hover,
-.datepicker table tr td.active:active,
-.datepicker table tr td.active:hover:active,
-.datepicker table tr td.active.disabled:active,
-.datepicker table tr td.active.disabled:hover:active,
-.datepicker table tr td.active.active,
-.datepicker table tr td.active:hover.active,
-.datepicker table tr td.active.disabled.active,
-.datepicker table tr td.active.disabled:hover.active,
-.datepicker table tr td.active.disabled,
-.datepicker table tr td.active:hover.disabled,
-.datepicker table tr td.active.disabled.disabled,
-.datepicker table tr td.active.disabled:hover.disabled,
-.datepicker table tr td.active[disabled],
-.datepicker table tr td.active:hover[disabled],
-.datepicker table tr td.active.disabled[disabled],
-.datepicker table tr td.active.disabled:hover[disabled] {
- background-color: #0044cc;
-}
-.datepicker table tr td.active:active,
-.datepicker table tr td.active:hover:active,
-.datepicker table tr td.active.disabled:active,
-.datepicker table tr td.active.disabled:hover:active,
-.datepicker table tr td.active.active,
-.datepicker table tr td.active:hover.active,
-.datepicker table tr td.active.disabled.active,
-.datepicker table tr td.active.disabled:hover.active {
- background-color: #003399 \9;
-}
-.datepicker table tr td span {
- display: block;
- width: 23%;
- height: 54px;
- line-height: 54px;
- float: left;
- margin: 1%;
- cursor: pointer;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
-}
-.datepicker table tr td span:hover {
- background: #eeeeee;
-}
-.datepicker table tr td span.disabled,
-.datepicker table tr td span.disabled:hover {
- background: none;
- color: #999999;
- cursor: default;
-}
-.datepicker table tr td span.active,
-.datepicker table tr td span.active:hover,
-.datepicker table tr td span.active.disabled,
-.datepicker table tr td span.active.disabled:hover {
- background-color: #006dcc;
- background-image: -moz-linear-gradient(top, #0088cc, #0044cc);
- background-image: -ms-linear-gradient(top, #0088cc, #0044cc);
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc));
- background-image: -webkit-linear-gradient(top, #0088cc, #0044cc);
- background-image: -o-linear-gradient(top, #0088cc, #0044cc);
- background-image: linear-gradient(top, #0088cc, #0044cc);
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0);
- border-color: #0044cc #0044cc #002a80;
- border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
- filter: progid:DXImageTransform.Microsoft.gradient(enabled=false);
- color: #fff;
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
-}
-.datepicker table tr td span.active:hover,
-.datepicker table tr td span.active:hover:hover,
-.datepicker table tr td span.active.disabled:hover,
-.datepicker table tr td span.active.disabled:hover:hover,
-.datepicker table tr td span.active:active,
-.datepicker table tr td span.active:hover:active,
-.datepicker table tr td span.active.disabled:active,
-.datepicker table tr td span.active.disabled:hover:active,
-.datepicker table tr td span.active.active,
-.datepicker table tr td span.active:hover.active,
-.datepicker table tr td span.active.disabled.active,
-.datepicker table tr td span.active.disabled:hover.active,
-.datepicker table tr td span.active.disabled,
-.datepicker table tr td span.active:hover.disabled,
-.datepicker table tr td span.active.disabled.disabled,
-.datepicker table tr td span.active.disabled:hover.disabled,
-.datepicker table tr td span.active[disabled],
-.datepicker table tr td span.active:hover[disabled],
-.datepicker table tr td span.active.disabled[disabled],
-.datepicker table tr td span.active.disabled:hover[disabled] {
- background-color: #0044cc;
-}
-.datepicker table tr td span.active:active,
-.datepicker table tr td span.active:hover:active,
-.datepicker table tr td span.active.disabled:active,
-.datepicker table tr td span.active.disabled:hover:active,
-.datepicker table tr td span.active.active,
-.datepicker table tr td span.active:hover.active,
-.datepicker table tr td span.active.disabled.active,
-.datepicker table tr td span.active.disabled:hover.active {
- background-color: #003399 \9;
-}
-.datepicker table tr td span.old {
- color: #999999;
-}
-.datepicker th.switch {
- width: 145px;
-}
-.datepicker thead tr:first-child th,
-.datepicker tfoot tr:first-child th {
- cursor: pointer;
-}
-.datepicker thead tr:first-child th:hover,
-.datepicker tfoot tr:first-child th:hover {
- background: #eeeeee;
-}
-.input-append.date .add-on i,
-.input-prepend.date .add-on i {
- display: block;
- cursor: pointer;
- width: 16px;
- height: 16px;
-}
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.bg.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.bg.js
deleted file mode 100644
index 1c30b8258f..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.bg.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Bulgarian translation for bootstrap-datepicker
- * Apostol Apostolov
- */
-(function ($) {
- $.fn.datepicker.dates.bg = {
- days: [
- "Неделя",
- "Понеделник",
- "Вторник",
- "Сряда",
- "Четвъртък",
- "Петък",
- "Събота",
- "Неделя",
- ],
- daysShort: ["Нед", "Пон", "Вто", "Сря", "Чет", "Пет", "Съб", "Нед"],
- daysMin: ["Н", "П", "В", "С", "Ч", "П", "С", "Н"],
- months: [
- "Януари",
- "Февруари",
- "Март",
- "Април",
- "Май",
- "Юни",
- "Юли",
- "Август",
- "Септември",
- "Октомври",
- "Ноември",
- "Декември",
- ],
- monthsShort: [
- "Ян",
- "Фев",
- "Мар",
- "Апр",
- "Май",
- "Юни",
- "Юли",
- "Авг",
- "Сеп",
- "Окт",
- "Ное",
- "Дек",
- ],
- today: "днес",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ca.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ca.js
deleted file mode 100644
index 2597513200..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ca.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Catalan translation for bootstrap-datepicker
- * J. Garcia
- */
-(function ($) {
- $.fn.datepicker.dates.ca = {
- days: [
- "Diumenge",
- "Dilluns",
- "Dimarts",
- "Dimecres",
- "Dijous",
- "Divendres",
- "Dissabte",
- "Diumenge",
- ],
- daysShort: ["Diu", "Dil", "Dmt", "Dmc", "Dij", "Div", "Dis", "Diu"],
- daysMin: ["dg", "dl", "dt", "dc", "dj", "dv", "ds", "dg"],
- months: [
- "Gener",
- "Febrer",
- "Març",
- "Abril",
- "Maig",
- "Juny",
- "Juliol",
- "Agost",
- "Setembre",
- "Octubre",
- "Novembre",
- "Desembre",
- ],
- monthsShort: [
- "Gen",
- "Feb",
- "Mar",
- "Abr",
- "Mai",
- "Jun",
- "Jul",
- "Ago",
- "Set",
- "Oct",
- "Nov",
- "Des",
- ],
- today: "Avui",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.cs.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.cs.js
deleted file mode 100644
index 70c96475c4..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.cs.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Czech translation for bootstrap-datepicker
- * Matěj Koubík
- * Fixes by Michal Remiš
- */
-(function ($) {
- $.fn.datepicker.dates.cs = {
- days: [
- "Neděle",
- "Pondělí",
- "Úterý",
- "Středa",
- "Čtvrtek",
- "Pátek",
- "Sobota",
- "Neděle",
- ],
- daysShort: ["Ned", "Pon", "Úte", "Stř", "Čtv", "Pát", "Sob", "Ned"],
- daysMin: ["Ne", "Po", "Út", "St", "Čt", "Pá", "So", "Ne"],
- months: [
- "Leden",
- "Únor",
- "Březen",
- "Duben",
- "Květen",
- "Červen",
- "Červenec",
- "Srpen",
- "Září",
- "Říjen",
- "Listopad",
- "Prosinec",
- ],
- monthsShort: [
- "Led",
- "Úno",
- "Bře",
- "Dub",
- "Kvě",
- "Čer",
- "Čnc",
- "Srp",
- "Zář",
- "Říj",
- "Lis",
- "Pro",
- ],
- today: "Dnes",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.da.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.da.js
deleted file mode 100644
index 90d1338bf7..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.da.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Danish translation for bootstrap-datepicker
- * Christian Pedersen
- */
-(function ($) {
- $.fn.datepicker.dates.da = {
- days: [
- "Søndag",
- "Mandag",
- "Tirsdag",
- "Onsdag",
- "Torsdag",
- "Fredag",
- "Lørdag",
- "Søndag",
- ],
- daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"],
- daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"],
- months: [
- "Januar",
- "Februar",
- "Marts",
- "April",
- "Maj",
- "Juni",
- "Juli",
- "August",
- "September",
- "Oktober",
- "November",
- "December",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Maj",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Okt",
- "Nov",
- "Dec",
- ],
- today: "I Dag",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.de.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.de.js
deleted file mode 100644
index d7ac75124c..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.de.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * German translation for bootstrap-datepicker
- * Sam Zurcher
- */
-(function ($) {
- $.fn.datepicker.dates.de = {
- days: [
- "Sonntag",
- "Montag",
- "Dienstag",
- "Mittwoch",
- "Donnerstag",
- "Freitag",
- "Samstag",
- "Sonntag",
- ],
- daysShort: ["Son", "Mon", "Die", "Mit", "Don", "Fre", "Sam", "Son"],
- daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],
- months: [
- "Januar",
- "Februar",
- "März",
- "April",
- "Mai",
- "Juni",
- "Juli",
- "August",
- "September",
- "Oktober",
- "November",
- "Dezember",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mär",
- "Apr",
- "Mai",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Okt",
- "Nov",
- "Dez",
- ],
- today: "Heute",
- weekStart: 1,
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.el.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.el.js
deleted file mode 100644
index 9f0e3e844d..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.el.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Greek translation for bootstrap-datepicker
- */
-(function ($) {
- $.fn.datepicker.dates.el = {
- days: [
- "Κυριακή",
- "Δευτέρα",
- "Τρίτη",
- "Τετάρτη",
- "Πέμπτη",
- "Παρασκευή",
- "Σάββατο",
- "Κυριακή",
- ],
- daysShort: ["Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ", "Κυρ"],
- daysMin: ["Κυ", "Δε", "Τρ", "Τε", "Πε", "Πα", "Σα", "Κυ"],
- months: [
- "Ιανουάριος",
- "Φεβρουάριος",
- "Μάρτιος",
- "Απρίλιος",
- "Μάιος",
- "Ιούνιος",
- "Ιούλιος",
- "Αύγουστος",
- "Σεπτέμβριος",
- "Οκτώβριος",
- "Νοέμβριος",
- "Δεκέμβριος",
- ],
- monthsShort: [
- "Ιαν",
- "Φεβ",
- "Μαρ",
- "Απρ",
- "Μάι",
- "Ιουν",
- "Ιουλ",
- "Αυγ",
- "Σεπ",
- "Οκτ",
- "Νοε",
- "Δεκ",
- ],
- today: "Σήμερα",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.es.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.es.js
deleted file mode 100644
index eda5d80fe7..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.es.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Spanish translation for bootstrap-datepicker
- * Bruno Bonamin
- */
-(function ($) {
- $.fn.datepicker.dates.es = {
- days: [
- "Domingo",
- "Lunes",
- "Martes",
- "Miércoles",
- "Jueves",
- "Viernes",
- "Sábado",
- "Domingo",
- ],
- daysShort: ["Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb", "Dom"],
- daysMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa", "Do"],
- months: [
- "Enero",
- "Febrero",
- "Marzo",
- "Abril",
- "Mayo",
- "Junio",
- "Julio",
- "Agosto",
- "Septiembre",
- "Octubre",
- "Noviembre",
- "Diciembre",
- ],
- monthsShort: [
- "Ene",
- "Feb",
- "Mar",
- "Abr",
- "May",
- "Jun",
- "Jul",
- "Ago",
- "Sep",
- "Oct",
- "Nov",
- "Dic",
- ],
- today: "Hoy",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fi.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fi.js
deleted file mode 100644
index 5c8e7e96a5..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fi.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Finnish translation for bootstrap-datepicker
- * Jaakko Salonen
- */
-(function ($) {
- $.fn.datepicker.dates.fi = {
- days: [
- "sunnuntai",
- "maanantai",
- "tiistai",
- "keskiviikko",
- "torstai",
- "perjantai",
- "lauantai",
- "sunnuntai",
- ],
- daysShort: ["sun", "maa", "tii", "kes", "tor", "per", "lau", "sun"],
- daysMin: ["su", "ma", "ti", "ke", "to", "pe", "la", "su"],
- months: [
- "tammikuu",
- "helmikuu",
- "maaliskuu",
- "huhtikuu",
- "toukokuu",
- "kesäkuu",
- "heinäkuu",
- "elokuu",
- "syyskuu",
- "lokakuu",
- "marraskuu",
- "joulukuu",
- ],
- monthsShort: [
- "tam",
- "hel",
- "maa",
- "huh",
- "tou",
- "kes",
- "hei",
- "elo",
- "syy",
- "lok",
- "mar",
- "jou",
- ],
- today: "tänään",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fr.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fr.js
deleted file mode 100644
index a604cbd265..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.fr.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * French translation for bootstrap-datepicker
- * Nico Mollet
- */
-(function ($) {
- $.fn.datepicker.dates.fr = {
- days: [
- "Dimanche",
- "Lundi",
- "Mardi",
- "Mercredi",
- "Jeudi",
- "Vendredi",
- "Samedi",
- "Dimanche",
- ],
- daysShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam", "Dim"],
- daysMin: ["D", "L", "Ma", "Me", "J", "V", "S", "D"],
- months: [
- "Janvier",
- "Février",
- "Mars",
- "Avril",
- "Mai",
- "Juin",
- "Juillet",
- "Août",
- "Septembre",
- "Octobre",
- "Novembre",
- "Décembre",
- ],
- monthsShort: [
- "Jan",
- "Fev",
- "Mar",
- "Avr",
- "Mai",
- "Jui",
- "Jul",
- "Aou",
- "Sep",
- "Oct",
- "Nov",
- "Dec",
- ],
- today: "Aujourd'hui",
- weekStart: 1,
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.he.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.he.js
deleted file mode 100644
index 826301f7ad..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.he.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Hebrew translation for bootstrap-datepicker
- * Sagie Maoz
- */
-(function ($) {
- $.fn.datepicker.dates.he = {
- days: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"],
- daysShort: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"],
- daysMin: ["א", "ב", "ג", "ד", "ה", "ו", "ש", "א"],
- months: [
- "ינואר",
- "פברואר",
- "מרץ",
- "אפריל",
- "מאי",
- "יוני",
- "יולי",
- "אוגוסט",
- "ספטמבר",
- "אוקטובר",
- "נובמבר",
- "דצמבר",
- ],
- monthsShort: [
- "ינו",
- "פבר",
- "מרץ",
- "אפר",
- "מאי",
- "יונ",
- "יול",
- "אוג",
- "ספט",
- "אוק",
- "נוב",
- "דצמ",
- ],
- today: "היום",
- rtl: true,
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.hr.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.hr.js
deleted file mode 100644
index 1e0b2efa81..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.hr.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Croatian localisation
- */
-(function ($) {
- $.fn.datepicker.dates.hr = {
- days: [
- "Nedjelja",
- "Ponedjelja",
- "Utorak",
- "Srijeda",
- "Četrtak",
- "Petak",
- "Subota",
- "Nedjelja",
- ],
- daysShort: ["Ned", "Pon", "Uto", "Srr", "Čet", "Pet", "Sub", "Ned"],
- daysMin: ["Ne", "Po", "Ut", "Sr", "Če", "Pe", "Su", "Ne"],
- months: [
- "Siječanj",
- "Veljača",
- "Ožujak",
- "Travanj",
- "Svibanj",
- "Lipanj",
- "Srpanj",
- "Kolovoz",
- "Rujan",
- "Listopad",
- "Studeni",
- "Prosinac",
- ],
- monthsShort: [
- "Sije",
- "Velj",
- "Ožu",
- "Tra",
- "Svi",
- "Lip",
- "Jul",
- "Kol",
- "Ruj",
- "Lis",
- "Stu",
- "Pro",
- ],
- today: "Danas",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.id.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.id.js
deleted file mode 100644
index e8f0e5fd26..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.id.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Bahasa translation for bootstrap-datepicker
- * Azwar Akbar
- */
-(function ($) {
- $.fn.datepicker.dates.id = {
- days: [
- "Minggu",
- "Senin",
- "Selasa",
- "Rabu",
- "Kamis",
- "Jumat",
- "Sabtu",
- "Minggu",
- ],
- daysShort: ["Mgu", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab", "Mgu"],
- daysMin: ["Mg", "Sn", "Sl", "Ra", "Ka", "Ju", "Sa", "Mg"],
- months: [
- "Januari",
- "Februari",
- "Maret",
- "April",
- "Mei",
- "Juni",
- "Juli",
- "Agustus",
- "September",
- "Oktober",
- "November",
- "Desember",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Mei",
- "Jun",
- "Jul",
- "Ags",
- "Sep",
- "Okt",
- "Nov",
- "Des",
- ],
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.is.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.is.js
deleted file mode 100644
index 60b5447dd0..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.is.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Icelandic translation for bootstrap-datepicker
- * Hinrik Örn Sigurðsson
- */
-(function ($) {
- $.fn.datepicker.dates.is = {
- days: [
- "Sunnudagur",
- "Mánudagur",
- "Þriðjudagur",
- "Miðvikudagur",
- "Fimmtudagur",
- "Föstudagur",
- "Laugardagur",
- "Sunnudagur",
- ],
- daysShort: ["Sun", "Mán", "Þri", "Mið", "Fim", "Fös", "Lau", "Sun"],
- daysMin: ["Su", "Má", "Þr", "Mi", "Fi", "Fö", "La", "Su"],
- months: [
- "Janúar",
- "Febrúar",
- "Mars",
- "Apríl",
- "Maí",
- "Júní",
- "Júlí",
- "Ágúst",
- "September",
- "Október",
- "Nóvember",
- "Desember",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Maí",
- "Jún",
- "Júl",
- "Ágú",
- "Sep",
- "Okt",
- "Nóv",
- "Des",
- ],
- today: "Í Dag",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.it.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.it.js
deleted file mode 100644
index 6f97d68560..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.it.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Italian translation for bootstrap-datepicker
- * Enrico Rubboli
- */
-(function ($) {
- $.fn.datepicker.dates.it = {
- days: [
- "Domenica",
- "Lunedi",
- "Martedi",
- "Mercoledi",
- "Giovedi",
- "Venerdi",
- "Sabato",
- "Domenica",
- ],
- daysShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab", "Dom"],
- daysMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa", "Do"],
- months: [
- "Gennaio",
- "Febbraio",
- "Marzo",
- "Aprile",
- "Maggio",
- "Giugno",
- "Luglio",
- "Agosto",
- "Settembre",
- "Ottobre",
- "Novembre",
- "Dicembre",
- ],
- monthsShort: [
- "Gen",
- "Feb",
- "Mar",
- "Apr",
- "Mag",
- "Giu",
- "Lug",
- "Ago",
- "Set",
- "Ott",
- "Nov",
- "Dic",
- ],
- today: "Oggi",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ja.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ja.js
deleted file mode 100644
index 28661ef627..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ja.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Japanese translation for bootstrap-datepicker
- * Norio Suzuki
- */
-(function ($) {
- $.fn.datepicker.dates.ja = {
- days: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜", "日曜"],
- daysShort: ["日", "月", "火", "水", "木", "金", "土", "日"],
- daysMin: ["日", "月", "火", "水", "木", "金", "土", "日"],
- months: [
- "1月",
- "2月",
- "3月",
- "4月",
- "5月",
- "6月",
- "7月",
- "8月",
- "9月",
- "10月",
- "11月",
- "12月",
- ],
- monthsShort: [
- "1月",
- "2月",
- "3月",
- "4月",
- "5月",
- "6月",
- "7月",
- "8月",
- "9月",
- "10月",
- "11月",
- "12月",
- ],
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.kr.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.kr.js
deleted file mode 100644
index 50e7d119e0..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.kr.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Korean translation for bootstrap-datepicker
- * Gu Youn
- */
-(function ($) {
- $.fn.datepicker.dates.kr = {
- days: [
- "일요일",
- "월요일",
- "화요일",
- "수요일",
- "목요일",
- "금요일",
- "토요일",
- "일요일",
- ],
- daysShort: ["일", "월", "화", "수", "목", "금", "토", "일"],
- daysMin: ["일", "월", "화", "수", "목", "금", "토", "일"],
- months: [
- "1월",
- "2월",
- "3월",
- "4월",
- "5월",
- "6월",
- "7월",
- "8월",
- "9월",
- "10월",
- "11월",
- "12월",
- ],
- monthsShort: [
- "1월",
- "2월",
- "3월",
- "4월",
- "5월",
- "6월",
- "7월",
- "8월",
- "9월",
- "10월",
- "11월",
- "12월",
- ],
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lt.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lt.js
deleted file mode 100644
index 63c65c9a4e..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lt.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Lithuanian translation for bootstrap-datepicker
- * Šarūnas Gliebus
- */
-
-(function ($) {
- $.fn.datepicker.dates.lt = {
- days: [
- "Sekmadienis",
- "Pirmadienis",
- "Antradienis",
- "Trečiadienis",
- "Ketvirtadienis",
- "Penktadienis",
- "Šeštadienis",
- "Sekmadienis",
- ],
- daysShort: ["S", "Pr", "A", "T", "K", "Pn", "Š", "S"],
- daysMin: ["Sk", "Pr", "An", "Tr", "Ke", "Pn", "Št", "Sk"],
- months: [
- "Sausis",
- "Vasaris",
- "Kovas",
- "Balandis",
- "Gegužė",
- "Birželis",
- "Liepa",
- "Rugpjūtis",
- "Rugsėjis",
- "Spalis",
- "Lapkritis",
- "Gruodis",
- ],
- monthsShort: [
- "Sau",
- "Vas",
- "Kov",
- "Bal",
- "Geg",
- "Bir",
- "Lie",
- "Rugp",
- "Rugs",
- "Spa",
- "Lap",
- "Gru",
- ],
- today: "Šiandien",
- weekStart: 1,
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lv.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lv.js
deleted file mode 100644
index 464680fe66..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.lv.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Latvian translation for bootstrap-datepicker
- * Artis Avotins
- */
-
-(function ($) {
- $.fn.datepicker.dates.lv = {
- days: [
- "Svētdiena",
- "Pirmdiena",
- "Otrdiena",
- "Trešdiena",
- "Ceturtdiena",
- "Piektdiena",
- "Sestdiena",
- "Svētdiena",
- ],
- daysShort: ["Sv", "P", "O", "T", "C", "Pk", "S", "Sv"],
- daysMin: ["Sv", "Pr", "Ot", "Tr", "Ce", "Pk", "St", "Sv"],
- months: [
- "Janvāris",
- "Februāris",
- "Marts",
- "Aprīlis",
- "Maijs",
- "Jūnijs",
- "Jūlijs",
- "Augusts",
- "Septembris",
- "Oktobris",
- "Novembris",
- "Decembris",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Mai",
- "Jūn",
- "Jūl",
- "Aug",
- "Sep",
- "Okt",
- "Nov",
- "Dec.",
- ],
- today: "Šodien",
- weekStart: 1,
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ms.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ms.js
deleted file mode 100644
index 4b5ba55247..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ms.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * Malay translation for bootstrap-datepicker
- * Ateman Faiz
- */
-(function ($) {
- $.fn.datepicker.dates.ms = {
- days: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu", "Ahad"],
- daysShort: ["Aha", "Isn", "Sel", "Rab", "Kha", "Jum", "Sab", "Aha"],
- daysMin: ["Ah", "Is", "Se", "Ra", "Kh", "Ju", "Sa", "Ah"],
- months: [
- "Januari",
- "Februari",
- "Mac",
- "April",
- "Mei",
- "Jun",
- "Julai",
- "Ogos",
- "September",
- "Oktober",
- "November",
- "Disember",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Mei",
- "Jun",
- "Jul",
- "Ogo",
- "Sep",
- "Okt",
- "Nov",
- "Dis",
- ],
- today: "Hari Ini",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nb.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nb.js
deleted file mode 100644
index 146fb838a0..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nb.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Norwegian (bokmål) translation for bootstrap-datepicker
- * Fredrik Sundmyhr
- */
-(function ($) {
- $.fn.datepicker.dates.nb = {
- days: [
- "Søndag",
- "Mandag",
- "Tirsdag",
- "Onsdag",
- "Torsdag",
- "Fredag",
- "Lørdag",
- "Søndag",
- ],
- daysShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør", "Søn"],
- daysMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø", "Sø"],
- months: [
- "Januar",
- "Februar",
- "Mars",
- "April",
- "Mai",
- "Juni",
- "Juli",
- "August",
- "September",
- "Oktober",
- "November",
- "Desember",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Mai",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Okt",
- "Nov",
- "Des",
- ],
- today: "I Dag",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nl.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nl.js
deleted file mode 100644
index 4151a57a8b..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.nl.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Dutch translation for bootstrap-datepicker
- * Reinier Goltstein
- */
-(function ($) {
- $.fn.datepicker.dates.nl = {
- days: [
- "Zondag",
- "Maandag",
- "Dinsdag",
- "Woensdag",
- "Donderdag",
- "Vrijdag",
- "Zaterdag",
- "Zondag",
- ],
- daysShort: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"],
- daysMin: ["Zo", "Ma", "Di", "Wo", "Do", "Vr", "Za", "Zo"],
- months: [
- "Januari",
- "Februari",
- "Maart",
- "April",
- "Mei",
- "Juni",
- "Juli",
- "Augustus",
- "September",
- "Oktober",
- "November",
- "December",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mrt",
- "Apr",
- "Mei",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Okt",
- "Nov",
- "Dec",
- ],
- today: "Vandaag",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pl.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pl.js
deleted file mode 100644
index 4bce1fd36d..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pl.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Polish translation for bootstrap-datepicker
- * Robert
- */
-(function ($) {
- $.fn.datepicker.dates.pl = {
- days: [
- "Niedziela",
- "Poniedziałek",
- "Wtorek",
- "Środa",
- "Czwartek",
- "Piątek",
- "Sobota",
- "Niedziela",
- ],
- daysShort: ["Nie", "Pn", "Wt", "Śr", "Czw", "Pt", "So", "Nie"],
- daysMin: ["N", "Pn", "Wt", "Śr", "Cz", "Pt", "So", "N"],
- months: [
- "Styczeń",
- "Luty",
- "Marzec",
- "Kwiecień",
- "Maj",
- "Czerwiec",
- "Lipiec",
- "Sierpień",
- "Wrzesień",
- "Październik",
- "Listopad",
- "Grudzień",
- ],
- monthsShort: [
- "Sty",
- "Lu",
- "Mar",
- "Kw",
- "Maj",
- "Cze",
- "Lip",
- "Sie",
- "Wrz",
- "Pa",
- "Lis",
- "Gru",
- ],
- today: "Dzisiaj",
- weekStart: 1,
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt-BR.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt-BR.js
deleted file mode 100644
index 85fccd2979..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt-BR.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Brazilian translation for bootstrap-datepicker
- * Cauan Cabral
- */
-(function ($) {
- $.fn.datepicker.dates["pt-BR"] = {
- days: [
- "Domingo",
- "Segunda",
- "Terça",
- "Quarta",
- "Quinta",
- "Sexta",
- "Sábado",
- "Domingo",
- ],
- daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"],
- daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],
- months: [
- "Janeiro",
- "Fevereiro",
- "Março",
- "Abril",
- "Maio",
- "Junho",
- "Julho",
- "Agosto",
- "Setembro",
- "Outubro",
- "Novembro",
- "Dezembro",
- ],
- monthsShort: [
- "Jan",
- "Fev",
- "Mar",
- "Abr",
- "Mai",
- "Jun",
- "Jul",
- "Ago",
- "Set",
- "Out",
- "Nov",
- "Dez",
- ],
- today: "Hoje",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt.js
deleted file mode 100644
index 0e33f95641..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.pt.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Portuguese translation for bootstrap-datepicker
- * Original code: Cauan Cabral
- * Tiago Melo
- */
-(function ($) {
- $.fn.datepicker.dates.pt = {
- days: [
- "Domingo",
- "Segunda",
- "Terça",
- "Quarta",
- "Quinta",
- "Sexta",
- "Sábado",
- "Domingo",
- ],
- daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb", "Dom"],
- daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa", "Do"],
- months: [
- "Janeiro",
- "Fevereiro",
- "Março",
- "Abril",
- "Maio",
- "Junho",
- "Julho",
- "Agosto",
- "Setembro",
- "Outubro",
- "Novembro",
- "Dezembro",
- ],
- monthsShort: [
- "Jan",
- "Fev",
- "Mar",
- "Abr",
- "Mai",
- "Jun",
- "Jul",
- "Ago",
- "Set",
- "Out",
- "Nov",
- "Dez",
- ],
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ro.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ro.js
deleted file mode 100644
index eefb0f0675..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ro.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Romanian translation for bootstrap-datepicker
- * Cristian Vasile
- */
-(function ($) {
- $.fn.datepicker.dates.ro = {
- days: [
- "Duminică",
- "Luni",
- "Marţi",
- "Miercuri",
- "Joi",
- "Vineri",
- "Sâmbătă",
- "Duminică",
- ],
- daysShort: ["Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sâm", "Dum"],
- daysMin: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ", "Du"],
- months: [
- "Ianuarie",
- "Februarie",
- "Martie",
- "Aprilie",
- "Mai",
- "Iunie",
- "Iulie",
- "August",
- "Septembrie",
- "Octombrie",
- "Noiembrie",
- "Decembrie",
- ],
- monthsShort: [
- "Ian",
- "Feb",
- "Mar",
- "Apr",
- "Mai",
- "Iun",
- "Iul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec",
- ],
- today: "Astăzi",
- weekStart: 1,
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs-latin.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs-latin.js
deleted file mode 100644
index 6973edc895..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs-latin.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Serbian latin translation for bootstrap-datepicker
- * Bojan Milosavlević
- */
-(function ($) {
- $.fn.datepicker.dates.rs = {
- days: [
- "Nedelja",
- "Ponedeljak",
- "Utorak",
- "Sreda",
- "Četvrtak",
- "Petak",
- "Subota",
- "Nedelja",
- ],
- daysShort: ["Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub", "Ned"],
- daysMin: ["N", "Po", "U", "Sr", "Č", "Pe", "Su", "N"],
- months: [
- "Januar",
- "Februar",
- "Mart",
- "April",
- "Maj",
- "Jun",
- "Jul",
- "Avgust",
- "Septembar",
- "Oktobar",
- "Novembar",
- "Decembar",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Maj",
- "Jun",
- "Jul",
- "Avg",
- "Sep",
- "Okt",
- "Nov",
- "Dec",
- ],
- today: "Danas",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs.js
deleted file mode 100644
index 137fadb40b..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.rs.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Serbian cyrillic translation for bootstrap-datepicker
- * Bojan Milosavlević
- */
-(function ($) {
- $.fn.datepicker.dates.rs = {
- days: [
- "Недеља",
- "Понедељак",
- "Уторак",
- "Среда",
- "Четвртак",
- "Петак",
- "Субота",
- "Недеља",
- ],
- daysShort: ["Нед", "Пон", "Уто", "Сре", "Чет", "Пет", "Суб", "Нед"],
- daysMin: ["Н", "По", "У", "Ср", "Ч", "Пе", "Су", "Н"],
- months: [
- "Јануар",
- "Фебруар",
- "Март",
- "Април",
- "Мај",
- "Јун",
- "Јул",
- "Август",
- "Септембар",
- "Октобар",
- "Новембар",
- "Децембар",
- ],
- monthsShort: [
- "Јан",
- "Феб",
- "Мар",
- "Апр",
- "Мај",
- "Јун",
- "Јул",
- "Авг",
- "Сеп",
- "Окт",
- "Нов",
- "Дец",
- ],
- today: "Данас",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ru.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ru.js
deleted file mode 100644
index 52e0864e62..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.ru.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Russian translation for bootstrap-datepicker
- * Victor Taranenko
- */
-(function ($) {
- $.fn.datepicker.dates.ru = {
- days: [
- "Воскресенье",
- "Понедельник",
- "Вторник",
- "Среда",
- "Четверг",
- "Пятница",
- "Суббота",
- "Воскресенье",
- ],
- daysShort: ["Вск", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Вск"],
- daysMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"],
- months: [
- "Январь",
- "Февраль",
- "Март",
- "Апрель",
- "Май",
- "Июнь",
- "Июль",
- "Август",
- "Сентябрь",
- "Октябрь",
- "Ноябрь",
- "Декабрь",
- ],
- monthsShort: [
- "Янв",
- "Фев",
- "Мар",
- "Апр",
- "Май",
- "Июн",
- "Июл",
- "Авг",
- "Сен",
- "Окт",
- "Ноя",
- "Дек",
- ],
- today: "Сегодня",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sk.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sk.js
deleted file mode 100644
index c3103c6def..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sk.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Slovak translation for bootstrap-datepicker
- * Marek Lichtner
- * Fixes by Michal Remiš
- */
-(function ($) {
- $.fn.datepicker.dates.sk = {
- days: [
- "Nedeľa",
- "Pondelok",
- "Utorok",
- "Streda",
- "Štvrtok",
- "Piatok",
- "Sobota",
- "Nedeľa",
- ],
- daysShort: ["Ned", "Pon", "Uto", "Str", "Štv", "Pia", "Sob", "Ned"],
- daysMin: ["Ne", "Po", "Ut", "St", "Št", "Pia", "So", "Ne"],
- months: [
- "Január",
- "Február",
- "Marec",
- "Apríl",
- "Máj",
- "Jún",
- "Júl",
- "August",
- "September",
- "Október",
- "November",
- "December",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Máj",
- "Jún",
- "Júl",
- "Aug",
- "Sep",
- "Okt",
- "Nov",
- "Dec",
- ],
- today: "Dnes",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sl.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sl.js
deleted file mode 100644
index 7860379afc..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sl.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Slovene translation for bootstrap-datepicker
- * Gregor Rudolf
- */
-(function ($) {
- $.fn.datepicker.dates.sl = {
- days: [
- "Nedelja",
- "Ponedeljek",
- "Torek",
- "Sreda",
- "Četrtek",
- "Petek",
- "Sobota",
- "Nedelja",
- ],
- daysShort: ["Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob", "Ned"],
- daysMin: ["Ne", "Po", "To", "Sr", "Če", "Pe", "So", "Ne"],
- months: [
- "Januar",
- "Februar",
- "Marec",
- "April",
- "Maj",
- "Junij",
- "Julij",
- "Avgust",
- "September",
- "Oktober",
- "November",
- "December",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Maj",
- "Jun",
- "Jul",
- "Avg",
- "Sep",
- "Okt",
- "Nov",
- "Dec",
- ],
- today: "Danes",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sv.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sv.js
deleted file mode 100644
index 7fec76265f..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sv.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Swedish translation for bootstrap-datepicker
- * Patrik Ragnarsson
- */
-(function ($) {
- $.fn.datepicker.dates.sv = {
- days: [
- "Söndag",
- "Måndag",
- "Tisdag",
- "Onsdag",
- "Torsdag",
- "Fredag",
- "Lördag",
- "Söndag",
- ],
- daysShort: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör", "Sön"],
- daysMin: ["Sö", "Må", "Ti", "On", "To", "Fr", "Lö", "Sö"],
- months: [
- "Januari",
- "Februari",
- "Mars",
- "April",
- "Maj",
- "Juni",
- "Juli",
- "Augusti",
- "September",
- "Oktober",
- "November",
- "December",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "Maj",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Okt",
- "Nov",
- "Dec",
- ],
- today: "I Dag",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sw.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sw.js
deleted file mode 100644
index 2b08970d1b..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.sw.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Swahili translation for bootstrap-datepicker
- * Edwin Mugendi
- * Source: http://scriptsource.org/cms/scripts/page.php?item_id=entry_detail&uid=xnfaqyzcku
- */
-(function ($) {
- $.fn.datepicker.dates.sw = {
- days: [
- "Jumapili",
- "Jumatatu",
- "Jumanne",
- "Jumatano",
- "Alhamisi",
- "Ijumaa",
- "Jumamosi",
- "Jumapili",
- ],
- daysShort: ["J2", "J3", "J4", "J5", "Alh", "Ij", "J1", "J2"],
- daysMin: ["2", "3", "4", "5", "A", "I", "1", "2"],
- months: [
- "Januari",
- "Februari",
- "Machi",
- "Aprili",
- "Mei",
- "Juni",
- "Julai",
- "Agosti",
- "Septemba",
- "Oktoba",
- "Novemba",
- "Desemba",
- ],
- monthsShort: [
- "Jan",
- "Feb",
- "Mac",
- "Apr",
- "Mei",
- "Jun",
- "Jul",
- "Ago",
- "Sep",
- "Okt",
- "Nov",
- "Des",
- ],
- today: "Leo",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.th.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.th.js
deleted file mode 100644
index 5aa40b78ac..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.th.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Thai translation for bootstrap-datepicker
- * Suchau Jiraprapot
- */
-(function ($) {
- $.fn.datepicker.dates.th = {
- days: [
- "อาทิตย์",
- "จันทร์",
- "อังคาร",
- "พุธ",
- "พฤหัส",
- "ศุกร์",
- "เสาร์",
- "อาทิตย์",
- ],
- daysShort: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],
- daysMin: ["อา", "จ", "อ", "พ", "พฤ", "ศ", "ส", "อา"],
- months: [
- "มกราคม",
- "กุมภาพันธ์",
- "มีนาคม",
- "เมษายน",
- "พฤษภาคม",
- "มิถุนายน",
- "กรกฎาคม",
- "สิงหาคม",
- "กันยายน",
- "ตุลาคม",
- "พฤศจิกายน",
- "ธันวาคม",
- ],
- monthsShort: [
- "ม.ค.",
- "ก.พ.",
- "มี.ค.",
- "เม.ย.",
- "พ.ค.",
- "มิ.ย.",
- "ก.ค.",
- "ส.ค.",
- "ก.ย.",
- "ต.ค.",
- "พ.ย.",
- "ธ.ค.",
- ],
- today: "วันนี้",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.tr.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.tr.js
deleted file mode 100644
index ceabb07caa..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.tr.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Turkish translation for bootstrap-datepicker
- * Serkan Algur
- */
-(function ($) {
- $.fn.datepicker.dates.tr = {
- days: [
- "Pazar",
- "Pazartesi",
- "Salı",
- "Çarşamba",
- "Perşembe",
- "Cuma",
- "Cumartesi",
- "Pazar",
- ],
- daysShort: ["Pz", "Pzt", "Sal", "Çrş", "Prş", "Cu", "Cts", "Pz"],
- daysMin: ["Pz", "Pzt", "Sa", "Çr", "Pr", "Cu", "Ct", "Pz"],
- months: [
- "Ocak",
- "Şubat",
- "Mart",
- "Nisan",
- "Mayıs",
- "Haziran",
- "Temmuz",
- "Ağustos",
- "Eylül",
- "Ekim",
- "Kasım",
- "Aralık",
- ],
- monthsShort: [
- "Oca",
- "Şub",
- "Mar",
- "Nis",
- "May",
- "Haz",
- "Tem",
- "Ağu",
- "Eyl",
- "Eki",
- "Kas",
- "Ara",
- ],
- today: "Bugün",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.uk.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.uk.js
deleted file mode 100644
index 2fef40c171..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.uk.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Ukrainian translation for bootstrap-datepicker
- * Andrey Vityuk
- */
-(function ($) {
- $.fn.datepicker.dates.uk = {
- days: [
- "Неділя",
- "Понеділок",
- "Вівторок",
- "Середа",
- "Четвер",
- "П'ятниця",
- "Субота",
- "Неділя",
- ],
- daysShort: ["Нед", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Суб", "Нед"],
- daysMin: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб", "Нд"],
- months: [
- "Січень",
- "Лютий",
- "Березень",
- "Квітень",
- "Травень",
- "Червень",
- "Липень",
- "Серпень",
- "Вересень",
- "Жовтень",
- "Листопад",
- "Грудень",
- ],
- monthsShort: [
- "Січ",
- "Лют",
- "Бер",
- "Кві",
- "Тра",
- "Чер",
- "Лип",
- "Сер",
- "Вер",
- "Жов",
- "Лис",
- "Гру",
- ],
- today: "Сьогодні",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-CN.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-CN.js
deleted file mode 100644
index a9e6d6a5c1..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-CN.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Simplified Chinese translation for bootstrap-datepicker
- * Yuan Cheung
- */
-(function ($) {
- $.fn.datepicker.dates["zh-CN"] = {
- days: [
- "星期日",
- "星期一",
- "星期二",
- "星期三",
- "星期四",
- "星期五",
- "星期六",
- "星期日",
- ],
- daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
- daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
- months: [
- "一月",
- "二月",
- "三月",
- "四月",
- "五月",
- "六月",
- "七月",
- "八月",
- "九月",
- "十月",
- "十一月",
- "十二月",
- ],
- monthsShort: [
- "一月",
- "二月",
- "三月",
- "四月",
- "五月",
- "六月",
- "七月",
- "八月",
- "九月",
- "十月",
- "十一月",
- "十二月",
- ],
- today: "今日",
- };
-})(jQuery);
diff --git a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-TW.js b/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-TW.js
deleted file mode 100644
index 0acedd4f4e..0000000000
--- a/pms/static/src/js/widgets/datepicker/locales/bootstrap-datepicker.zh-TW.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * Traditional Chinese translation for bootstrap-datepicker
- * Rung-Sheng Jang
- */
-(function ($) {
- $.fn.datepicker.dates["zh-TW"] = {
- days: [
- "星期日",
- "星期一",
- "星期二",
- "星期三",
- "星期四",
- "星期五",
- "星期六",
- "星期日",
- ],
- daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
- daysMin: ["日", "一", "二", "三", "四", "五", "六", "日"],
- months: [
- "一月",
- "二月",
- "三月",
- "四月",
- "五月",
- "六月",
- "七月",
- "八月",
- "九月",
- "十月",
- "十一月",
- "十二月",
- ],
- monthsShort: [
- "一月",
- "二月",
- "三月",
- "四月",
- "五月",
- "六月",
- "七月",
- "八月",
- "九月",
- "十月",
- "十一月",
- "十二月",
- ],
- };
-})(jQuery);
diff --git a/pms/static/src/xml/reservation_group_button_views.xml b/pms/static/src/xml/reservation_group_button_views.xml
deleted file mode 100644
index 05e713adbc..0000000000
--- a/pms/static/src/xml/reservation_group_button_views.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
-
- Booking Engine
-
-
-
-
diff --git a/pms/tests/common.py b/pms/tests/common.py
index 866ed57faf..8c1fd3a1ea 100644
--- a/pms/tests/common.py
+++ b/pms/tests/common.py
@@ -1,7 +1,7 @@
from odoo.tests import common
-class TestPms(common.SavepointCase):
+class TestPms(common.TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
diff --git a/pms/tests/test_pms_availability_plan_rules.py b/pms/tests/test_pms_availability_plan_rules.py
index 528ad9c364..ebf79c65f8 100644
--- a/pms/tests/test_pms_availability_plan_rules.py
+++ b/pms/tests/test_pms_availability_plan_rules.py
@@ -611,7 +611,7 @@ def test_rule_update_quota_on_create_reservation(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
+ r1.flush_recordset()
with self.assertRaises(
ValidationError,
msg="The quota shouldnt be enough to create a new reservation",
diff --git a/pms/tests/test_pms_booking_engine.py b/pms/tests/test_pms_booking_engine.py
index 2f85382402..97dbe12f7d 100644
--- a/pms/tests/test_pms_booking_engine.py
+++ b/pms/tests/test_pms_booking_engine.py
@@ -138,15 +138,7 @@ def test_price_wizard_correct(self):
]
)
- # set value for room type double
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", num_double_rooms),
- ]
- )
-
- lines_availability_test[0].num_rooms_selected = value
+ lines_availability_test[0].rooms_selected_qty = num_double_rooms
for discount in discounts:
with self.subTest(k=discount):
# ACT
@@ -186,19 +178,18 @@ def test_price_wizard_correct_pricelist_applied(self):
expected_price_total = days * price_today * num_double_rooms
# set pricelist item for current day
- product_tmpl = self.test_room_type_double.product_id.product_tmpl_id
+ product_id = self.test_room_type_double.product_id
self.env["product.pricelist.item"].create(
{
"pricelist_id": self.pricelist1.id,
"date_start_consumption": checkin,
"date_end_consumption": checkin,
"compute_price": "fixed",
- "applied_on": "1_product",
- "product_tmpl_id": product_tmpl.id,
+ "applied_on": "0_product_variant",
"product_id": self.test_room_type_double.product_id.id,
"fixed_price": price_today,
"min_quantity": 0,
- "pms_property_ids": product_tmpl.pms_property_ids.ids,
+ "pms_property_ids": product_id.pms_property_ids.ids,
}
)
@@ -221,16 +212,8 @@ def test_price_wizard_correct_pricelist_applied(self):
]
)
- # set value for room type double
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", num_double_rooms),
- ]
- )
-
# ACT
- lines_availability_test[0].num_rooms_selected = value
+ lines_availability_test[0].rooms_selected_qty = num_double_rooms
# ASSERT
self.assertEqual(
@@ -352,14 +335,7 @@ def test_check_create_folio(self):
("room_type_id.pms_property_ids", "in", self.pms_property1.id),
]
)
- # set one room type double
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", 1),
- ]
- )
- lines_availability_test[0].num_rooms_selected = value
+ lines_availability_test[0].rooms_selected_qty = 1
# ACT
booking_engine.create_folio()
@@ -406,14 +382,7 @@ def test_check_create_reservations(self):
]
)
# set one room type double
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", 2),
- ]
- )
- lines_availability_test[0].num_rooms_selected = value
- lines_availability_test[0].value_num_rooms_selected = 2
+ lines_availability_test[0].rooms_selected_qty = 2
# ACT
booking_engine.create_folio()
@@ -461,14 +430,7 @@ def test_values_folio_created(self):
]
)
# set one room type double
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", 1),
- ]
- )
- lines_availability_test[0].num_rooms_selected = value
- lines_availability_test[0].value_num_rooms_selected = 1
+ lines_availability_test[0].rooms_selected_qty = 1
# ACT
booking_engine.create_folio()
@@ -526,14 +488,7 @@ def test_values_reservation_created(self):
]
)
# set one room type double
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", 1),
- ]
- )
- lines_availability_test[0].num_rooms_selected = value
- lines_availability_test[0].value_num_rooms_selected = 1
+ lines_availability_test[0].rooms_selected_qty = 1
# ACT
booking_engine.create_folio()
@@ -607,14 +562,7 @@ def test_reservation_line_discounts(self):
]
)
# set one room type double
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", 1),
- ]
- )
- lines_availability_test[0].num_rooms_selected = value
- lines_availability_test[0].value_num_rooms_selected = 1
+ lines_availability_test[0].rooms_selected_qty = 1
# ACT
booking_engine.create_folio()
@@ -677,7 +625,7 @@ def test_check_quota_avail(self):
)
room_type_plan_avail = booking_engine.availability_results.filtered(
lambda r: r.room_type_id.id == self.test_room_type_double.id
- ).num_rooms_available
+ ).rooms_available_qty
# ASSERT
@@ -731,7 +679,7 @@ def test_check_min_stay_avail(self):
)
room_type_plan_avail = booking_engine.availability_results.filtered(
lambda r: r.room_type_id.id == self.test_room_type_double.id
- ).num_rooms_available
+ ).rooms_available_qty
# ASSERT
@@ -776,7 +724,7 @@ def test_price_total_with_board_service(self):
"pms_property_id": self.pms_property1.id,
}
)
- # self.board_service_room_type.flush()
+ # self.board_service_room_type.flush_recordset()
# ACT
booking_engine = self.env["pms.booking.engine"].create(
{
@@ -793,14 +741,7 @@ def test_price_total_with_board_service(self):
lambda r: r.room_type_id.id == self.test_room_type_double.id
)
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", 1),
- ]
- )
- lines_availability_test[0].num_rooms_selected = value
- lines_availability_test[0].value_num_rooms_selected = 1
+ lines_availability_test[0].rooms_selected_qty = 1
lines_availability_test[
0
].board_service_room_id = self.board_service_room_type.id
@@ -880,14 +821,7 @@ def _test_board_service_discount(self):
lines_availability_test = booking_engine.availability_results.filtered(
lambda r: r.room_type_id.id == self.test_room_type_double.id
)
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", 1),
- ]
- )
- lines_availability_test[0].num_rooms_selected = value
- lines_availability_test[0].value_num_rooms_selected = 1
+ lines_availability_test[0].rooms_selected_qty = 1
lines_availability_test[
0
].board_service_room_id = self.board_service_room_type.id
@@ -905,91 +839,6 @@ def _test_board_service_discount(self):
"The discount is not correctly established",
)
- def test_check_folio_when_change_selection(self):
- """
- Check, when creating a folio from booking engine,
- if a room type is chosen and then deleted that selection
- isn`t registered on the folio and is properly unselected
- """
- # ARRANGE
- # CREATION OF ROOM TYPE (WITH ROOM TYPE CLASS)
- self.partner_id2 = self.env["res.partner"].create(
- {
- "name": "Brais",
- "mobile": "654665553",
- "email": "braistest@example.com",
- }
- )
- self.test_room_type_triple = self.env["pms.room.type"].create(
- {
- "pms_property_ids": [self.pms_property1.id],
- "name": "Triple Test",
- "default_code": "TRP_Test",
- "class_id": self.room_type_class1.id,
- "list_price": 60.0,
- }
- )
-
- # pms.room
- self.test_room1_triple = self.env["pms.room"].create(
- {
- "pms_property_id": self.pms_property1.id,
- "name": "Triple 301 test",
- "room_type_id": self.test_room_type_triple.id,
- "capacity": 3,
- }
- )
- checkin = fields.date.today()
- checkout = fields.date.today() + datetime.timedelta(days=1)
-
- booking_engine = self.env["pms.booking.engine"].create(
- {
- "start_date": checkin,
- "end_date": checkout,
- "partner_id": self.partner_id2.id,
- "pricelist_id": self.pricelist1.id,
- "pms_property_id": self.pms_property1.id,
- "channel_type_id": self.sale_channel_direct1.id,
- }
- )
-
- lines_availability_test_double = booking_engine.availability_results.filtered(
- lambda r: r.room_type_id.id == self.test_room_type_double.id
- )
- value = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_double.id),
- ("value", "=", 1),
- ]
- )
- lines_availability_test_double[0].num_rooms_selected = value
- lines_availability_test_double[0].value_num_rooms_selected = 1
-
- lines_availability_test_double[0].value_num_rooms_selected = 0
-
- lines_availability_test_triple = booking_engine.availability_results.filtered(
- lambda r: r.room_type_id.id == self.test_room_type_triple.id
- )
- value_triple = self.env["pms.num.rooms.selection"].search(
- [
- ("room_type_id", "=", self.test_room_type_triple.id),
- ("value", "=", 1),
- ]
- )
- lines_availability_test_triple[0].num_rooms_selected = value_triple
- lines_availability_test_triple[0].value_num_rooms_selected = 1
-
- # ACT
- booking_engine.create_folio()
-
- folio = self.env["pms.folio"].search([("partner_id", "=", self.partner_id2.id)])
- # ASSERT
- self.assertEqual(
- len(folio.reservation_ids),
- 1,
- "Reservations of folio are incorrect",
- )
-
def _test_adding_board_services_are_saved_on_lines(self):
checkin = fields.date.today()
checkout = fields.date.today() + datetime.timedelta(days=1)
diff --git a/pms/tests/test_pms_checkin_partner.py b/pms/tests/test_pms_checkin_partner.py
index d7ace36944..6b21a9432c 100644
--- a/pms/tests/test_pms_checkin_partner.py
+++ b/pms/tests/test_pms_checkin_partner.py
@@ -995,7 +995,7 @@ def test_partner_id_numbers_created_from_checkin(self):
}
)
- checkin.flush()
+ checkin.flush_recordset()
# ASSERT
self.assertTrue(
@@ -1025,7 +1025,7 @@ def test_partner_modified_previous_checkin_not_modified(self):
in the previous checkins associated with it
"""
# ARRANGE
- self.checkin1.flush()
+ self.checkin1.flush_recordset()
self.host1.gender = "female"
# ASSERT
self.assertNotEqual(
@@ -1466,43 +1466,6 @@ def test_calculate_passport_expedition_date_from_validity_date_age_gt_30(self):
"Expedition date doesn't correspond with expected expedition date",
)
- def test_calculate_drive_license_expedition_date_from_validity_date_age_lt_70(self):
- """
- Check that the calculate_doc_type_expedition_date_from_validity_date()
- method calculates correctly the expedition_date of an id category Driving
- License when the age is lesser than 70.
- -------------
- We launch the method calculate_doc_type_expedition_date_from_validity_date
- with the parameters doc_type_id DNI, birthdate calculated so that the age
- is = 40 years old and document_date = today + 1 year. The expected
- expedition date has to be doc_date - 10 years
- """
- doc_type_id = self.env["res.partner.id_category"].search([("code", "=", "C")])
- doc_date = fields.date.today() + relativedelta(years=1)
- doc_date_str = str(doc_date)
-
- # age=40 years old
- birthdate = fields.date.today() - relativedelta(years=40)
- birthdate_str = str(birthdate)
-
- # expected_expedition_date = doc_date - 10 years
- expected_exp_date = doc_date - relativedelta(years=10)
- expedition_date = (
- self.checkin1.calculate_doc_type_expedition_date_from_validity_date(
- doc_type_id, doc_date_str, birthdate_str
- )
- )
- date_expedition_date = datetime.date(
- year=expedition_date.year,
- month=expedition_date.month,
- day=expedition_date.day,
- )
- self.assertEqual(
- date_expedition_date,
- expected_exp_date,
- "Expedition date doesn't correspond with expected expedition date",
- )
-
def test_calculate_expedition_date(self):
"""
Check that if the value of the doc_date is less than today,
diff --git a/pms/tests/test_pms_folio.py b/pms/tests/test_pms_folio.py
index f1a1df4d30..98211f903f 100644
--- a/pms/tests/test_pms_folio.py
+++ b/pms/tests/test_pms_folio.py
@@ -4,12 +4,15 @@
from odoo import fields
from odoo.exceptions import ValidationError
-from odoo.tests import Form
+from odoo.tests import Form, tagged
+
+from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from .common import TestPms
-class TestPmsFolio(TestPms):
+@tagged("post_install", "-at_install")
+class TestPmsFolio(TestPms, AccountTestInvoicingCommon):
# SetUp and Common Scenarios methods
@@ -19,7 +22,8 @@ def setUpClass(cls):
- common + room_type_double with 2 rooms (double1 and double2) in pms_property1
"""
super().setUpClass()
-
+ user = cls.env["res.users"].browse(1)
+ cls.env = cls.env(user=user)
# create room type
cls.room_type_double = cls.env["pms.room.type"].create(
{
@@ -27,7 +31,7 @@ def setUpClass(cls):
"name": "Double Test",
"default_code": "DBL_Test",
"class_id": cls.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
# create room
@@ -110,7 +114,7 @@ def create_configuration_accounting_scenario(self):
"name": "Double Test",
"default_code": "Demo_DBL_Test",
"class_id": self.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
# create rooms
diff --git a/pms/tests/test_pms_folio_invoice.py b/pms/tests/test_pms_folio_invoice.py
index ef8387f26e..b29f8b7447 100644
--- a/pms/tests/test_pms_folio_invoice.py
+++ b/pms/tests/test_pms_folio_invoice.py
@@ -1,14 +1,20 @@
import datetime
from odoo import fields
+from odoo.tests import tagged
+
+from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from .common import TestPms
-class TestPmsFolioInvoice(TestPms):
+@tagged("post_install", "-at_install")
+class TestPmsFolioInvoice(TestPms, AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
+ user = cls.env["res.users"].browse(1)
+ cls.env = cls.env(user=user)
# create a room type availability
cls.room_type_availability = cls.env["pms.availability.plan"].create(
{"name": "Availability plan for TEST"}
@@ -41,7 +47,7 @@ def setUpClass(cls):
"name": "Double Test",
"default_code": "DBL_Test",
"class_id": cls.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
@@ -116,7 +122,7 @@ def create_configuration_accounting_scenario(self):
"name": "Double Test",
"default_code": "Demo_DBL_Test",
"class_id": self.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
# create rooms
@@ -168,7 +174,7 @@ def _test_invoice_full_folio(self):
state_expected = "invoiced"
# ACT
r1.folio_id._create_invoices()
- r1.flush()
+ r1.flush_recordset()
# ASSERT
self.assertEqual(
state_expected,
@@ -234,7 +240,7 @@ def test_invoice_partial_folio_diferent_partners(self):
)
# test does not work without invalidating cache
- self.env["account.move"].invalidate_cache()
+ self.env["account.move"].invalidate_recordset()
self.assertNotEqual(
"invoiced",
diff --git a/pms/tests/test_pms_folio_prices.py b/pms/tests/test_pms_folio_prices.py
index da7af4e005..a8bf882b45 100644
--- a/pms/tests/test_pms_folio_prices.py
+++ b/pms/tests/test_pms_folio_prices.py
@@ -1,7 +1,7 @@
-from odoo.tests.common import SavepointCase
+from odoo.tests.common import TransactionCase
-class TestPmsFolioPrice(SavepointCase):
+class TestPmsFolioPrice(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
diff --git a/pms/tests/test_pms_folio_sale_line.py b/pms/tests/test_pms_folio_sale_line.py
index 42261b23b1..4c702b7359 100644
--- a/pms/tests/test_pms_folio_sale_line.py
+++ b/pms/tests/test_pms_folio_sale_line.py
@@ -20,7 +20,7 @@ def setUpClass(cls):
"name": "Double Test",
"default_code": "DBL_Test",
"class_id": cls.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
# create room
@@ -288,7 +288,7 @@ def test_comp_fsl_rooms_one_full_cancel_discount(self):
# ACT
r_test.reservation_line_ids[0].cancel_discount = 100.0
- r_test.flush()
+ r_test.flush_recordset()
# ASSERT
self.assertEqual(
@@ -322,14 +322,14 @@ def test_comp_fsl_rooms_increase_stay(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
previous_folio_sale_line = r_test.folio_id.sale_line_ids.filtered(
lambda x: not x.display_type
)[0]
# ACT
r_test.checkout = datetime.datetime.now() + datetime.timedelta(days=4)
- r_test.flush()
+ r_test.flush_recordset()
# ASSERT
self.assertEqual(
@@ -361,14 +361,14 @@ def test_comp_fsl_rooms_decrease_stay(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
previous_folio_sale_line = r_test.folio_id.sale_line_ids.filtered(
lambda x: not x.display_type
)[0]
# ACT
r_test.checkout = datetime.datetime.now() + datetime.timedelta(days=2)
- r_test.flush()
+ r_test.flush_recordset()
# ASSERT
self.assertEqual(
@@ -403,14 +403,14 @@ def test_comp_fsl_rooms_same_stay(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
previous_folio_sale_line = r_test.folio_id.sale_line_ids.filtered(
lambda x: not x.display_type
)[0]
# ACT
r_test.reservation_line_ids.price = 50
- r_test.flush()
+ r_test.flush_recordset()
# ASSERT
self.assertEqual(
@@ -787,7 +787,7 @@ def test_comp_fsl_res_extra_services_all_same_group(self):
)
# ACT
r_test.service_ids = [(4, self.extra_service.id)]
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
@@ -828,11 +828,11 @@ def test_comp_fsl_res_extra_services_different_prices(self):
}
)
r_test.service_ids = [(4, self.extra_service.id)]
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ACT
r_test.service_ids.service_line_ids[0].price_unit = 44.5
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
@@ -873,11 +873,11 @@ def test_comp_fsl_res_extra_services_different_discount(self):
}
)
r_test.service_ids = [(4, self.extra_service.id)]
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ACT
r_test.service_ids.service_line_ids[0].discount = 44.5
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
@@ -919,11 +919,11 @@ def test_comp_fsl_res_extra_services_different_cancel_discount(self):
}
)
r_test.service_ids = [(4, self.extra_service.id)]
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ACT
r_test.service_ids.service_line_ids[0].cancel_discount = 44.5
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
@@ -963,11 +963,11 @@ def test_comp_fsl_res_extra_services_one_full_cancel_discount(self):
}
)
r_test.service_ids = [(4, self.extra_service.id)]
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ACT
r_test.service_ids.service_line_ids[0].cancel_discount = 100
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
@@ -1008,14 +1008,14 @@ def test_comp_fsl_res_extra_services_increase_stay(self):
}
)
r_test.service_ids = [(4, self.extra_service.id)]
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
previous_folio_extra_service_sale_line = r_test.folio_id.sale_line_ids.filtered(
lambda x: x.service_id == self.extra_service
)[0]
# ACT
r_test.checkout = datetime.datetime.now() + datetime.timedelta(days=4)
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
@@ -1052,14 +1052,14 @@ def test_comp_fsl_res_extra_services_decrease_stay(self):
}
)
r_test.service_ids = [(4, self.extra_service.id)]
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
previous_folio_extra_service_sale_line = r_test.folio_id.sale_line_ids.filtered(
lambda x: x.service_id == self.extra_service
)[0]
# ACT
r_test.checkout = datetime.datetime.now() + datetime.timedelta(days=2)
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
@@ -1103,7 +1103,7 @@ def test_comp_fsl_res_extra_services_same_stay(self):
}
)
r_test.service_ids = [(4, self.extra_service.id)]
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
previous_folio_extra_service_sale_line = r_test.folio_id.sale_line_ids.filtered(
lambda x: x.service_id == self.extra_service
)[0]
@@ -1112,7 +1112,7 @@ def test_comp_fsl_res_extra_services_same_stay(self):
r_test.service_ids.filtered(
lambda x: x.id == self.extra_service.id
).service_line_ids.price_unit = 50
- r_test.service_ids.service_line_ids.flush()
+ r_test.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
@@ -1154,7 +1154,7 @@ def test_comp_fsl_fol_extra_services_one(self):
# ACT
r_test.folio_id.service_ids = [(4, self.extra_service.id)]
- r_test.folio_id.service_ids.service_line_ids.flush()
+ r_test.folio_id.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
@@ -1209,7 +1209,7 @@ def test_comp_fsl_fol_extra_services_two(self):
# ACT
r_test.folio_id.service_ids = [(4, self.extra_service.id)]
r_test.folio_id.service_ids = [(4, extra_service2.id)]
- r_test.folio_id.service_ids.service_line_ids.flush()
+ r_test.folio_id.service_ids.service_line_ids.flush_recordset()
# ASSERT
self.assertEqual(
diff --git a/pms/tests/test_pms_invoice_refund.py b/pms/tests/test_pms_invoice_refund.py
index d532b92194..92166e6270 100644
--- a/pms/tests/test_pms_invoice_refund.py
+++ b/pms/tests/test_pms_invoice_refund.py
@@ -1,11 +1,11 @@
from freezegun import freeze_time
-from odoo.tests.common import SavepointCase
+from odoo.tests.common import TransactionCase
freeze_time("2000-02-02")
-class TestPmsInvoiceRefund(SavepointCase):
+class TestPmsInvoiceRefund(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
diff --git a/pms/tests/test_pms_multiproperty.py b/pms/tests/test_pms_multiproperty.py
index de81767fd4..e6af2ef632 100644
--- a/pms/tests/test_pms_multiproperty.py
+++ b/pms/tests/test_pms_multiproperty.py
@@ -90,7 +90,7 @@ def test_availability_closed_no_room_type_check_property(self):
{
"availability_plan_id": self.availability_plan1.id,
"room_type_id": self.room_type1.id,
- "date": (fields.datetime.today() + datetime.timedelta(days=2)).date(),
+ "date": (fields.datetime.today() + datetime.timedelta(days=1)).date(),
"closed": True,
"pms_property_id": self.pms_property1.id,
}
@@ -101,11 +101,10 @@ def test_availability_closed_no_room_type_check_property(self):
{
"availability_plan_id": self.availability_plan1.id,
"room_type_id": self.room_type1.id,
- "date": (fields.datetime.today() + datetime.timedelta(days=2)).date(),
+ "date": (fields.datetime.today() + datetime.timedelta(days=1)).date(),
"pms_property_id": self.pms_property2.id,
}
)
-
properties = [
{"property": self.pms_property1.id, "value": False},
{"property": self.pms_property2.id, "value": True},
@@ -378,7 +377,7 @@ def test_create_rt_props_gt_bs_props(self):
"name": "Double Test",
"default_code": "DBL_Test",
"class_id": self.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
board_service_test = self.board_service = self.env["pms.board.service"].create(
@@ -425,7 +424,7 @@ def test_create_rt_props_lt_bs_props(self):
"name": "Double Test",
"default_code": "DBL_Test",
"class_id": self.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
board_service1 = self.board_service = self.env["pms.board.service"].create(
@@ -466,7 +465,7 @@ def _test_create_rt_props_eq_bs_props(self):
"name": "Double Test",
"default_code": "DBL_Test",
"class_id": self.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
board_service1 = self.board_service = self.env["pms.board.service"].create(
@@ -505,7 +504,7 @@ def test_create_rt_no_props_and_bs_props(self):
"name": "Double Test",
"default_code": "DBL_Test",
"class_id": self.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
board_service1 = self.board_service = self.env["pms.board.service"].create(
@@ -552,7 +551,7 @@ def test_create_rt_props_and_bs_no_props(self):
"name": "Double Test",
"default_code": "DBL_Test",
"class_id": self.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
board_service1 = self.board_service = self.env["pms.board.service"].create(
@@ -591,7 +590,7 @@ def test_create_rt_no_props_and_bs_no_props(self):
"name": "Double Test",
"default_code": "DBL_Test",
"class_id": self.room_type_class1.id,
- "price": 25,
+ "list_price": 25,
}
)
board_service1 = self.board_service = self.env["pms.board.service"].create(
diff --git a/pms/tests/test_pms_payment.py b/pms/tests/test_pms_payment.py
index 79f42d4cb1..1110c969d8 100644
--- a/pms/tests/test_pms_payment.py
+++ b/pms/tests/test_pms_payment.py
@@ -1,11 +1,11 @@
from freezegun import freeze_time
-from odoo.tests.common import SavepointCase
+from odoo.tests.common import TransactionCase
freeze_time("2000-02-02")
-class TestPmsPayment(SavepointCase):
+class TestPmsPayment(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
diff --git a/pms/tests/test_pms_pricelist.py b/pms/tests/test_pms_pricelist.py
index 76bb8cfac4..fab86c632f 100644
--- a/pms/tests/test_pms_pricelist.py
+++ b/pms/tests/test_pms_pricelist.py
@@ -59,7 +59,9 @@ def setUpClass(cls):
}
)
# product.product 1
- cls.product1 = cls.env["product.product"].create({"name": "Test Breakfast"})
+ cls.product1 = cls.env["product.product"].create(
+ {"name": "Test Breakfast", "per_day": True, "consumed_on": "after"}
+ )
# pms.board.service
cls.board_service1 = cls.env["pms.board.service"].create(
@@ -201,8 +203,8 @@ def test_board_service_pricelist_item_apply_consumption_dates(self):
pricelist item created previously according to the CONSUMPTION date.
"""
# ARRANGE
- date_from = fields.date.today() + datetime.timedelta(days=1)
- date_to = fields.date.today() + datetime.timedelta(days=1)
+ date_from = fields.date.today() + datetime.timedelta(days=2)
+ date_to = fields.date.today() + datetime.timedelta(days=2)
expected_price = 1000.0
vals = {
"pricelist_id": self.pricelist2.id,
@@ -572,8 +574,8 @@ def test_service_pricelist_item_apply_consumption_dates(self):
pricelist item created previously according to the CONSUMPTION date.
"""
# ARRANGE
- date_from = fields.date.today() + datetime.timedelta(days=1)
- date_to = fields.date.today() + datetime.timedelta(days=1)
+ date_from = fields.date.today() + datetime.timedelta(days=2)
+ date_to = fields.date.today() + datetime.timedelta(days=2)
expected_price = 1000.0
vals = {
"pricelist_id": self.pricelist2.id,
@@ -862,106 +864,6 @@ def test_items_sort(self):
)
properties = self.room_type.product_id.pms_property_ids.ids
test_cases = [
- {
- "name": "sorting applied_on",
- "expected_price": 50 * 3,
- "items": [
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "2_product_category",
- "categ_id": self.product_category.id,
- "product_id": self.room_type.product_id.id,
- "fixed_price": 60.0,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "fixed_price": 50.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "1_product",
- "product_id": self.room_type.product_id.id,
- "product_tmpl_id": self.product_template.id,
- "fixed_price": 40.0,
- "pms_property_ids": properties,
- },
- ],
- },
- {
- "name": "sorting SALE date min range",
- "expected_price": 50.0 * 3,
- "items": [
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start": datetime.datetime.now(),
- "date_end": datetime.datetime.now()
- + datetime.timedelta(days=2),
- "fixed_price": 60.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start": datetime.datetime.now(),
- "date_end": datetime.datetime.now()
- + datetime.timedelta(days=1),
- "fixed_price": 50.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start": datetime.datetime.now(),
- "date_end": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "fixed_price": 40.0,
- "pms_property_ids": properties,
- },
- ],
- },
- {
- "name": "sorting CONSUMPTION date min range",
- "expected_price": 40.0 * 3,
- "items": [
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=6),
- "fixed_price": 60.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=10),
- "fixed_price": 50.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "fixed_price": 40.0,
- "pms_property_ids": properties,
- },
- ],
- },
{
"name": "sorting num. properties",
"expected_price": 50.0 * 3,
@@ -971,7 +873,6 @@ def test_items_sort(self):
"applied_on": "0_product_variant",
"product_id": self.room_type.product_id.id,
"fixed_price": 60.0,
- "pms_property_ids": properties,
},
{
"pricelist_id": self.pricelist1.id,
@@ -980,192 +881,6 @@ def test_items_sort(self):
"pms_property_ids": [self.pms_property1.id],
"fixed_price": 50.0,
},
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "pms_property_ids": [
- self.pms_property1.id,
- self.pms_property2.id,
- ],
- "fixed_price": 40.0,
- },
- ],
- },
- {
- "name": "sorting by item id",
- "expected_price": 40.0 * 3,
- "items": [
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "fixed_price": 60.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "fixed_price": 50.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "fixed_price": 40.0,
- "pms_property_ids": properties,
- },
- ],
- },
- {
- "name": "prioritize applied_on over SALE date",
- "expected_price": 60.0 * 3,
- "items": [
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start": datetime.datetime.now(),
- "date_end": datetime.datetime.now()
- + datetime.timedelta(days=2),
- "fixed_price": 60.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "product_id": self.room_type.product_id.id,
- "product_tmpl_id": self.product_template.id,
- "applied_on": "1_product",
- "date_start": datetime.datetime.now(),
- "date_end": datetime.datetime.now()
- + datetime.timedelta(days=1),
- "fixed_price": 50.0,
- "pms_property_ids": properties,
- },
- ],
- },
- {
- "name": "prioritize SALE date over CONSUMPTION date",
- "expected_price": 120.0 * 3,
- "items": [
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start": datetime.datetime.now(),
- "date_end": datetime.datetime.now()
- + datetime.timedelta(days=10),
- "fixed_price": 120.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "fixed_price": 50.0,
- "pms_property_ids": properties,
- },
- ],
- },
- {
- "name": "prioritize CONSUMPTION date over min. num. properties",
- "expected_price": 50.0 * 3,
- "items": [
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "fixed_price": 120.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "pms_property_ids": [
- self.pms_property1.id,
- self.pms_property2.id,
- ],
- "fixed_price": 50.0,
- },
- ],
- },
- {
- "name": "prioritize min. num. properties over item id",
- "expected_price": 50.0 * 3,
- "items": [
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "fixed_price": 120.0,
- "pms_property_ids": properties,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "pms_property_ids": [
- self.pms_property1.id,
- self.pms_property2.id,
- ],
- "fixed_price": 50.0,
- },
- ],
- },
- {
- "name": "tie => order by item id",
- "expected_price": 50.0 * 3,
- "items": [
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "date_start": datetime.datetime.now(),
- "date_end": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "pms_property_ids": [
- self.pms_property1.id,
- self.pms_property2.id,
- ],
- "fixed_price": 120.0,
- },
- {
- "pricelist_id": self.pricelist1.id,
- "applied_on": "0_product_variant",
- "product_id": self.room_type.product_id.id,
- "date_start_consumption": datetime.datetime.now(),
- "date_end_consumption": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "date_start": datetime.datetime.now(),
- "date_end": datetime.datetime.now()
- + datetime.timedelta(days=3),
- "pms_property_ids": [
- self.pms_property1.id,
- self.pms_property2.id,
- ],
- "fixed_price": 50.0,
- },
],
},
{
diff --git a/pms/tests/test_pms_reservation.py b/pms/tests/test_pms_reservation.py
index 9255ca3ea4..aebc20bc23 100644
--- a/pms/tests/test_pms_reservation.py
+++ b/pms/tests/test_pms_reservation.py
@@ -4,14 +4,20 @@
from odoo import fields
from odoo.exceptions import UserError, ValidationError
+from odoo.tests import tagged
+
+from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from .common import TestPms
-class TestPmsReservations(TestPms):
+@tagged("post_install", "-at_install")
+class TestPmsReservations(TestPms, AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls):
super().setUpClass()
+ user = cls.env["res.users"].browse(1)
+ cls.env = cls.env(user=user)
# create a room type availability
cls.room_type_availability = cls.env["pms.availability.plan"].create(
{
@@ -272,7 +278,7 @@ def test_split_reservation01(self):
"sale_channel_origin_id": self.sale_channel_direct.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
# ASSERT
self.assertTrue(
@@ -311,7 +317,7 @@ def test_split_reservation02(self):
"sale_channel_origin_id": self.sale_channel_direct.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
# ASSERT
self.assertFalse(r_test.splitted, "The reservation shouldn't be splitted")
@@ -344,7 +350,7 @@ def test_split_reservation03(self):
}
)
r1.reservation_line_ids[0].room_id = self.room2.id
- r1.flush()
+ r1.flush_recordset()
r2 = self.env["pms.reservation"].create(
{
@@ -358,7 +364,7 @@ def test_split_reservation03(self):
}
)
r2.reservation_line_ids[0].room_id = self.room3.id
- r2.flush()
+ r2.flush_recordset()
r3 = self.env["pms.reservation"].create(
{
@@ -372,7 +378,7 @@ def test_split_reservation03(self):
}
)
r3.reservation_line_ids[0].room_id = self.room1.id
- r3.flush()
+ r3.flush_recordset()
r4 = self.env["pms.reservation"].create(
{
@@ -386,7 +392,7 @@ def test_split_reservation03(self):
}
)
r4.reservation_line_ids[0].room_id = self.room3.id
- r4.flush()
+ r4.flush_recordset()
expected_num_changes = 2
# ACT
@@ -401,7 +407,7 @@ def test_split_reservation03(self):
"sale_channel_origin_id": self.sale_channel_direct.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
# ASSERT
self.assertEqual(
expected_num_changes,
@@ -437,7 +443,7 @@ def test_split_reservation04(self):
}
)
r1.reservation_line_ids[0].room_id = self.room2.id
- r1.flush()
+ r1.flush_recordset()
r2 = self.env["pms.reservation"].create(
{
@@ -451,7 +457,7 @@ def test_split_reservation04(self):
}
)
r2.reservation_line_ids[0].room_id = self.room3.id
- r2.flush()
+ r2.flush_recordset()
r3 = self.env["pms.reservation"].create(
{
@@ -465,7 +471,7 @@ def test_split_reservation04(self):
}
)
r3.reservation_line_ids[0].room_id = self.room1.id
- r3.flush()
+ r3.flush_recordset()
r4 = self.env["pms.reservation"].create(
{
@@ -479,7 +485,7 @@ def test_split_reservation04(self):
}
)
r4.reservation_line_ids[0].room_id = self.room3.id
- r4.flush()
+ r4.flush_recordset()
r5 = self.env["pms.reservation"].create(
{
@@ -493,7 +499,7 @@ def test_split_reservation04(self):
}
)
r5.reservation_line_ids[0].room_id = self.room2.id
- r5.flush()
+ r5.flush_recordset()
# ACT
r_test = self.env["pms.reservation"].create(
@@ -507,7 +513,7 @@ def test_split_reservation04(self):
"sale_channel_origin_id": self.sale_channel_direct.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
rooms = 0
last_room = None
@@ -548,7 +554,7 @@ def test_split_reservation05(self):
}
)
r1.reservation_line_ids[0].room_id = self.room1
- r1.flush()
+ r1.flush_recordset()
# ACT & ASSERT
with self.assertRaises(ValidationError):
@@ -562,7 +568,7 @@ def test_split_reservation05(self):
"partner_id": self.partner1.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
@freeze_time("2012-01-14")
def test_split_reservation06(self):
@@ -592,7 +598,7 @@ def test_split_reservation06(self):
)
r1.reservation_line_ids[0].room_id = self.room1
r1.reservation_line_ids[1].room_id = self.room1
- r1.flush()
+ r1.flush_recordset()
# ACT & ASSERT
with self.assertRaises(ValidationError):
@@ -606,7 +612,7 @@ def test_split_reservation06(self):
"partner_id": self.partner1.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
@freeze_time("2012-01-14")
def test_split_reservation07(self):
@@ -636,7 +642,7 @@ def test_split_reservation07(self):
r1.reservation_line_ids[0].room_id = self.room1
r1.reservation_line_ids[1].room_id = self.room1
r1.reservation_line_ids[2].room_id = self.room1
- r1.flush()
+ r1.flush_recordset()
r2 = self.env["pms.reservation"].create(
{
@@ -652,7 +658,7 @@ def test_split_reservation07(self):
r2.reservation_line_ids[0].room_id = self.room2
r2.reservation_line_ids[1].room_id = self.room2
r2.reservation_line_ids[2].room_id = self.room2
- r2.flush()
+ r2.flush_recordset()
r3 = self.env["pms.reservation"].create(
{
@@ -668,7 +674,7 @@ def test_split_reservation07(self):
r3.reservation_line_ids[0].room_id = self.room3
r3.reservation_line_ids[1].room_id = self.room3
r3.reservation_line_ids[2].room_id = self.room3
- r3.flush()
+ r3.flush_recordset()
# ACT & ASSERT
with self.assertRaises(ValidationError):
@@ -709,7 +715,7 @@ def test_manage_children_raise(self):
"pms_property_id": self.pms_property1.id,
}
)
- reservation.flush()
+ reservation.flush_recordset()
def test_reservation_action_assign(self):
"""
@@ -880,7 +886,7 @@ def test_reservation_action_checkout(self):
"sale_channel_origin_id": self.sale_channel_direct.id,
}
)
- r1.flush()
+ r1.flush_recordset()
checkin = self.env["pms.checkin.partner"].create(
{
"partner_id": host.id,
@@ -888,11 +894,11 @@ def test_reservation_action_checkout(self):
}
)
checkin.action_on_board()
- checkin.flush()
+ checkin.flush_recordset()
# ACT
with freeze_time("1981-11-02"):
- r1._cache.clear()
+ r1.invalidate_recordset()
r1.action_reservation_checkout()
# ASSERT
@@ -926,7 +932,7 @@ def _test_check_date_order(self):
date_order.second,
)
- reservation.flush()
+ reservation.flush_recordset()
self.assertEqual(
date_order,
date_order_expected,
@@ -951,7 +957,7 @@ def test_check_checkin_datetime(self):
}
)
r = reservation.checkin
- checkin_expected = datetime.datetime(r.year, r.month, r.day, 14, 00)
+ checkin_expected = datetime.datetime(r.year, r.month, r.day, 12, 00)
checkin_expected = self.pms_property1.date_property_timezone(checkin_expected)
self.assertEqual(
@@ -1028,7 +1034,7 @@ def test_partner_is_agency(self):
}
)
- reservation.flush()
+ reservation.flush_recordset()
self.assertEqual(
reservation.partner_id.id,
@@ -1230,7 +1236,7 @@ def test_check_more_adults_than_beds(self):
"adults": 4,
}
)
- reservation.flush()
+ reservation.flush_recordset()
@freeze_time("2012-01-14")
def test_check_format_arrival_hour(self):
@@ -1457,7 +1463,7 @@ def test_cancelation_reason_noshow(self):
}
)
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
self.assertEqual(
reservation.cancelled_reason,
"noshow",
@@ -1513,7 +1519,7 @@ def test_cancelation_reason_intime(self):
)
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
self.assertEqual(
reservation.cancelled_reason, "intime", "Cancelled reason must be 'intime'"
@@ -1566,7 +1572,7 @@ def test_cancelation_reason_late(self):
}
)
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
self.assertEqual(reservation.cancelled_reason, "late", "-----------")
@freeze_time("2012-01-14")
@@ -1795,7 +1801,7 @@ def test_partner_is_agency_not_invoice_to_agency(self):
}
)
- reservation.flush()
+ reservation.flush_recordset()
self.assertEqual(
reservation.partner_name,
@@ -1851,7 +1857,7 @@ def test_cancel_discount_board_service(self):
)
# ACTION
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
# ASSERT
self.assertEqual(
reservation.reservation_line_ids.mapped("cancel_discount")[0],
@@ -1896,7 +1902,7 @@ def _test_cancel_discount_reservation_line(self):
# ACTION
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
# ASSERT
self.assertEqual(
@@ -1955,7 +1961,7 @@ def test_cancel_discount_service(self):
# ACTION
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
# ASSERT
self.assertEqual(
expected_cancel_discount,
@@ -2014,7 +2020,7 @@ def test_discount_in_service(self):
# ACTION
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
expected_discount = sum(
sl.price_day_total * sl.cancel_discount / 100
@@ -2058,7 +2064,7 @@ def test_services_discount_in_reservation(self):
"product_id": self.product1.id,
}
)
- self.service.flush()
+ self.service.flush_recordset()
self.product2 = self.env["product.product"].create(
{
"name": "Product test 2",
@@ -2091,7 +2097,7 @@ def test_services_discount_in_reservation(self):
# ACTION
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
expected_discount = sum(s.discount for s in reservation.service_ids)
@@ -2133,7 +2139,7 @@ def _test_price_services_in_reservation(self):
"product_id": self.product1.id,
}
)
- self.service.flush()
+ self.service.flush_recordset()
self.product2 = self.env["product.product"].create(
{
"name": "Product test 2",
@@ -2166,7 +2172,7 @@ def _test_price_services_in_reservation(self):
# ACTION
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
expected_price = round(
(
self.service.price_total
@@ -2219,7 +2225,7 @@ def test_room_discount_in_reservation(self):
# ACTION
reservation.action_cancel()
- reservation.flush()
+ reservation.flush_recordset()
expected_discount = sum(
rl.price * rl.cancel_discount / 100
@@ -2911,7 +2917,7 @@ def test_commission_amount_with_board_service(self):
"pms_property_id": self.pms_property1.id,
}
)
- self.service.flush()
+ self.service.flush_recordset()
self.product_test1 = self.env["product.product"].create(
{
"name": "Test Product 1",
@@ -3423,4 +3429,4 @@ def test_one_reservation_change_sale_channel_origin(self):
# reservation1.reservation_line_ids.write(
# {"sale_channel_id": sale_channel_phone}
# )
- # reservation1.flush()
+ # reservation1.flush_recordset()
diff --git a/pms/tests/test_pms_simple_invoice.py b/pms/tests/test_pms_simple_invoice.py
index d4e1dd466b..881c729771 100644
--- a/pms/tests/test_pms_simple_invoice.py
+++ b/pms/tests/test_pms_simple_invoice.py
@@ -1,11 +1,11 @@
from freezegun import freeze_time
-from odoo.tests.common import SavepointCase
+from odoo.tests.common import TransactionCase
freeze_time("2000-02-02")
-class TestPmsInvoiceSimpleInvoice(SavepointCase):
+class TestPmsInvoiceSimpleInvoice(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
diff --git a/pms/tests/test_pms_wizard_split_join_swap_reservation.py b/pms/tests/test_pms_wizard_split_join_swap_reservation.py
index eae35ebe2a..879e3b4612 100644
--- a/pms/tests/test_pms_wizard_split_join_swap_reservation.py
+++ b/pms/tests/test_pms_wizard_split_join_swap_reservation.py
@@ -95,7 +95,7 @@ def test_unify_reservation_avail_should(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
+ r1.flush_recordset()
r1.reservation_line_ids[0].room_id = self.room2
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservation_join(
@@ -154,7 +154,7 @@ def test_unify_reservation_avail_not(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r2.flush()
+ r2.flush_recordset()
# ACT & ASSERT
with self.assertRaises(UserError):
self.env["pms.reservation.split.join.swap.wizard"].reservation_join(
@@ -191,7 +191,7 @@ def test_unify_reservation_avail_not_room_exist(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r2.flush()
+ r2.flush_recordset()
with self.assertRaises(UserError):
self.env["pms.reservation.split.join.swap.wizard"].reservation_join(
r2, self.env["pms.room"]
@@ -244,8 +244,8 @@ def test_swap_reservation_rooms_01(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
- r2.flush()
+ r1.flush_recordset()
+ r2.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservations_swap(
datetime.datetime.now(),
@@ -305,8 +305,8 @@ def test_swap_reservation_rooms_02(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
- r2.flush()
+ r1.flush_recordset()
+ r2.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservations_swap(
datetime.datetime.now(),
@@ -365,8 +365,8 @@ def test_swap_reservation_rooms_03(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
- r2.flush()
+ r1.flush_recordset()
+ r2.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservations_swap(
datetime.datetime.now(),
@@ -429,8 +429,8 @@ def test_swap_reservation_rooms_04(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
- r2.flush()
+ r1.flush_recordset()
+ r2.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservations_swap(
datetime.datetime.now(),
@@ -493,8 +493,8 @@ def test_swap_reservation_rooms_05(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
- r2.flush()
+ r1.flush_recordset()
+ r2.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservations_swap(
datetime.datetime.now(),
@@ -613,8 +613,8 @@ def test_swap_reservation_rooms_gap_01(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
- r2.flush()
+ r1.flush_recordset()
+ r2.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservations_swap(
datetime.datetime.now(),
@@ -688,8 +688,8 @@ def test_swap_reservation_rooms_gap_02(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
- r2.flush()
+ r1.flush_recordset()
+ r2.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservations_swap(
datetime.datetime.now(),
@@ -772,7 +772,7 @@ def test_split_reservation_check_room_splitted_valid_01(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
+ r1.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservation_split(
r1, datetime.date.today(), self.room2
@@ -810,7 +810,7 @@ def test_split_reservation_check_room_splitted_valid_02(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
+ r1.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservation_split(
r1,
@@ -857,7 +857,7 @@ def test_split_reservation_check_room_splitted_valid_03(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
+ r1.flush_recordset()
# ACT
self.env["pms.reservation.split.join.swap.wizard"].reservation_split(
r1,
@@ -900,7 +900,7 @@ def test_split_reservation_check_room_splitted_not_valid_01(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
+ r1.flush_recordset()
room_not_exist = self.room3 = self.env["pms.room"].create(
{
"pms_property_id": self.pms_property1.id,
@@ -940,7 +940,7 @@ def test_split_reservation_check_room_splitted_not_valid_02(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
+ r1.flush_recordset()
# ACT & ASSERT
with self.assertRaises(UserError):
self.env["pms.reservation.split.join.swap.wizard"].reservation_split(
@@ -971,7 +971,7 @@ def test_split_reservation_check_room_splitted_not_valid_03(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
+ r1.flush_recordset()
# ACT & ASSERT
with self.assertRaises(UserError):
self.env["pms.reservation.split.join.swap.wizard"].reservation_split(
@@ -1012,7 +1012,7 @@ def test_split_reservation_check_room_splitted_not_valid_04(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r1.flush()
+ r1.flush_recordset()
# ACT & ASSERT
with self.assertRaises(UserError):
self.env["pms.reservation.split.join.swap.wizard"].reservation_split(
diff --git a/pms/tests/test_product_template.py b/pms/tests/test_product_template.py
index c9a1d97831..8c2cd3af3a 100644
--- a/pms/tests/test_product_template.py
+++ b/pms/tests/test_product_template.py
@@ -180,7 +180,7 @@ def test_bs_daily_limit_equal(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- reservation.flush()
+ reservation.flush_recordset()
# ASSERT
self.assertEqual(
reservation.service_ids.service_line_ids.day_qty,
@@ -231,7 +231,7 @@ def test_bs_daily_limit_lower(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- reservation.flush()
+ reservation.flush_recordset()
# ASSERT
# self.assertTrue(reservation, "The reservation should have been created.")
# ASSERT
@@ -322,6 +322,6 @@ def _test_bs_is_extra_bed(self):
}
)
reservation._check_adults()
- reservation.flush()
+ reservation.flush_recordset()
# TODO: pending tests (need review) -> per_day, per_person (with board service?)
diff --git a/pms/tests/test_shared_room.py b/pms/tests/test_shared_room.py
index 243990ce8b..ff99d0f0c0 100644
--- a/pms/tests/test_shared_room.py
+++ b/pms/tests/test_shared_room.py
@@ -232,7 +232,7 @@ def test_count_avail_beds_with_one_bed_occupied(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- res1.flush()
+ res1.flush_recordset()
# ASSERT
self.assertEqual(
self.pms_property1.with_context(
@@ -390,7 +390,7 @@ def test_not_allowed_reservation_in_bed_with_room_occuppied(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
def test_not_allowed_reservation_in_shared_room_with_bed_occuppied(self):
"""
@@ -432,7 +432,7 @@ def test_not_allowed_reservation_in_shared_room_with_bed_occuppied(self):
"sale_channel_origin_id": self.sale_channel_direct1.id,
}
)
- r_test.flush()
+ r_test.flush_recordset()
def check_room_shared_availability_released_when_canceling_bed_reservations(self):
"""
diff --git a/pms/tests/test_tourist_taxes.py b/pms/tests/test_tourist_taxes.py
index 3abd2361c1..3c92d6f0d3 100644
--- a/pms/tests/test_tourist_taxes.py
+++ b/pms/tests/test_tourist_taxes.py
@@ -5,8 +5,8 @@
class TestTouristTaxes(TransactionCase):
- def setUp(self):
- super(TestTouristTaxes, self).setUp()
+ def setUpClass(self):
+ super().setUpClass()
self.product_tourist_tax = self.env["product.product"].create(
{
"name": "Tourist Tax",
diff --git a/pms/views/account_analytic_distribution_views.xml b/pms/views/account_analytic_distribution_views.xml
index cfd0768567..24a76d7911 100644
--- a/pms/views/account_analytic_distribution_views.xml
+++ b/pms/views/account_analytic_distribution_views.xml
@@ -4,10 +4,13 @@
account.analytic.distribution.model.inherit.form
account.analytic.distribution.model
-
+
-
+
@@ -15,10 +18,13 @@
account.analytic.distribution.model.inherit.tree
account.analytic.distribution.model
-
+
-
+
diff --git a/pms/views/assets.xml b/pms/views/assets.xml
deleted file mode 100644
index 5f19088260..0000000000
--- a/pms/views/assets.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/pms/views/pms_availability_plan_views.xml b/pms/views/pms_availability_plan_views.xml
index 9d005dd666..8aa44afecf 100644
--- a/pms/views/pms_availability_plan_views.xml
+++ b/pms/views/pms_availability_plan_views.xml
@@ -18,19 +18,6 @@
string="Massive changes"
/>
-
-
-
-
@@ -41,6 +28,7 @@
+
-
-
-
+
diff --git a/pms/views/precheckin_portal_templates.xml b/pms/views/precheckin_portal_templates.xml
deleted file mode 100644
index 471d552bee..0000000000
--- a/pms/views/precheckin_portal_templates.xml
+++ /dev/null
@@ -1,1466 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PreCheckin in
-
-
-
-
-
- Hi,
- .
- Do your check-in now and save time.
-
-
-
- This is our quick registration system . In a few steps you will be able to register your data in an agile, simple and secure way, avoiding queues at reception .
- If you register your data in our system, your passage through reception will be much faster , being able to enjoy the comfort of your room right away.
-
-
-
-
-
-
-
-
- If you wish, you can share with the rest of the guests the access to their check-in so that they can fill it out.
-
-
-
- Send Invitations
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- There are currently no reservations in this folio for your account.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Thank you!
- Your check-in has been successful.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The quick registration system is not available for this reservation.
- If you have any questions, you can contact us: Phone: Email:
-
-
-
-
-
-
diff --git a/pms/views/webclient_templates.xml b/pms/views/webclient_templates.xml
deleted file mode 100644
index ad23369d39..0000000000
--- a/pms/views/webclient_templates.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/pms/wizards/pms_booking_engine.py b/pms/wizards/pms_booking_engine.py
index 786d407aa3..ec20f0b497 100644
--- a/pms/wizards/pms_booking_engine.py
+++ b/pms/wizards/pms_booking_engine.py
@@ -119,11 +119,11 @@ def _default_pms_property_id(self):
else:
return self.env.user.pms_property_id.id
- @api.depends("availability_results.value_num_rooms_selected")
+ @api.depends("availability_results.rooms_selected_qty")
def _compute_can_create_folio(self):
for record in self:
record.can_create_folio = any(
- record.availability_results.mapped("value_num_rooms_selected")
+ record.availability_results.mapped("rooms_selected_qty")
)
@api.depends("partner_id")
@@ -200,7 +200,7 @@ def _compute_availability_results(self):
room_type_id=room_type_iterator.id,
pricelist_id=record.pricelist_id.id,
)
- num_rooms_available = pms_property.availability
+ rooms_available_qty = pms_property.availability
cmds.append(
(
@@ -211,7 +211,7 @@ def _compute_availability_results(self):
"checkin": record.start_date,
"checkout": record.end_date,
"room_type_id": room_type_iterator.id,
- "num_rooms_available": num_rooms_available,
+ "rooms_available_qty": rooms_available_qty,
},
)
)
@@ -223,7 +223,7 @@ def _compute_availability_results(self):
record.availability_results = cmds
record.availability_results = record.availability_results.sorted(
- key=lambda s: s.num_rooms_available, reverse=True
+ key=lambda s: s.rooms_available_qty, reverse=True
)
def create_folio(self):
@@ -248,7 +248,7 @@ def create_folio(self):
folio = record.folio_id
reservation_values = []
for line in record.availability_results:
- for _reservations_to_create in range(0, line.value_num_rooms_selected):
+ for _reservations_to_create in range(0, line.rooms_selected_qty):
res_dict = {
"folio_id": folio.id,
"checkin": line.checkin,
@@ -281,19 +281,6 @@ def create_folio(self):
return action
-class NumRoomsSelectionModel(models.TransientModel):
- _name = "pms.num.rooms.selection"
- _description = "Dinamic Selection based on avails room"
- _rec_name = "value"
-
- value = fields.Integer()
- room_type_id = fields.Char()
- booking_engine_id = fields.One2many(
- comodel_name="pms.folio.availability.wizard",
- inverse_name="num_rooms_selected",
- )
-
-
class AvailabilityWizard(models.TransientModel):
_name = "pms.folio.availability.wizard"
_description = "Room type line in Booking Engine"
@@ -320,27 +307,13 @@ class AvailabilityWizard(models.TransientModel):
check_pms_properties=True,
)
- num_rooms_available = fields.Integer(
+ rooms_available_qty = fields.Integer(
string="Available rooms",
help="Number of rooms that are available",
store=True,
- compute="_compute_num_rooms_available",
- )
- num_rooms_selected = fields.Many2one(
- string="Selected rooms",
- readonly=False,
- store=True,
- comodel_name="pms.num.rooms.selection",
- domain="[('value', '<=', num_rooms_available), "
- "('room_type_id', '=', room_type_id)]",
- compute="_compute_num_rooms_selected",
- )
- value_num_rooms_selected = fields.Integer(
- string="Number of Rooms Selected",
- readonly=False,
- store=True,
- compute="_compute_value_num_rooms_selected",
+ compute="_compute_rooms_available_qty",
)
+ rooms_selected_qty = fields.Integer(string="Number of Rooms Selected")
price_per_room = fields.Float(
string="Price per room",
help="Price per room in folio",
@@ -369,8 +342,22 @@ class AvailabilityWizard(models.TransientModel):
check_pms_properties=True,
)
+ @api.onchange("rooms_selected_qty")
+ def onchange_rooms_selected_qty(self):
+ for record in self:
+ if record.rooms_selected_qty > record.rooms_available_qty:
+ raise models.ValidationError(
+ _(
+ "The number of selected rooms ({selected_qty}) cannot be "
+ "greater than the number of available rooms ({available_qty})."
+ ).format(
+ selected_qty=record.rooms_selected_qty,
+ available_qty=record.rooms_available_qty,
+ )
+ )
+
@api.depends("room_type_id", "checkin", "checkout")
- def _compute_num_rooms_available(self):
+ def _compute_rooms_available_qty(self):
for record in self:
pms_property = record.booking_engine_id.pms_property_id
pms_property = pms_property.with_context(
@@ -379,38 +366,7 @@ def _compute_num_rooms_available(self):
room_type_id=record.room_type_id.id,
pricelist_id=record.booking_engine_id.pricelist_id.id,
)
- record.num_rooms_available = pms_property.availability
-
- @api.depends("num_rooms_available")
- def _compute_num_rooms_selected(self):
- for record in self:
- for elem_to_insert in range(0, record.num_rooms_available + 1):
- if (
- self.env["pms.num.rooms.selection"].search_count(
- [
- ("value", "=", elem_to_insert),
- ("room_type_id", "=", record.room_type_id.id),
- ]
- )
- == 0
- ):
- self.env["pms.num.rooms.selection"].create(
- {
- "value": elem_to_insert,
- "room_type_id": record.room_type_id.id,
- }
- )
- record.num_rooms_selected = self.env["pms.num.rooms.selection"].search(
- [("value", "=", 0), ("room_type_id", "=", record.room_type_id.id)]
- )
-
- @api.depends("num_rooms_selected")
- def _compute_value_num_rooms_selected(self):
- for record in self:
- if record.num_rooms_selected:
- record.value_num_rooms_selected = record.num_rooms_selected.value
- elif not record.value_num_rooms_selected:
- record.value_num_rooms_selected = 0
+ record.rooms_available_qty = pms_property.availability
@api.depends("room_type_id", "board_service_room_id", "checkin", "checkout")
def _compute_price_per_room(self):
@@ -424,10 +380,10 @@ def _compute_price_per_room(self):
pms_property_id=record.booking_engine_id.pms_property_id.id,
)
- @api.depends("price_per_room", "value_num_rooms_selected")
+ @api.depends("price_per_room", "rooms_selected_qty")
def _compute_price_total(self):
for record in self:
- record.price_total = record.price_per_room * record.value_num_rooms_selected
+ record.price_total = record.price_per_room * record.rooms_selected_qty
@api.model
def _get_price_by_room_type(
@@ -440,23 +396,32 @@ def _get_price_by_room_type(
pms_property_id,
adults=False,
):
+ if not room_type_id:
+ return 0
room_type_total_price_per_room = 0
room_type = self.env["pms.room.type"].browse(room_type_id)
pms_property = self.env["pms.property"].browse(pms_property_id)
+ pricelist = self.env["product.pricelist"].browse(pricelist_id)
+
+ product = room_type.product_id
for date_iterator in [
checkin + datetime.timedelta(days=x)
for x in range(0, (checkout - checkin).days)
]:
- product = room_type.product_id
- product = product.with_company(pms_property.company_id).with_context(
+ price = pricelist._get_product_price(
+ product=product,
quantity=1,
- date=fields.Date.today(),
consumption_date=date_iterator,
- pricelist=pricelist_id,
- uom=product.uom_id.id,
- property=pms_property_id,
+ pms_property_id=pms_property_id,
+ )
+ room_type_total_price_per_room += self.env[
+ "account.tax"
+ ]._fix_tax_included_price_company(
+ price,
+ product.taxes_id,
+ product.taxes_id, # Not exist service line, we repeat product taxes
+ pms_property.company_id,
)
- room_type_total_price_per_room += product.lst_price
if board_service_room_id:
board_service_room = self.env["pms.board.service.room.type"].browse(
diff --git a/pms/wizards/pms_booking_engine_views.xml b/pms/wizards/pms_booking_engine_views.xml
index 52229c9dc4..0ac1c01eb4 100644
--- a/pms/wizards/pms_booking_engine_views.xml
+++ b/pms/wizards/pms_booking_engine_views.xml
@@ -74,61 +74,54 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ name="room_type_id"
+ readonly="1"
+ options="{'no_open': True}"
+ force_save="1"
+ />
+
+
+
+ name="rooms_available_qty"
+ readonly="1"
+ force_save="1"
+ />
+ name="rooms_selected_qty"
+ attrs="{'readonly':[('rooms_available_qty','<',1)]}"
+ force_save="1"
+ />
+
+
+
-
-
-
+
+
diff --git a/pms/wizards/wizard_massive_changes.py b/pms/wizards/wizard_massive_changes.py
index 60aed1fcfa..e2b9addb50 100644
--- a/pms/wizards/wizard_massive_changes.py
+++ b/pms/wizards/wizard_massive_changes.py
@@ -12,9 +12,6 @@ class AvailabilityWizard(models.TransientModel):
pms_property_ids = fields.Many2many(
string="Property",
comodel_name="pms.property",
- default=lambda self: self.env["pms.property"].browse(
- self.env.user.get_active_property_id.id
- ),
check_pms_properties=True,
required=True,
)
diff --git a/requirements.txt b/requirements.txt
index 7f6cf5d6fe..3add78c08b 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,7 +2,7 @@
bs4
geopy
jose
-pyjwt
+jwt
marshmallow
pycountry
simplejson