Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
7373 Visualizações

I tried to inherit the treeview of stock.picking, if I try to modify the inherited treeview and make it editable, this change also occurs on the parent treeview. How can I avoid it? Is there any error in my source?

Thanks in advance

This is my code.

wizard.xml

<record id="shipping_carrier.picktree" model="ir.ui.view">
<field name="name">shipping.picking.tree</field>
<field name="model">stock.picking</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="location_dest_id" readonly="1"/>
<field name="partner_id"/>
<field name="date" invisible="1"/>
<field name="min_date"/>
<field name="origin"/>
<field name="group_id" invisible="1"/>
<field name="carrier_id"/>
<field name="backorder_id"/>
<field name="state"/>
<field name="weight"/>
<field name="priority" invisible="1"/>
<field name="picking_type_id" invisible="1"/>
</tree>
</field>
</record>

wizard.py


@api.multi
def shipping(self):
return {
'name' : _('Delivery Check'),
'views' : [(self.env.ref('shipping_carrier.picktree').id, 'tree')],
'view_mode': 'tree',
'type' : 'ir.actions.act_window',
'res_model': 'stock.picking',
'target' : 'new',
'domain' : [('state', '=', 'assigned'), ('min_date', '>=', self.date_start),
('min_date', '<=', self.date_end), ('carrier_id', '=', self.carrier_delivery_id.name)],

}
Avatar
Cancelar

Inheritance in models and view: https://goo.gl/fGNfBY

hope this helps you.

Melhor resposta

Give your inherited record a different id :

<record id="<your-custom-name>" model="ir.ui.view">

Also include the following before arch field.

<field name="inherit_id" ref="shipping_carrier.picktree"/>



Avatar
Cancelar
Autor

I used a form with a treeview inside

Publicações relacionadas Respostas Visualizações Atividade
4
jan. 18
3383
0
abr. 23
2854
2
jan. 23
8512
1
jul. 20
8328
1
mai. 20
2860