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

Wizard won't Start when button is pressd

By
David Brilliant
on 2/20/14, 7:50 PM 794 views

I'm trying to make a simple wizard. The code I've constructed compiles successfully, but when I press the button from the stock.picking.out screen it loads, and does nothing. No wizard. What am I missing here?

wizard's object file:

from openerp.osv import fields, osv
class pick_ticket(osv.osv_memory):
  _name = "pick.ticket"
  _description = "Pick Ticket Wizard"

function which calls the wizard:

class res_partner(osv.osv):
_inherit = 'stock.picking'
def generate_pick_ticket(self, cr, uid, ids, context=None):
    if context is None:
        context = {}
    """Open the partial picking wizard"""
    context.update({
        'active_model': self._name,
        'active_ids': ids,
        'active_id': len(ids) and ids[0] or False
    })
    return {
        'view_type': 'form',
        'view_mode': 'form',
        'res_model': 'pick.ticket.wizard', #this needs to be identical to res_model
        'type': 'ir.actions.act_window',
        'target': 'new',
        'context': context,
        'nodestroy': True,
    }

the XML file included in /wizard

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
    <record id="action_partial_picking" model="ir.actions.act_window">
        <field name="name">Pick Ticket</field>
        <field name="res_model">pick.ticket.wizard</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>
    </record>

</data>
 </openerp>

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: 2/20/14, 7:50 PM
Seen: 794 times
Last updated: 3/16/15, 8:10 AM