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

Hi,

any clue it can not find the menuitem? 


class SaleOrder(models.Model):

    _inherit = "sale.order"


    def action_update_payment_term(self):

        pass

...


<?xml version="1.0" encoding="UTF-8"?>

<odoo>

        <menuitem id="update_analaqua_payment_term"

            name="Actualizar metodo de pago"

            parent="sale.sale_order_menu"

            sequence="9"

            action="action_update_payment_term"/>

</odoo>

odoo.tools.convert.ParseError: "External ID not found in the system: payment_mode_update_analaqua.action_update_payment_term" while parsing /opt/odoo/custom-addons/payment_mode_update_analaqua/views/analaqua_update_payment_term_views.xml:8, near <menuitem id="update_analaqua_payment_term" name="Update payment term" parent="sale.sale_order_menu" sequence="9" action="action_update_payment_term"/>
Avatar
Discard
Author Best Answer

        <record model="ir.actions.server" id="action_update_payment_term">

            <field name="name">Actualizar metodo de pago</field>

            <field name="model_id" ref="sale.model_sale_order"/>

            <field name="state">code</field>

            <field name="code">

                action = model.action_update_payment_term()

            </field>

        </record>

Avatar
Discard
Best Answer

Hi,

You have to define the action inside the xml file,

<!--action of the patients menu-->
<record id="action_patient" model="ir.actions.act_window">
<field name="name">Patients</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hospital.patient</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{"search_default_female":1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create your First Patient !
</p>
</field>
</record>

<!--creating menus-->
<menuitem id="hospital_patient" name="Patients" parent="hospital_root" action="action_patient" sequence="10"/>

For more reference, see this:  Define New Menu and Actions in Odoo


Thanks

Avatar
Discard

Hello Niyas, thanks for your answer.

Is there a way to define action but not make it available? Trying to make a sub-menu to be used as father-menu for another menu. Hope its clear.

Related Posts Replies Views Activity
2
Nov 19
4073
2
Dec 23
12010
0
Oct 23
33
3
Oct 23
787
1
Oct 23
569