summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorRomain Derie <rde@odoo.com>2018-11-07 09:47:12 +0000
committerRomain Derie <rde@odoo.com>2018-11-08 10:52:44 +0000
commit7aa213693841019fb66e5b5813f976a6eac68b8e (patch)
tree05908f77431fb6672cb9df2f8c77fbe105ff03ba /addons/web/static/src/js/fields/basic_fields.js
parent47959438b6c106e6c9f2f8d849439edf370f390c (diff)
[FIX] website: avoid using self if not an existing view
web_editor dirty elements are saved by calling the ir.ui.view `save()` method. As this method is called through call_kw _rpc on the ir.ui.view model, self is binded to the view which has the `id` sent in the request. In some cases, when editing a field for example, the id sent is the id of the field's record (eg: product.template for price field). In that case, the view binded on self will be the view with the id of the field's record being edited. If there is no ir.ui.view with the same ID as the field's record, self won't exists. This misbehavior resulted in no error luckily since we only use self to call ir.ui.view methods without ever using self properties. Since multi-website 47b00c5d533 overrided the `save()` method and used self.key it was crashing when the self record did not exists. This commit will fix that by doing the multi-website check only when it is a view and not a field that is being edited. (We know that if xpath is set) opw-1904637 Step to reproduce: - Go to a product on ecommerce, eg product.template 13013 - Edit the product price field, the oe-id attribut is 13013 - Delete the ir.ui.view that has the same ID than the product (13013) - Save -> It will crash since self is binded to "ir.ui.view(13013,)" but it does not exists and we try to access key closes odoo/odoo#28469
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions