Skip to content

[14] web_ir_actions_act_view_reload: Not showing data written before Action #2200

@joshkreud

Description

@joshkreud

Module

web_ir_actions_act_view_reload

Describe the bug

When triggering a view reload with {"type": "ir.actions.act_view_reload",} it doesn't load the data that got written, just before returning the action

To Reproduce

Add a function like this to any model that exposes a name field to it's form view.
Name some record Before.

def handle_reload(self):
  # Function to swap name anytime it's called. 
  if self.name == "Before":
    self.name = "After" 
  else:
    self.name = "Before
  return {"type": "ir.actions.act_view_reload",}

Steps to reproduce the behavior:

  1. Trigger the action
  2. Reload is triggered in js. Name displayed is still Before but value in Record is after (verify by odoo-bin shell or another browser tab)
  3. Trigger action again. Name displayed is now After. But value in record is Before again.

Expected behavior
I expect, that the reload gets the state of the record after the action got run, not before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstalePR/Issue without recent activity, it'll be soon closed automatically.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions