Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2144 Zobrazení

Hi! 


I'm trying to show data from product_template model on a custom addon, but I'm facing that error. Why? What I'm doing wrong? 


Here is part of my Model code : 

class tienda(models.Model):

_name="tienda.tienda"

_auto= False

_description="Gestion de tienda"


product = fields.Many2one('product.template')

name= fields.Char(string="Producto", related="product.name")



And Here is my view 

<record id="action_tienda_tree" model="ir.ui.view">

<field name="name">tienda.tienda.tree</field>

<field name="model">tienda.tienda</field>

<field name="arch" type="xml">

<tree>

<field name="producto" />

</tree>

</record>

</field>


And the error says : "KeyError: 'Field name referenced in related field definition tienda.tienda.name does not exist.'"

Thanks for the explanation.


Avatar
Zrušit
Nejlepší odpověď

Hi,

Recheck the field defined in your view, replace it with product or name as you dont have a field producto defined in your py file.​

Thanks

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
zář 21
9500
4
led 20
3323
0
lis 18
4561
0
dub 17
3792
3
říj 22
6049