Odoo Help


Setting Values using wizard form

on 3/25/16, 9:27 AM 710 views

Hi everyone,

In my article form I had added a smart button that call a wizard form I need to set the active_id to the article_id using the wizard form how could I doing this?

Here is my python code:

from openerp.osv import osv
from openerp.osv import fields
from openerp.tools.translate import _
class comment_wizard(osv.osv_memory):
    _name = 'comment.wizard'
    _columns = {
        'new_comment': fields.text('New Comment')
  def save_button(self, cr, uid, ids, context=None):
        if 'active_id' in context:
            info = self.browse(cr, uid, ids)[0].new_comment
            comm_req = self.pool.get('comment.comment')
            for comm_data in comm_req.browse(cr, uid, context.get('active_ids'), context=context):
        return {'type':'ir.actions.act_window_close'}
class comment_comment(osv.osv):

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

1 follower(s)


Asked: 3/25/16, 9:27 AM
Seen: 710 times
Last updated: 3/25/16, 9:34 AM