Hello !
I get troubles to fill fields of my model opened in edit form view.
Here are some screens of the usecase :
http://imgur.com/G1ptWXN
http://imgur.com/lWrrDRj
http://imgur.com/1FvI25l
In the URL, I can see the active_id (or active_ids) of my products on the second screenshot. But my trouble is in filling the field Article with them (WITHOUT saving it : I want the user to choose to save or not)
Here is the code of my "new" button action right now :
def new_match(self):
return{ 'name':("Save a new matching"), 'view_mode': 'form', 'view_type': 'form', 'view_id': False, 'res_model': 'label.label', 'res_id': self.id, 'type': 'ir.actions.act_window', 'target': 'current', 'domain': '[]', 'flags': {'initial_mode': 'edit',} , '_default':{'products':[(6,0,[self._context.get('active_ids')])]}, } |
I tried a lot of stuff that didn't work, without giving me any error or stuff. I'm a bit lost here
If someone could give me solution or part of it that'd be great ! :)
Thanks !
The code of my list view :
<record model="ir.ui.view" id="label.tree_new_match">
<field name="name">Create Matching</field>
<field name="model">label.label</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="arch" type="xml">
<tree colors="red:status=='OFFLINE';black:len(products)!=0;green:len(products)==0" default_order='len_products, real_id' create='false' delete='false'>
<button string="New" type="object" name="new_match"/>
<field name="description" string="Name"/>
<field name="real_id"/>
<field name="type"/>
<field name="products"/>
<field name="status"/>
<field name="len_products" invisible="context.get('len_products')!=1000"/>
</tree>
</field>
</record>