Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

ValueError: No such external ID currently defined in the system in my wizard? [Closed]

By
evon_dun
on 6/5/13, 2:58 AM 1,668 views

The Question has been closed

by
Sudhir Arya (SA)
on 06/05/2013 04:43:30

I have created a module just like the Lunch module in the addons, my module is giftshop and i created two wizards in it that confirm and cancel order. Now what happens that my confirm wizard works fine but my cancel wizard doesn't. Everytime i try to upgrade my module it gives the above error defined in the title. here is the python code for wizard:

from osv import fields, osv

class gift_order_cancel(osv.osv_memory):
    _name = "gift.order.cancel"
    _description = "Cancel Order"

    def cancel(self, cr, uid, ids, context=None):
        if context is None:
            context = {}
        data = context and context.get('active_ids', []) or []
        return self.pool.get('gift.order').gift_order_cancel(cr, uid, data, context)

gift_order_cancel()

the xml:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

<!-- cancel order  -->

        <record id="view_gift_order_cancel" model="ir.ui.view">
            <field name="name">gift.order.cancel.form</field>
            <field name="model">gift.order.cancel</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Cancel Order">
                    <group colspan="4" >
                         <label string="Are you sure you want to cancel this order ?"/>
                    </group>
                        <separator string="" colspan="4" />
                    <group colspan="4" col="6">
                        <button  icon="gtk-cancel" special="cancel" string="No"/>
                        <button  icon="gtk-ok" name="cancel" string="Yes" type="object"/>
                   </group>
               </form>
            </field>
        </record>

        <record id="action_gift_order_cancel" model="ir.actions.act_window">
            <field name="name">Cancel Order</field>
            <field name="res_model">gift.order.cancel</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
           <field name="view_id" ref="view_gift_order_cancel"/>
           <field name="target">new</field>
        </record>

        <act_window id="action_gift_order_cancel_values"
            key2="client_action_multi" name="Cancel Order"
            res_model="gift.order.cancel" src_model="gift.order"
            view_mode="form" target="new" view_type="form"/>

    </data>
</openerp>

and the main xml from where i am invoking these two wizards :

                <button name="%(action_gift_order_confirm)d" string="Confirm Order" type="action" icon="gtk-ok" attrs="{'invisible':[('state','=','confirmed')]}"/>
                <button name="%(action_gift_order_cancel)d" string="Cancel Order" type="action" icon="gtk-cancel"/>

Please help!

3

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 6/5/13, 3:41 AM

Its a common error. I guess reason of this error is in __openerp__.py you have placed your main xml file before wizard's xml file.

You have to place xml files of wizards first and then your main xml file and then restart your server and update your module.

hey thanks it works now. :)

evon_dun
on 6/5/13, 3:49 AM

Thanks for the input, do not know where to find the source of this error.

Gustavo
on 9/10/13, 2:09 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 6/5/13, 2:58 AM
Seen: 1668 times
Last updated: 3/16/15, 8:10 AM