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

call a wizard with a button (many2many field)

By
Francisco Castro
on 2/18/14, 9:53 AM 2,056 views

Hi guys

I want to call a wizard by clicking on a button I done this:

class conf_recinto(osv.osv):

_name = 'conf.recinto'

_description = 'Configurar Recinto'

_columns = {

    'name': fields.many2many('gs.recintos', 'wizard_recintos_rel', 'wizard_id', 'recinto_id',"")

            }
def teste(self, cr, uid, ids, context=None):

  return {
   'name': 'cria.edita.recinto.form',
   'type': 'ir.actions.act_window',
   'res_model': 'cria.edita.recinto',
   'view_mode': 'form',
   'view_type': 'form',
   'target': 'new',
   'context': context,

}

conf_recinto()

on the xml

<button name="%(gs_bilhetica.action_test_seq)d" type="action" string="Button" class="oe_highlight"/>

the button is working, with a char field but when I put a many2many field appears an error:

raise NotImplementedError('Many2Many columns should not be used as record name (_rec_name)') NotImplementedError: Many2Many columns should not be used as record name (_rec_name)

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/18/14, 9:53 AM
Seen: 2056 times
Last updated: 3/16/15, 8:10 AM