server-backend icon indicating copy to clipboard operation
server-backend copied to clipboard

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

Open Honeyxilia opened this issue 2 months ago • 1 comments

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()

Honeyxilia avatar Oct 28 '25 17:10 Honeyxilia

Hi @Honeyxilia. Thanks for reporting. Sorry, I don't understand the problem. I installed base_automation and server_action_navigate in a fresh database, and don't face any issue. Could you elaborate the steps to reproduce ?

thanks !

legalsylvain avatar Oct 28 '25 21:10 legalsylvain