Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] server_action_mass_edit: Don't do onchange #984

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions server_action_mass_edit/wizard/mass_editing_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,6 @@ def default_get(self, fields, active_ids=None):
res["selection__" + field.name] = "ignore"
return res

def onchange(self, values, field_name, field_onchange):
server_action_id = self.env.context.get("server_action_id")
server_action = self.env["ir.actions.server"].sudo().browse(server_action_id)
if not server_action:
return super().onchange(values, field_name, field_onchange)
dynamic_fields = {}
for line in server_action.mapped("mass_edit_line_ids"):
dynamic_fields["selection__" + line.field_id.name] = fields.Selection(
[()], default="ignore"
)
self._fields.update(dynamic_fields)
res = super().onchange(values, field_name, field_onchange)
for field in dynamic_fields:
self._fields.pop(field)
return res

@api.model
def _prepare_fields(self, line, field, field_info):
result = {}
Expand Down
Loading