Skip to Content
Menu
This question has been flagged
3 Replies
1732 Views

Hi everyone


I am trying to add an attribute on the button action with id %(action_repair_order_form)d


This button is added through src/enterprise/helpdesk_repair/views/helpdesk_views.xml

It is already an override of the standard helpdesk ticket view


The id of the record where we find this button action is : helpdesk_ticket_view_form_inherit_stock_user


So i am trying this : 


record id="inherited_helpdesk_ticket_view_form_inherit_stock_user" model="ir.ui.view"
        field name="name" helpdesk.ticket.form.inherit.repair.stock.user.custo
field name="model">helpdesk.ticket
field name="inherit_id" ref="helpdesk.ticket.helpdesk_ticket_view_form_inherit_stock_user"
​field name="priority">60
        field name="arch" type="xml"
            xpath expr="//header/button[@name='%(action_repair_order_form)d']" position="attributes"
                t t-if="repairs_count != 0"
                    attribute name="attrs">{'confirm': 'Une réparation ... une nouvelle réparation '}/attribute
                /t
            /xpath
        /field
    /record


But i am having the issue :

External ID not found in the system: helpdesk.ticket.helpdesk_ticket_view_form_inherit_stock_user


And ... I understand, but ... in this situation, what should I give in the field inherit_id to allow odoo to find this button action I want to override ?..


Thank you for your help !


Sorry for removing every '' but the site was replacing every code by blank ...

Avatar
Discard
Best Answer

Hello, I think you issue is that the inherit_id is not good. 

If you try to replace 

field name="inherit_id" ref="helpdesk.ticket.helpdesk_ticket_view_form_inherit_stock_user"/>

With :

field name="inherit_id" ref="helpdesk_repair.helpdesk_ticket_view_form_inherit_stock_user"/>

It should be ok

Make sure to also avec helpdesk_repair in the dependencies of your project

Avatar
Discard
Author Best Answer

Just to complete, when I am doing what I want directly inside the standard source code in  src/enterprise/helpdesk_repair/views/helpdesk_views.xml everything works fine of course. So I can add attributes I want according to conditions I want

The real problem I am facing, is how to do it, outside the standard code, in my custom module, in this specific case where the action is "dynamic", with an generated ID, and not an id I can make reference to in a chosen model


thanks


Thanks Mathis ! the good way to do it is 

%(helpdesk_repair.action_repair_order_form)d


With this syntax, I keep the format %(..)d and add the module name as prefix. It works ;) 

Avatar
Discard
Best Answer

Hi,

you can change the 'inherit_id with the following code :

<field name="inherit_id" ref="helpdesk_stock.ticket.helpdesk_ticket_view_form_inherit_stock_user"/>


Hope it helps

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 20
2685
12
Dec 18
33795
1
Jul 16
6260
1
Mar 15
7026
1
Mar 15
3134