تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3395 أدوات العرض

I have found several posts that states that it's possible to modify the parameters of an action from a custom module the following way:

for the action open_create_project in the module project

<record id="open_create_project" model="ir.actions.act_window">

<field name="name">Create a Project</field>
<field name="res_model">project.project</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="project_project_view_form_simplified"/>
<field name="target">new</field>
</record>

to modifiy it we create an action with an id such as original_module.id_of_the_action, so project.open_create_project in this case.

    <record id="project.open_create_project" model="ir.actions.act_window">
        <field name="name">New name for the action</field>
     </record>

And then we can add the fields that we want to change.


But I didn't found anything regarding this in the documentation of odoo. When I tried it it seems to work at first, but after another update of the custom module the change of the name seems to disappear sudently. So is this something that is supported or just a kind of hack that should be avoided?

الصورة الرمزية
إهمال
أفضل إجابة

Hi Francois,

This is standard practice in Odoo.

Just make sure that your module depends on the project module, otherwise if the project module is updated, it will refresh without your modules changes.

Also just make sure the file hasn't been removed from the manifest, I know it's happened to me on more than one occasion.

Cheers,
Jake Robinson

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
سبتمبر 19
4182
0
أغسطس 19
3940
3
نوفمبر 20
11948
1
يونيو 20
2697
0
سبتمبر 19
3339