-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] resource_booking: _get_available_slots
[IMP] resource_booking: new field slot_duration [IMP] resource_booking: Button (partner -> booking) [IMP] resource_booking: combination -> bookings -> create: default combination [IMP] resource_booking: A booking may have multiple contacts, e.g. people in a room [FIX] resource_booking: _get_intervals() when type_id is missing [IMP] resource_booking: booking: search on combination [FIX] resource_booking: _availability_is_fitting() [IMP] resource_booking: booking list view with hidden partner_ids [FIX] resource_booking: migration: attendance hour_to 23:59 -> 24:00 [IMP] resource_booking: rename_xmlids [FIX] resource_booking: pre-commit [FIX] resource_booking: calendar_slot_duration format [FIX] resource_booking: _get_calendar_context() with correct start / timezone
- Loading branch information
1 parent
3e30383
commit 3fe4807
Showing
15 changed files
with
235 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from openupgradelib import openupgrade | ||
|
||
|
||
def _update_attendance_hour_to(env): | ||
# 23:59 -> 24:00 | ||
lines = env["resource.calendar.attendance"].search( | ||
[("hour_to", ">=", 23 + 59 / 60)] | ||
) | ||
lines.hour_to = 24.0 | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
_update_attendance_hour_to(env) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from openupgradelib import openupgrade | ||
|
||
xmlids_spec = [ | ||
( | ||
"resource_booking.menu_resource_resource", | ||
"resource_booking.resource_resource_menu", | ||
), | ||
( | ||
"resource_booking.menu_resource_calendar", | ||
"resource_booking.resource_calendar_menu", | ||
), | ||
( | ||
"resource_booking.menu_view_resource_calendar_leaves_search", | ||
"resource_booking.resource_calendar_leaves_menu", | ||
), | ||
( | ||
"resource_booking.resource_booking_combination_form", | ||
"resource_booking.resource_booking_combination_view_form", | ||
), | ||
( | ||
"resource_booking.resource_booking_type_form", | ||
"resource_booking.resource_booking_type_view_form", | ||
), | ||
( | ||
"resource_booking.resource_booking_form", | ||
"resource_booking.resource_booking_view_form", | ||
), | ||
] | ||
|
||
|
||
@openupgrade.migrate(use_env=False) | ||
def migrate(cr, version): | ||
openupgrade.rename_xmlids(cr, xmlids_spec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class ResPartner(models.Model): | ||
_inherit = "res.partner" | ||
|
||
resource_booking_count = fields.Integer( | ||
compute="_compute_resource_booking_count", string="Resource booking count" | ||
) | ||
resource_booking_ids = fields.One2many( | ||
"resource.booking", "partner_id", string="Bookings" | ||
) | ||
|
||
def _compute_resource_booking_count(self): | ||
for p in self: | ||
p.resource_booking_count = len(p.resource_booking_ids) | ||
|
||
def action_view_resource_booking(self): | ||
self.ensure_one() | ||
action = self.env["ir.actions.actions"]._for_xml_id( | ||
"resource_booking.resource_booking_action" | ||
) | ||
action["context"] = { | ||
"default_partner_id": self.id, | ||
} | ||
return action |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.