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

PLEASE HELP Many2many entries don't show up when I change how treeview columns are displayed

By
Henrique de Paula Lopes
on 10/31/16, 3:06 PM 125 views

Well, there's no simpler way to put it: I have a wizard that displays a many2many widget listing some entries. It all goes well until I edit, in the xml file, which columns from these entries are displayed.


class cest_wizard(models.TransientModel):
    _name = "account.product.fiscal.classification.cest_wizard"
    template_id = fields.Many2one('product.template', u'template', default=get_active_product_template, readonly=True)
    cest_ids = fields.Many2many(related='template_id.property_fiscal_classification.cest_ids')

here, cest_ids are a list of ids from the object whose form calls the widget. If I declare the widget as  

<field name="cest_ids" widget="many2many">

in the xml all the entries from the collection are correctly displayed. However, given that I want to show more columns than just the name of every object, I tried to change the piece of code above to 

<field name="cest_ids" widget="many2many"> 
     <tree string="Escolha o CEST mais apropriado">
          <field name="cest" />
          <field name="name" />
     </tree>
<field>

It simply stops working and shows nothing anymore (the table displays both columns but with zero entries). 


What am I doing wrong? 


Here's a visual example of how it works (and doesn't work): http://imgur.com/a/XbkLw


0
SREERAJ MDM
On 11/1/16, 12:55 AM

i am not sure but try it without

widget="many2many" 

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

1 follower(s)

Stats

Asked: 10/31/16, 3:06 PM
Seen: 125 times
Last updated: 11/1/16, 12:55 AM