Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
06ff90e
[16.0][FIX] pms: rename dependence
syci Sep 26, 2024
341f03b
Merge branch '16.0-mig-pms' of https://github.com/commitsun/pms into …
Oct 14, 2024
dbf94d0
Merge pull request #1 from Comunitea/16.0-pms_l10n_es_sii
syci Oct 14, 2024
ec41d0d
[16.0][MIG] pms_l10n_es_sii
syci Oct 14, 2024
75d9bb8
Merge pull request #2 from Comunitea/16.0-pms_l10n_es_sii
syci Oct 14, 2024
4e4b6fa
[16.0][MIG] pms_account_move_budget
syci Oct 16, 2024
51cb99a
[16.0][FIX] Version on files
syci Oct 16, 2024
2e46a91
[16.0][FIX] Tests
syci Oct 16, 2024
51e46ff
[MIG]pos_pms_link
miguelvazquez1 Oct 11, 2024
36379bd
[IMP]pos_pms_link: permitir cierre de sesión
miguelvazquez1 Jan 23, 2025
dbe8d12
[FIX]pos_pms_link: código innecesario
miguelvazquez1 Jan 23, 2025
c8605ef
pre-commit
miguelvazquez1 Jan 24, 2025
b172710
[IMP] update dotfiles
OCA-git-bot Feb 2, 2025
0354f2b
[IMP]pos_pms_link: cargar clientes con sudo
miguelvazquez1 Feb 5, 2025
0d207d2
TMP
DarioLodeiros Jan 26, 2024
bdc12e0
ADD Temp api logs in push calls
DarioLodeiros Apr 16, 2024
70aaa0b
[IMP]pos_pms_link: permitir movimientos de efectivo en tpv a no usuarios
miguelvazquez1 Feb 14, 2025
d1789be
[FIX]pos_pms_link
miguelvazquez1 Feb 14, 2025
9767b51
[IMP]pos_pms_link: partner en movimientos de efectivo en tpv
miguelvazquez1 Feb 27, 2025
5e2e7c2
[TMP]SII refund type: temporaly mark 'I' like reverse refund tupe to SII
DarioLodeiros Oct 9, 2023
705f18d
[TMP]pms_api_rest: POC coupon
DarioLodeiros Jan 8, 2025
ae12ff7
Multiples temporal fixes
DarioLodeiros Mar 4, 2025
4df2d54
TMP aldahotel internal user, autoassign reservations
DarioLodeiros Mar 9, 2025
7dabb6e
Merge commit 'refs/pull/270/head' of https://github.com/OCA/pms into …
miguelpadin May 21, 2025
4affd2c
Merge branch '16.0-mig-pos_pms_link' of https://github.com/Comunitea/…
miguelpadin May 21, 2025
d9b0e63
Merge branch '16.0-pms_account_move_budget' of https://github.com/Com…
miguelpadin May 21, 2025
c60d7d5
Merge branch 'HOTFIX-16-api_rest_based' of https://github.com/commits…
miguelpadin May 21, 2025
d098321
Merge branch 'HOTFIX-16-connector_based' of https://github.com/commit…
miguelpadin May 21, 2025
b6c9421
Merge branch '16.0-TEMP_pms_api_rest_sale_coupon' of https://github.c…
miguelpadin May 21, 2025
cc798ff
[IMP] pms_l10n_es: improve ses communications error handling, track c…
miguelpadin Jun 3, 2025
4c24bc2
[FIX] pms_l10n_es: fix getting lastname SES xml
miguelpadin Jun 3, 2025
ccf2288
[FIX] pms_l10n_es: take into account children ses xml
miguelpadin Jun 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -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: {}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ 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
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
- uses: actions/cache@v1
- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
34 changes: 23 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -138,7 +150,7 @@ repos:
- --header
- "# generated from manifests external_dependencies"
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 5.0.0
hooks:
- id: flake8
name: flake8
Expand Down
106 changes: 106 additions & 0 deletions connector_pms/components_custom/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ class ChannelChildMapperImport(AbstractComponent):

def get_all_items(self, mapper, items, parent, to_attr, options):
mapped = []
neobookings_user = self.env["res.users"].search(
[("login", "=", "neobookings@roomdoo.com")]
)
neobooking_item_ids = []
for item in items:
map_record = mapper.map_record(item, parent=parent)
if self.skip_item(map_record):
Expand All @@ -110,6 +114,108 @@ def get_all_items(self, mapper, items, parent, to_attr, options):
if item_values:
self._child_bind(map_record, item_values)
mapped.append(item_values)
if hasattr(items, "_name"):
neobooking_item_ids.append(item.id)
neobookings_property_ids = neobookings_user.pms_property_ids.ids

if self.backend_record.pms_property_id.id not in neobookings_property_ids:
return mapped

