Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
478 Widoki

Hi,


I am trying to inherit action "Reserve" from model mrp.production to model mrp.workorder


I dont have access to server machine so I am trying to creat server action and contextual action button, is this possible? I am running Odoo 14 community version

Awatar
Odrzuć
Najlepsza odpowiedź

In Odoo 14 Community Edition, you can indeed create server actions and contextual action buttons, even if you don’t have direct access to the server machine. Here’s a general approach to achieve this.
# Find the action from mrp.production

production_action = env['ir.actions.server'].search([('model_id.model', '=', 'mrp.production'), ('name', '=', 'Reserve')], limit=1)


# Check if action is found

if production_action:

    # Call the action

    production_action.with_context(active_ids=record.ids).run()

and Go to Settings > Technical > User Interface > Views.
you have to add button - button name="%(your_server_action_id)d" type="action" string="Reserve" class="btn-primary"/>

Awatar
Odrzuć