From 8da3b25b2ebb7881efe8fcfc44c0021876c6e09b Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Tue, 20 Dec 2022 11:24:10 +0000 Subject: [PATCH] [FIX] sms: improper reload of form view after sms wizard on new record **Issue:** - Install crm (to have a form view with phone field). - Click crm icon. - Open list view. - Create a new record. - Enter title and phone number. - Click sms button from the right of phone number field. - On the wizard (dialog), enter a message and send. - The wizard is closed but (BUG) the form view returns to the state where a new record is being created. **Solution:** The record containing the new sms message is properly created, however the form view is reloaded with undefined `resId`, thus the form reloaded as if it is "new". The simplest fix is to specify the `resId` of the newly created record in the `model.load` call as proposed in this commit. closes odoo/odoo#108431 X-original-commit: edaf37eeb9244976ecc6c60aec089f9a2b4e3020 Signed-off-by: Simon Genin (ges@odoo) Signed-off-by: Joseph Caburnay (jcb) --- addons/sms/static/src/components/sms_button/sms_button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b1ecc30d17e..fcc9ea57f1b 100644 --- a/addons/sms/static/src/components/sms_button/sms_button.js +++ b/addons/sms/static/src/components/sms_button/sms_button.js @@ -27,7 +27,7 @@ export class SendSMSButton extends Component { } }, { onClose: () => { - this.props.record.model.load() + this.props.record.model.load({ resId: this.props.record.resId }); }, }); }