diff --git a/room/__manifest__.py b/room/__manifest__.py index 83cc0dcb7..5a0d2625d 100644 --- a/room/__manifest__.py +++ b/room/__manifest__.py @@ -16,6 +16,7 @@ 'views/room_menus.xml', 'views/room_booking_templates_frontend.xml', 'views/room_office_views.xml', + 'views/webclient_templates.xml', 'data/ir_module_category_data.xml', 'security/ir_rule.xml', 'security/ir.model.access.csv', diff --git a/room/controllers/__init__.py b/room/controllers/__init__.py index 5d4b25db9..9f2bd40b1 100644 --- a/room/controllers/__init__.py +++ b/room/controllers/__init__.py @@ -2,3 +2,4 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import main +from . import main_room_yuthon diff --git a/website_form_room/controllers/main.py b/room/controllers/main_room_yuthon.py similarity index 100% rename from website_form_room/controllers/main.py rename to room/controllers/main_room_yuthon.py diff --git a/room/data/room_wechat_cron_data.xml b/room/data/room_wechat_cron_data.xml index 1a458d825..1e30b58f6 100644 --- a/room/data/room_wechat_cron_data.xml +++ b/room/data/room_wechat_cron_data.xml @@ -14,6 +14,5 @@ -1 - \ No newline at end of file diff --git a/room/models/room_booking.py b/room/models/room_booking.py index 720922805..196a17788 100644 --- a/room/models/room_booking.py +++ b/room/models/room_booking.py @@ -81,6 +81,7 @@ class RoomBooking(models.Model): 'name': _("签到二维码"), 'res_model': 'room.booking.sign.wizard', 'views': [(False, 'form')], + 'target': 'new', 'context': { 'default_qrcode_image': qrcode_image, } @@ -97,23 +98,8 @@ class RoomBooking(models.Model): if attendee.get("userid", ""): user_obj = self.sudo().env["res_users"].search([("oauth_uid", '=', attendee.get("userid", ""))]) for obj in user_obj: - sign_obj = self.sudo().env["res_users"].search([("sign_user_id", '=', obj.id), ("room_booking_id", "=", record.id)]) - if sign_obj: - sign_obj.write({ - "room_booking_id": record.id, - "sign_user_id": obj.id, - "sign_user_name": obj.name, - "user_type": "insiders", - "sign_type": 'yes' - }) - else: - self.env["room.meeting.sign"].sudo().create({ - "room_booking_id": record.id, - "sign_user_id": obj.id, - "sign_user_name": obj.name, - "user_type": "insiders", - "sign_type": 'yes' - }) + sign_obj = self.sudo().env["room.meeting.sign"].search([("sign_user_id", '=', obj.id), ("room_booking_id", "=", record.id)]) + sign_obj.write({"sign_type": 'yes'}) @api.constrains("start_datetime", "stop_datetime") def _check_date_boundaries(self): diff --git a/website_form_room/views/webclient_templates.xml b/room/views/webclient_templates.xml similarity index 93% rename from website_form_room/views/webclient_templates.xml rename to room/views/webclient_templates.xml index 135d9bbf3..eefd3307a 100644 --- a/website_form_room/views/webclient_templates.xml +++ b/room/views/webclient_templates.xml @@ -1,7 +1,7 @@ -