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

module does nothing when i run it

By
kaynis
on 8/21/13, 5:23 AM 1,018 views

the module loads but does nothing when i run it what could i be doing wrong. And no error given

class sale_order_confirm(osv.osv):
_name = 'sale.order.confirm'
_inherit = "sale.order"


def my_action_button_confirm(self, cr, uid, ids, context=None):
    wf_service = netsvc.LocalService('workflow')
    if context is None:
        context = {}

  #  record_id = context and context.get('ids', False)
    pool_obj = pooler.get_pool(cr.dbname)
    order = pool_obj.get('sale.order').read(cr, uid, ids, ['state'], context=context)
    for o in order:
        if not o.order_line:
            raise osv.except_osv(_('Error'),_("Cannot confirm order without order line"))
        wf_service.trg_validate(uid, 'sale.order', o.id, 'order_confirm', cr)

   #        view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'view_order_form')
   #        view_id = view_ref and view_ref[1] or False,

    return {'type': 'ir.actions.act_window_close'}

   sale_order_confirm()

   <openerp>
       <data>
    <record id="view_sale_confirm_order" model="ir.ui.view">
        <field name="name">sale.order.confirm.form1</field>
        <field name="model">sale.order.confirm</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Confirm Sale Orders">
                <separator colspan="4" string="Do you really want to confirm order(s) ?" />
                <separator string="" colspan="6"/>
                <button special="cancel" string="Cancel" icon="gtk-cancel"/>
                <button name="my_action_button_confirm" string="Confirm SO" icon="gtk-execute" type="object"/>
           </form>
        </field>
    </record>        

    <act_window id="action_sale_order_confirm_sales"
        multi="True"
        key2="client_action_multi" name="Confirm SO"
        res_model="sale.order.confirm" src_model="sale.order"
        view_mode="form" target="new" view_type="form" />

    <record model="ir.values" id="sale_order_confirm_sales">
        <field name="model_id" ref="sale.model_sale_order" />
        <field name="name">Confirm SO</field>
        <field name="value" eval="'ir.actions.act_window,' + str(ref('action_sale_order_confirm_sales'))"/>
        <field name="key">action</field>
        <field name="model">sale.order</field>
    </record>

</data>

</openerp>

help please and thank you in advance log message is

2013-08-20 15:30:14,575 7100 INFO ? werkzeug: 127.0.0.1 - - [20/Aug/2013 15:30:14] "POST /web/action/load HTTP/1.1" 200 -
2013-08-20 15:30:14,851 7100 INFO ? werkzeug: 127.0.0.1 - - [20/Aug/2013 15:30:14] "POST /web/view/load HTTP/1.1" 200 -
2013-08-20 15:30:15,608 7100 INFO ? werkzeug: 127.0.0.1 - - [20/Aug/2013 15:30:15] "POST /web/dataset/create HTTP/1.1" 200 -
2013-08-20 15:30:15,742 7100 INFO ? werkzeug: 127.0.0.1 - - [20/Aug/2013 15:30:15] "POST /web/dataset/get HTTP/1.1" 200 -
2013-08-20 15:30:15,946 7100 INFO ? werkzeug: 127.0.0.1 - - [20/Aug/2013 15:30:15] "POST /web/dataset/call_button HTTP/1.1" 200 -
2013-08-20 15:30:15,966 7100 INFO ? werkzeug: 127.0.0.1 - - [20/Aug/2013 15:30:15] "POST /web/session/eval_domain_and_context HTTP/1.1" 200 -
2013-08-20 15:30:16,188 7100 INFO ? werkzeug: 127.0.0.1 - - [20/Aug/2013 15:30:16] "POST /web/dataset/search_read HTTP/1.1" 200 -

Please upgrade the module once again through your web client and then you can see the changes

Abhishek H Menon
on 8/21/13, 10:40 AM

I have done that over and over even restarted the whole machine nothing happened. Thanks for responding

kaynis
on 8/21/13, 11:10 AM

please verify the model you defined in Settings>Customisation>Database Structure > Models and check for the model. Is it there? If it is there please verify the fields that you have added while creating your model

Abhishek H Menon
on 9/13/13, 4:40 AM

This did not work still. I have tried what you suggested but no difference

kaynis
on 9/13/13, 1:47 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

0 follower(s)

Stats

Asked: 8/21/13, 5:23 AM
Seen: 1018 times
Last updated: 3/16/15, 8:10 AM