Skip to content

[16.0] Conflict between server_action_navigate and base_automation due to delete_last_line method #387

@Honeyxilia

Description

@Honeyxilia

Is your feature request related to a problem?
Currently, the server_action_navigate module adds the delete_last_line method to the ir.actions.server model through inheritance, then links that action to a button through a base.view_server_action_form view inheritance.

However, this causes a conflict with the base_automation Odoo module, and its base.automation model - indeed, the base.automation model inherits from ir.actions.server fields (through the delegated action_server_id field), which renders the later's fields accessible, but not its methods, incl. delete_last_linne.

This is problematic in regards to the view_base_automation_form view, which inherits from the view_action_server_form view - as such, when both modules are installed, the view_base_automation_form view won't pass the view validation, since base.automation doesn't have the delete_last_line required by the added button.

Describe the solution you'd like
To remediate this issue, we propose to add the following snippet of code, through a dedicated auto_install module when both server_action_navigate and base_automation are installed, which calls the same method through the action_server_id attribute - and since this relation delegates its fields to the base.automation object, the same modifications should be applied.

# models/base_automation.py
from odoo import models

class BaseAutomation(models.Model):
    _inherit = "base.automation"

    def delete_last_line(self):
        self.action_server_id.delete_last_line()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions