Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
1881 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
3
sep. 21
9389
4
jan. 20
3197
0
nov. 18
4431
0
apr. 17
3653
3
okt. 22
5899