Odoo Help


Before saved,how can I move my wizard's data to move_lines

on 1/10/14, 5:22 AM 1,252 views

Hi,ereryone, I want to use wizard to do the "Add an Item". I add "My add" after "Add an Item". when I click "My add", it will pop wizard. But after I choose product, move_lines doesn't have any data lines. the following is my question: How can I move my wizard data to move_lines?


class stock_move_product(osv.osv_memory): _name = "stock.move.product" _columns = { 'product_id': fields.many2one('product.product', 'Product', required=True, select=True),
'product_qty': fields.float('Quantity', digits_compute=dp.get_precision('Product Unit of Measure'), required=True),

def default_get(self, cr, uid, fields, context=None):
    if context is None:
        context = {}
    res = super(stock_move_product, self).default_get(cr, uid, fields, context=context)
    '''move = self.pool.get('stock.move').browse(cr, uid, context['active_id'], context=context)
    if 'product_id' in fields:
        res.update({'product_id': move.product_id.id})
    if 'product_uom' in fields:
        res.update({'product_uom': move.product_uom.id})'''
    return res

def do_move_product(self, cr, uid, ids, context=None):
    return {'type': 'ir.actions.act_window_close'}


<openerp> <data> <record id="view_stock_move_product_wizard" model="ir.ui.view"> <field name="name">Product Move</field> <field name="model">stock.move</field> <field name="type">form</field> <field name="arch" type="xml"> <form string="Product Move" version="7.0"> <group string="Move Products"> <field name="product_id"/> <field name="product_qty"/> </group> <footer> <button name="do_move_product" string="Ok" type="object" class="oe_highlight"/> or <button string="Cancel" class="oe_link" special="cancel"/> </footer> </form> </field> </record>

    <record id="move_product" model="ir.actions.act_window">
        <field name="name">Product Move</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">stock.move</field>
        <field name="src_model">product.product</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="target">new</field>


About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 1/10/14, 5:22 AM
Seen: 1252 times
Last updated: 3/16/15, 8:10 AM