Create an automation rule for a field for which there's no onchange
yet. The rule type is "on_change" (on UI change).
This type of automation rule adds an onchange method on the
selected fields, which thus involve the onchange mecanism: the
"on_change" attribute will be set on that field nodes in views,
s.t. when the user changes it, onchange rpcs are done.
However, views are cached, and creating such a rule didn't clear
the cache. So if the view was already in cache, the rule seemed
not to work, because the client still received the old version of
the view, without the "on_change" attribute.
This commit clears the cache when such a rule is created, s.t.
after a client reload, the feature gets enabled as expected.
opw 3701125
closesodoo/odoo#152498
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>