[FIX] website: allow edit robots.txt to non-first website

Previous implementation always updated *current website*, which is not
always the same as the value from `res.config.settings`.

---

opw-2623007

X-original-commit: d66d44db031be76403ce7c01616e334ef196fd03
This commit is contained in:
Ivan Yelizariev
2021-08-17 11:03:09 +00:00
parent 437469b935
commit 0f3ea5e1f4
2 changed files with 5 additions and 0 deletions
@@ -168,6 +168,7 @@ class ResConfigSettings(models.TransientModel):
}
def action_open_robots(self):
self.website_id._force()
return {
'name': _("Robots.txt"),
'view_mode': 'form',
@@ -24,6 +24,9 @@ BaseSettingController.include({
* Without this override, it is impossible to go to a website other than the
* first because discarding will revert it back to the default value.
*
* Without this override, it is impossible to edit robots.txt website other than the
* first because discarding will revert it back to the default value.
*
* Without this override, it is impossible to install a theme on a website
* other than the first because discarding will revert it back to the
* default value.
@@ -32,6 +35,7 @@ BaseSettingController.include({
*/
_onButtonClicked: function (ev) {
if (ev.data.attrs.name === 'website_go_to'
|| ev.data.attrs.name === 'action_open_robots'
|| ev.data.attrs.name === 'install_theme_on_current_website') {
FormController.prototype._onButtonClicked.apply(this, arguments);
} else {