diff --git a/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js b/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js index 357f472c651..b15cfa83630 100644 --- a/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js +++ b/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js @@ -415,7 +415,7 @@ export class AnalyticDistribution extends Component { async save() { const currentDistribution = this.listForJson; const dataToSave = currentDistribution; - await this.props.update(dataToSave); + await this.props.record.update({ [this.props.name]: dataToSave }); } onSaveNew() { diff --git a/addons/mail/static/src/views/fields/assign_user_command_hook.js b/addons/mail/static/src/views/fields/assign_user_command_hook.js index 39440f3e485..07592037215 100644 --- a/addons/mail/static/src/views/fields/assign_user_command_hook.js +++ b/addons/mail/static/src/views/fields/assign_user_command_hook.js @@ -33,22 +33,26 @@ export function useAssignUserCommand() { const add = async (record) => { if (component.props.type === "many2one") { - component.props.update(record); + component.props.record.update({ [component.props.name]: record }); } else if (component.props.type === "many2many") { - component.props.update({ - operation: "REPLACE_WITH", - resIds: [...getCurrentIds(), record[0]], + component.props.record.update({ + [component.props.name]: { + operation: "REPLACE_WITH", + resIds: [...getCurrentIds(), record[0]], + }, }); } }; const remove = async (record) => { if (component.props.type === "many2one") { - component.props.update([]); + component.props.record.update({ [component.props.name]: [] }); } else if (component.props.type === "many2many") { - component.props.update({ - operation: "REPLACE_WITH", - resIds: getCurrentIds().filter((id) => id !== record[0]), + component.props.record.update({ + [component.props.name]: { + operation: "REPLACE_WITH", + resIds: getCurrentIds().filter((id) => id !== record[0]), + }, }); } }; diff --git a/addons/mrp/static/src/widgets/timer.js b/addons/mrp/static/src/widgets/timer.js index f3d8dedc538..365e2efd3a0 100644 --- a/addons/mrp/static/src/widgets/timer.js +++ b/addons/mrp/static/src/widgets/timer.js @@ -8,7 +8,7 @@ import { standardFieldProps } from "@web/views/fields/standard_field_props"; const { Component, useState, onWillUpdateProps, onWillStart, onWillDestroy } = owl; -function formatMinutes(value) { +export function formatMinutes(value) { if (value === false) { return ""; } diff --git a/addons/project/static/src/project_sharing/components/chatter/chatter_composer.js b/addons/project/static/src/project_sharing/components/chatter/chatter_composer.js index f4219ea8acb..3905c3eba29 100644 --- a/addons/project/static/src/project_sharing/components/chatter/chatter_composer.js +++ b/addons/project/static/src/project_sharing/components/chatter/chatter_composer.js @@ -4,8 +4,7 @@ import { useService } from '@web/core/utils/hooks'; import { TextField } from '@web/views/fields/text/text_field'; import { PortalAttachDocument } from '../portal_attach_document/portal_attach_document'; import { ChatterAttachmentsViewer } from './chatter_attachments_viewer'; - -const { Component, useState, onWillUpdateProps } = owl; +import { Component, useState, onWillUpdateProps, useRef } from "@odoo/owl"; export class ChatterComposer extends Component { setup() { @@ -16,6 +15,7 @@ export class ChatterComposer extends Component { message: '', loading: false, }); + this.inputRef = useRef("textarea"); onWillUpdateProps(this.onWillUpdateProps); } @@ -23,6 +23,7 @@ export class ChatterComposer extends Component { onWillUpdateProps(nextProps) { this.clearErrors(); this.state.message = ''; + this.inputRef.el.value = ""; this.state.attachments = nextProps.attachments.map(file => file.state === 'done'); } @@ -30,9 +31,9 @@ export class ChatterComposer extends Component { return `${window.location.href.split('#')[0]}#discussion`; } - update(change) { + update() { this.clearErrors(); - this.state.message = change; + this.state.message = this.inputRef.el.value; } prepareMessageData() { diff --git a/addons/project/static/src/project_sharing/components/chatter/chatter_composer.xml b/addons/project/static/src/project_sharing/components/chatter/chatter_composer.xml index 6fda276a2a4..47cf7239a38 100644 --- a/addons/project/static/src/project_sharing/components/chatter/chatter_composer.xml +++ b/addons/project/static/src/project_sharing/components/chatter/chatter_composer.xml @@ -20,11 +20,13 @@