Skip to Content
Menu
This question has been flagged
2 Replies
4413 Views

i want to show wizard button inside the action button in the form. (odoo13)

my model name is "ums" and wizard class model name is "fee.update.wizard", my form view name is "fee_update_form_wiz".
This is the code which i did in xml 

<record id="fee_update_action" model="ir.actions.act_window">
<field name="name">fee update action</field>
<field name="res_model">fee.update.wizard</field>
<field name="view_mode">form</field>
<field name="view_id" ref="ums.fee_update_form_wiz"/>
<field name="target">new</field>
<field name="binding_model_id" ref="model_ums"/>
<field name="binding_view_types">form</field>
</record>


this code show error and when i comment the "binding_model_id" then it doesnt show error but then it doesnt work.



THIS IS THE ERROR

File "/odoo/odoo-server/odoo/addons/base/models/ir_model.py", line 1674, in xmlid_lookup raise ValueError('External ID not found in the system: %s' % xmlid) odoo.tools.convert.ParseError: "External ID not found in the system: ums.model_ums" while parsing /odoo/custom/addons/ums/wizard/fee_wizard_view.xml:1, near <odoo> <data> <record id="fee_update_form_wiz" model="ir.ui.view"> <field name="name">fee update form wiz</field> <field name="model">fee.update.wizard</field> <field name="arch" type="xml"> <form string=""> <group> <field name="total_fee"/> </group> <footer> <button string="Update fee" type="object" name="update_student_fee"/> <button string="Cancel" special="cancel" class="btn btn-secondary"/> </footer> </form> </field> </record> <record id="fee_update_action_wizard" model="ir.actions.act_window"> <field name="name">fee update action wizard</field> <field name="type">ir.actions.act_window</field> <field name="res_model">fee.update.wizard</field> <field name="view_mode">form</field> <field name="target">new</field> </record> <record id="fee_update_action" model="ir.actions.act_window"> <field name="name">fee update action</field> <field name="res_model">fee.update.wizard</field> <field name="view_mode">form</field> <field name="view_id" ref="ums.fee_update_form_wiz"/> <field name="target">new</field> <field name="binding_model_id" ref="model_ums"/> <field name="binding_view_types">form</field> </record> </data>

Avatar
Discard
Best Answer

To use the binding_model_id you have to mention your module folder name before model_ums

<field name="binding_model_id" ref="[Module_name].model_ums"/>
If your module named ums the ref will be "ums.model_ums"

 <field name="binding_model_id" ref="ums.model_ums"/>
Avatar
Discard
Author Best Answer

Thank You so much. the folder name was "ums" and the model was"student fee" so it worked. 

Avatar
Discard