diff --git a/addons/sms/static/src/components/phone_field/phone_field.xml b/addons/sms/static/src/components/phone_field/phone_field.xml index 337648d5d23..e73c030b467 100644 --- a/addons/sms/static/src/components/phone_field/phone_field.xml +++ b/addons/sms/static/src/components/phone_field/phone_field.xml @@ -4,7 +4,7 @@ - + diff --git a/addons/sms/static/src/components/sms_button/sms_button.js b/addons/sms/static/src/components/sms_button/sms_button.js index 7165e9bbf4f..b99790dfea8 100644 --- a/addons/sms/static/src/components/sms_button/sms_button.js +++ b/addons/sms/static/src/components/sms_button/sms_button.js @@ -7,16 +7,27 @@ const { Component } = owl; export class SendSMSButton extends Component { setup() { this.action = useService("action"); + this.user = useService("user"); this.title = this.env._t("Send SMS Text Message"); } onClick() { this.action.doAction({ type: "ir.actions.act_window", - name: this.title, - res_id: this.props.record.resId, - res_model: "sms.composer", target: "new", + name: this.title, + res_model: "sms.composer", views: [[false, "form"]], + context: { + ...this.user.context, + default_res_model: this.props.record.resModel, + default_res_id: this.props.record.resId, + default_number_field_name: this.props.name, + default_composition_mode: 'comment', + } + }, { + onClose: () => { + this.props.record.model.load() + }, }); } }; diff --git a/addons/sms/static/src/components/sms_button/sms_button.xml b/addons/sms/static/src/components/sms_button/sms_button.xml index 9a95c863990..2b37bdceac9 100644 --- a/addons/sms/static/src/components/sms_button/sms_button.xml +++ b/addons/sms/static/src/components/sms_button/sms_button.xml @@ -5,7 +5,7 @@ SMS