Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
4939 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

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

Avatar
Abbandona