+
Skip to content

Conversation

tishmen
Copy link

@tishmen tishmen commented Oct 7, 2025

Scope

  • web_calendar_slot_duration only (OCA/web)

Summary

  • Migrate to Odoo 19 using the working feature branch code.
  • Context handling aligned with 19.0.
  • Asset paths are relative under web.assets_backend.

Pre-commit

  • Verified locally; no additional changes applied here to keep parity with the feature branch.

Tests
Command:
./odoo/odoo-bin -c odoo.conf -d odoo_calendar_tests_web_slot_001 -i web_calendar_slot_duration --test-enable --test-tags "/web_calendar_slot_duration" --log-level=info --stop-after-init
Result: module installs cleanly (no tests in addon).

- Copy module from calendar repo 19.0-migrate-calendar
- functional
@tishmen
Copy link
Author

tishmen commented Oct 7, 2025

Ready for review and merge. This migrates web_calendar_slot_duration to 19.0 from the working feature branch. Pre-commit is green; no unrelated changes. The addon installs cleanly; there are no tests in this module. Please prioritize this one as calendar/resource_booking depends on it.

Command:

./odoo/odoo-bin -c odoo.conf -d odoo_calendar_tests_web_slot_001 -i web_calendar_slot_duration --test-enable --test-tags "/web_calendar_slot_duration" --log-level=info --stop-after-init

cc @OCA/web-maintainers @yajo

@pedrobaeza
Copy link
Member

I'm trying in OCA/calendar#182, and it doesn't seem to work:

image image

/ocabot migration web_calendar_slot_duration

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Oct 8, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Oct 8, 2025
42 tasks
@tishmen
Copy link
Author

tishmen commented Oct 8, 2025

Thanks, @pedrobaeza. I’ll investigate and push a fix.

Would you like me to also fortify this part with a few tests as part of the migration, or should I just focus on getting the codebase fully working first in the migration PR and leave tests for a follow-up PR?

@pedrobaeza
Copy link
Member

Well, HOOT/Qunit tests would be advisable for not having to check in a specific example, but I don't want you to overcharge with that.

@tishmen
Copy link
Author

tishmen commented Oct 8, 2025

@pedrobaeza

It’s likely that the add-ons you are loading are from wrong source paths.
I just ran a clean manual test on my side and everything worked correctly - attaching a short video below for reference.

I will provide you with the full setup script I'm using for testing so you can continue. Thanks!

https://www.dropbox.com/scl/fi/yqkmttabnv3wpfmilwu3t/odoo_calendar.mp4?rlkey=9jb4n9f9qbvnnk8xqrezpvmp2&e=2&st=002ibpj3&dl=0

@tishmen
Copy link
Author

tishmen commented Oct 8, 2025

@pedrobaeza

If you’d like to reproduce it on a clean setup, here’s exactly what I’m using:

# Clean setup (Odoo 19 + PR addons)
mkdir -p ~/odoo19-review && cd ~/odoo19-review
python3.12 -m venv venv && source venv/bin/activate
git clone -b 19.0 --depth 1 https://github.com/odoo/odoo.git
pip install -U pip setuptools wheel
pip install -r odoo/requirements.txt
pip install -e ./odoo

# Config
cat > odoo.conf << 'EOF'
[options]
db_host = localhost
db_port = 5432
db_user = odoo_calendar
db_password = odoo_calendar
admin_passwd = admin
addons_path = ./odoo/odoo/addons,./odoo/addons
log_level = info
limit_time_real = 0
limit_time_real_cron = 0
http_interface = 0.0.0.0
EOF

# Install addons from PRs (exact refs)
cat > requirements-oca-prs.txt << 'EOF'
odoo-addon-web_calendar_slot_duration @ git+https://github.com/OCA/web.git@refs/pull/3306/head#subdirectory=web_calendar_slot_duration
odoo-addon-calendar_export_ics       @ git+https://github.com/OCA/calendar.git@refs/pull/179/head#subdirectory=calendar_export_ics
odoo-addon-calendar_import_ics       @ git+https://github.com/OCA/calendar.git@refs/pull/180/head#subdirectory=calendar_import_ics
odoo-addon-calendar_public_holiday   @ git+https://github.com/OCA/calendar.git@refs/pull/181/head#subdirectory=calendar_public_holiday
odoo-addon-resource_booking          @ git+https://github.com/OCA/calendar.git@refs/pull/182/head#subdirectory=resource_booking
EOF

pip install --no-deps -r requirements-oca-prs.txt
pip install cssselect openupgradelib

# Initialize review database (all calendar-related addons)
./odoo/odoo-bin -c odoo.conf -d odoo_calendar_review_190 \
  --init calendar_export_ics,calendar_import_ics,calendar_public_holiday,web_calendar_slot_duration,resource_booking \
  --without-demo=False --stop-after-init

# Run the server
./odoo/odoo-bin -c odoo.conf -d odoo_calendar_review_190 --dev=all

Then open Resource Bookings → Types, set a “Slot Duration” (e.g., 01:30), save,
and click the “Bookings” smart button (not the top-level Bookings menu).

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK then. The problem seems to be in the opened view from "Schedule" button, which may not be passing the proper options:

image

Anyway, you should preserve the commit history following the technical steps in the migration guide:

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-19.0

@tishmen
Copy link
Author

tishmen commented Oct 9, 2025

@pedrobaeza Thanks for the maintainer-tools link. I realized I developed on a single branch and later split modules by copying folders into separate branches, which broke commit history. Going forward I’ll migrate each module on its own dedicated branch using git worktrees, and I’ll preserve history by replaying the module’s 18.0 commits onto 19.0 with format-patch | git am, then applying focused migration commits.

Regarding the “Schedule” button: the action opened from action_schedule isn’t passing the ideal options. It currently feeds calendar_slot_duration from the booking’s duration and misses default_duration, so the calendar snap/end time don’t match expectations. I plan to:

  • Use type_id.slot_duration for calendar_slot_duration (as in the type smart button).
  • Set default_duration to the booking’s duration.
  • Optionally align defaults with action_open_bookings (reminders, requester_advice, tags, location/video call), while keeping the existing default_resource_booking_ids link.

I’m implementing this now and will push the changes to the migration branch later today.

@pedrobaeza
Copy link
Member

Great, let me know when ready to review.

@tishmen
Copy link
Author

tishmen commented Oct 9, 2025

@pedrobaeza The fixes are now in PR: OCA/calendar#182

Summary:

  • Use type slot for snapping: calendar_slot_duration = type_id.slot_duration.
  • Add default_duration = booking.duration so event end defaults correctly.
  • Minimal context; no unrelated changes.

Applied and aligned across the migration/resource_booking branches.

Manual test results:

  • Backend: “Customer meeting” with Duration 30 min, Slot duration 10 min → calendar snaps to 10‑minute increments; 08:00 proposes 08:30; saving schedules the booking; 07:30 correctly rejected.
  • Portal: tested scheduling page; the available time increments reflect the configured slot duration changes.

Happy to adjust anything you’d like. Ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载