neobookings_property_id = self.backend_record.pms_property_id.id
neobookings_property = self.env["pms.property"].browse(neobookings_property_id)
ota_neo_settings = neobookings_property.ota_property_settings_ids.filtered(
lambda r: "eobookings" in r.agency_id.name
)
neobookings_pricelist_id = ota_neo_settings.main_pricelist_id.id
neobookings_availability_plan_id = ota_neo_settings.main_avail_plan_id.id
payload = False
items_to_upload = False
call_type = False
min_date = False
max_date = False
room_type_ids = False
if (
hasattr(items, "_name")
and items._name == "channel.wubook.product.pricelist.item"
):
call_type = "prices"
items_to_upload = (
self.env["channel.wubook.product.pricelist.item"]
.browse(neobooking_item_ids)
.filtered(
lambda r: r.pricelist_id.id == neobookings_pricelist_id
and neobookings_property_id in r.pms_property_ids.ids
)
)
if items_to_upload:
min_date = min(items_to_upload.mapped("date_end_consumption"))
max_date = max(items_to_upload.mapped("date_end_consumption"))
room_type_ids = (
self.env["pms.room.type"]
.search(
[("product_id", "in", items_to_upload.mapped("product_id").ids)]
)
.ids
)
payload, endpoint = neobookings_property.get_payload_prices(
prices=items_to_upload, client=neobookings_user
)
if hasattr(items, "_name") and items._name == "channel.wubook.pms.availability":
call_type = "availability"
items_to_upload = (
self.env["channel.wubook.pms.availability"]
.browse(neobooking_item_ids)
.filtered(lambda r: r.pms_property_id.id == neobookings_property_id)
)
if items_to_upload:
min_date = min(items_to_upload.mapped("date"))
max_date = max(items_to_upload.mapped("date"))
room_type_ids = items_to_upload.mapped("room_type_id.id")
payload, endpoint = neobookings_property.get_payload_avail(
avails=items_to_upload, client=neobookings_user
)
if (
hasattr(items, "_name")
and items._name == "channel.wubook.pms.availability.plan.rule"
):
call_type = "restrictions"
items_to_upload = (
self.env["channel.wubook.pms.availability.plan.rule"]
.browse(neobooking_item_ids)
.filtered(
lambda r: r.availability_plan_id.id
== neobookings_availability_plan_id
and r.pms_property_id.id == neobookings_property_id
)
)
if items_to_upload:
min_date = min(items_to_upload.mapped("date"))
max_date = max(items_to_upload.mapped("date"))
room_type_ids = items_to_upload.mapped("room_type_id.id")
payload, endpoint = neobookings_property.get_payload_rules(
rules=items_to_upload, client=neobookings_user
)
if payload:
_logger.info("Exporting Neobookings")
response = neobookings_property.pms_api_push_payload(
payload=payload, endpoint=endpoint, client=neobookings_user
)
self.env["pms.api.log"].sudo().create(
{
"pms_property_id": neobookings_property_id,
"client_id": neobookings_user.id,
"request": payload,
"response": str(response),
"status": "success" if response.ok else "error",
"request_date": fields.Datetime.now(),
"method": "PUSH",
"endpoint": endpoint,
"target_date_from": min_date,
"target_date_to": max_date,
"request_type": call_type,
"room_type_ids": room_type_ids,
}
)
return mapped

def get_items(self, items, parent, to_attr, options):
Expand Down
7 changes: 4 additions & 3 deletions connector_pms_wubook/models/pms_availability/binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def _compute_sale_avail(self):
else:
raise ValidationError(
_(
"More than one rule found, you need to"
" specify the rule in the context"
"""More than one rule found, you need to
specify the rule in the context"""
)
)
if record.sale_avail != sale_avail:
Expand Down Expand Up @@ -164,7 +164,8 @@ def create(self, vals):

def _write(self, vals):
cr = self._cr
if any([field in vals for field in AUTO_EXPORT_FIELDS]):
export_fields = AUTO_EXPORT_FIELDS
if any([field in vals for field in export_fields]):
query = 'UPDATE "%s" SET "actual_write_date"=%s WHERE id IN %%s' % (
self._table,
AsIs("(now() at time zone 'UTC')"),
Expand Down
2 changes: 1 addition & 1 deletion multi_pms_properties/i18n/multi_pms_properties.pot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down
2 changes: 1 addition & 1 deletion multi_pms_properties/tests/test_multi_pms_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


@common.tagged("-at_install", "post_install")
class TestMultiPMSProperties(common.SavepointCase):
class TestMultiPMSProperties(common.TransactionCase):
@classmethod
def setUpClass(cls):
super(TestMultiPMSProperties, cls).setUpClass()
Expand Down
4 changes: 3 additions & 1 deletion pms/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ def action_draft(self):
}
for move in downpayment_invoices
]
downpayment_invoices._reverse_moves(
downpayment_invoices.with_context(
{"sii_refund_type": "I"}
)._reverse_moves(
default_values_list, cancel=True
)
else:
Expand Down
2 changes: 1 addition & 1 deletion pms/models/pms_availability.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class PmsAvailability(models.Model):
@api.depends(
"reservation_line_ids",
"reservation_line_ids.occupies_availability",
"room_type_id.total_rooms_count",
# "room_type_id.total_rooms_count",
"parent_avail_id",
"parent_avail_id.reservation_line_ids",
"parent_avail_id.reservation_line_ids.occupies_availability",
Expand Down
2 changes: 1 addition & 1 deletion pms/models/pms_reservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ def _compute_checkin_partner_count(self):
record.checkin_partner_count = 0
record.checkin_partner_pending_count = 0

@api.depends("room_type_id", "partner_id")
@api.depends("room_type_id")
def _compute_tax_ids(self):
for record in self:
record = record.with_company(record.company_id)
Expand Down
2 changes: 1 addition & 1 deletion pms/models/pms_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def _compute_pricelist_id(self):
origin = record.reservation_id if record.reservation_id else record.folio_id
record.pricelist_id = origin.pricelist_id

@api.depends("product_id", "folio_id.partner_id", "reservation_id.partner_id")
@api.depends("product_id")
def _compute_tax_ids(self):
for service in self:
partner = (
Expand Down
4 changes: 3 additions & 1 deletion pms/models/res_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class ResUsers(models.Model):
def _is_property_member(self, pms_property_id):
self.ensure_one()
# TODO: Use pms_teams and roles to check if user is member of property
# and analice the management of external users like a Call Center
# and analice the management of external users like a Call
if "aldahotels" in self.login:
True
return self.env.user.has_group(
"pms.group_pms_user"
) and not self.env.user.has_group("pms.group_pms_call")
Expand Down
Loading
Loading