Skip to Content
Menu
This question has been flagged

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


Avatar
Discard
Best Answer

i am not sure but try it without

widget="many2many" 

Avatar
Discard
Related Posts Replies Views Activity
1
Jul 18
2573
0
May 16
2211
1
Jan 16
6330
0
Jan 16
2526
1
Jun 15
12694