跳至内容
菜单
此问题已终结
1 回复
1889 查看

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.


形象
丢弃
最佳答案

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

形象
丢弃
相关帖文 回复 查看 活动
3
9月 21
9392
4
1月 20
3203
0
11月 18
4437
0
4月 17
3660
3
10月 22
5907