diff --git a/.eslintrc.yml b/.eslintrc.yml index fed88d70..3d63b68a 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -4,7 +4,8 @@ env: # See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449 parserOptions: - ecmaVersion: 2019 + ecmaVersion: 11 + sourceType: module overrides: - files: diff --git a/resource_booking/README.rst b/resource_booking/README.rst index 5af42b13..ca5aabe8 100644 --- a/resource_booking/README.rst +++ b/resource_booking/README.rst @@ -7,7 +7,7 @@ Resource booking !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:69da76a920e2d581cfc27db05479e5705f196298cbbe67e881c92bf1ea6363af + !! source digest: sha256:1a00b2b5ad7b830fbe275ea34e4efe05037f94243149329f9a6b5fdbb6b02749 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png diff --git a/resource_booking/__manifest__.py b/resource_booking/__manifest__.py index 4b71ba26..50b2a655 100644 --- a/resource_booking/__manifest__.py +++ b/resource_booking/__manifest__.py @@ -44,8 +44,13 @@ "views/menus.xml", ], "assets": { - "web.assets_frontend": ["resource_booking/static/src/scss/portal.scss"], - "web.assets_tests": ["resource_booking/static/src/js/resource_booking_tour.js"], + "web.assets_frontend": [ + "resource_booking/static/src/js/booking_portal.js", + "resource_booking/static/src/scss/portal.scss", + ], + "web.assets_tests": [ + "resource_booking/static/src/js/tours/resource_booking_tour.js" + ], }, "demo": ["demo/res_users_demo.xml"], } diff --git a/resource_booking/models/resource_booking.py b/resource_booking/models/resource_booking.py index 1416386e..06400c9d 100644 --- a/resource_booking/models/resource_booking.py +++ b/resource_booking/models/resource_booking.py @@ -736,7 +736,7 @@ def action_schedule(self): self.duration, False ), default_resource_booking_ids=[(6, 0, self.ids)], - default_name=self.name, + default_name=self.name or "", ), "name": _("Schedule booking"), "res_model": "calendar.event", diff --git a/resource_booking/models/resource_booking_type.py b/resource_booking/models/resource_booking_type.py index 7d1597d0..d7d51585 100644 --- a/resource_booking/models/resource_booking_type.py +++ b/resource_booking/models/resource_booking_type.py @@ -35,7 +35,7 @@ class ResourceBookingType(models.Model): default="random", help=( "Choose how to auto-assign resource combinations. " - "It has no effect if assiged manually." + "It has no effect if assigned manually." ), ) combination_rel_ids = fields.One2many( diff --git a/resource_booking/static/description/index.html b/resource_booking/static/description/index.html index 676ce85f..82f60f2e 100644 --- a/resource_booking/static/description/index.html +++ b/resource_booking/static/description/index.html @@ -367,7 +367,7 @@
This module adds a new app to allow you to book resource combinations in given diff --git a/resource_booking/static/src/js/booking_portal.js b/resource_booking/static/src/js/booking_portal.js new file mode 100644 index 00000000..31213f9b --- /dev/null +++ b/resource_booking/static/src/js/booking_portal.js @@ -0,0 +1,13 @@ +/** @odoo-module */ + +import publicWidget from "web.public.widget"; +import "portal.portal"; // Force dependencies + +publicWidget.registry.PortalHomeCounters.include({ + /** + * @override + */ + _getCountersAlwaysDisplayed() { + return this._super(...arguments).concat(["booking_count"]); + }, +}); diff --git a/resource_booking/static/src/js/resource_booking_tour.js b/resource_booking/static/src/js/tours/resource_booking_tour.js similarity index 98% rename from resource_booking/static/src/js/resource_booking_tour.js rename to resource_booking/static/src/js/tours/resource_booking_tour.js index 8b1a9fba..972c54a9 100644 --- a/resource_booking/static/src/js/resource_booking_tour.js +++ b/resource_booking/static/src/js/tours/resource_booking_tour.js @@ -1,6 +1,4 @@ odoo.define("resource_booking.tour", function (require) { - "use strict"; - var tour = require("web_tour.tour"); tour.register( diff --git a/resource_booking/templates/portal.xml b/resource_booking/templates/portal.xml index 4458958a..7c6324d6 100644 --- a/resource_booking/templates/portal.xml +++ b/resource_booking/templates/portal.xml @@ -33,110 +33,117 @@ -
- - | -||||||
- - - - | -- | - - - - | -||||
---|---|---|---|---|---|---|