From b2f4511454d4f27a03032e8c05cd5ad7fd7b31a4 Mon Sep 17 00:00:00 2001 From: Panagiotis Kyriakou Date: Tue, 2 Aug 2022 09:02:57 +0000 Subject: [PATCH] [FIX] hr_timesheet: fix error thrown when accessing configuration page This commit fixes an "Uncaught Promise" error that is thrown when the timesheets configuration page is accessed since 150f63c1b69998ecc5f0cf702071b1dde88018f6. The error stems from the appStoreWidget component and specifically from how the component props are handled. closes odoo/odoo#97341 Signed-off-by: Laurent Stukkens (ltu) --- .../src/app_store_widget/app_store_widget.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/addons/hr_timesheet/static/src/app_store_widget/app_store_widget.js b/addons/hr_timesheet/static/src/app_store_widget/app_store_widget.js index b5d3cad3eb0..eb49624c313 100644 --- a/addons/hr_timesheet/static/src/app_store_widget/app_store_widget.js +++ b/addons/hr_timesheet/static/src/app_store_widget/app_store_widget.js @@ -45,6 +45,15 @@ class AppStoreWidget extends Component { } } AppStoreWidget.template = "hr_timesheet.AppStoreWidget"; +AppStoreWidget.props = { + ...standardWidgetProps, + type: { type: String }, +}; +AppStoreWidget.extractProps = ({ attrs }) => { + return { + type: attrs.type, + }; +}; class AppStoreQRDialog extends Component { setup() { @@ -58,13 +67,5 @@ class AppStoreQRDialog extends Component { } AppStoreQRDialog.components = { Dialog }; AppStoreQRDialog.template = "hr_timesheet.AppStoreQRDialog"; -AppStoreQRDialog.props = { - ...standardWidgetProps, - type: { type: String }, -}; -AppStoreQRDialog.extractProps = ({ attrs }) => { - return { - type: attrs.type, - }; -}; + registry.category("view_widgets").add("hr_timesheet.app_store_widget", AppStoreWidget);