[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 150f63c1b6.
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) <ltu@odoo.com>
This commit is contained in:
Panagiotis Kyriakou
2022-08-03 06:34:15 +02:00
committed by Laurent Stukkens (LTU)
parent 8fc7aa4ff1
commit b2f4511454
@@ -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);