← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 668496] Re: [trunk] url wizard action not working

 

print_form = """<?xml version="1.0"?>
<form string="Imprimer les commandes ?">
    <field name="company_id"/>
</form>
"""

print_fields = {
    'company_id': {'string': 'Company', 'type': 'many2one', 'relation': 'res.company', 'required': True},
}

class wizard_forfait_print_orders(wizard.interface):
    def _printOrders(self, cr, uid, data, context):
        pool = pooler.get_pool(cr.dbname)
    
        jasper_obj = pool.get('jasper.server')
    
        ids = data['ids']
        form = data['form']
        company_id = form['company_id']
    
        url = jasper_obj.get_url(cr, uid, 'order', is_production='true', cie_id=company_id, order_id=ids[0], user_id=uid)
    
        return {
            'type': 'ir.actions.act_url',
            'url': url,
            'target': 'new'
        }
    
    states = {
        'init' : {
            'actions' : [],
            'result' : {'type' : 'form',
                        'arch' : print_form,
                        'fields' : print_fields,
                        'state' : [('end', 'Annuler'),('print', 'Imprimer') ]}
            },
        'print' : {
            'actions' : [],
            'result' : {'type' : 'action',
                        'action' : _printOrders,
                        'state' : 'end'}
            },
    }

wizard_forfait_print_orders('sale.order.forfait_print')

-- 
[trunk] url wizard action not working
https://bugs.launchpad.net/bugs/668496
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Web Client: New

Bug description:
I have a wizard that, when we click on a button, should open an URL on a new page. This button returns an "ir.actions.act_url" action with the url. The action executes well on the server, but the page is never shown in the browser. After investigation, it looks like that the problem comes from jQuery. So it is my patch :


web/addons/openerp/static/javascript/wizard.js

Line 56:

-    jQuery(form).submit();
+    form.submit();





References