Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1948 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Many2one related field แก้ไขแล้ว
3
ก.ย. 21
9420
Representation of Many2one in view แก้ไขแล้ว
4
ม.ค. 20
3224
0
พ.ย. 18
4465
0
เม.ย. 17
3697
3
ต.ค. 22
5952