I have a wizard defined. I am able to open the wizard with a menu item, as seen on the screenshot below (Quick Create Project). But how can I override the New button (circled)?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
Hi,
You can hide the default “New” button and replace it with your own button that opens the wizard.
<record id="view_project_tree_inherit" model="ir.ui.view">
<field name="name">project.project.tree.inherit</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.view_project_tree"/>
<field name="arch" type="xml">
<!-- Hide default "New" button -->
<xpath expr="//tree" position="attributes">
<attribute name="create">false</attribute>
</xpath>
<!-- Add custom button to trigger wizard -->
<xpath expr="//tree" position="after">
<header>
<button name="%(your_wizard_action)d"
type="action"
string="New"
class="oe_highlight"/>
</header>
</xpath>
</field>
</record>
Hope it helps.
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
1
سبتمبر 25
|
319 | ||
|
2
أغسطس 25
|
555 | ||
|
2
أغسطس 25
|
640 | ||
|
2
أغسطس 25
|
692 | ||
|
0
أغسطس 25
|
597 |