Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3568 Lượt xem

I'm trying to show 3 columns in a treeview. But somehow it's only showing one column. (The Model name column)


This is my treeview xml record:  

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

    <field name="name">car.model.tree</field>

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

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

        <tree string="Models">

            <field name="brand_name"/>

            <field name="name"/>

            <field name="description"/>

        </tree>

    </field>

</record>


And this is my model class:  

from odoo import fields, models



class CarModel(models.Model):

    _name = "car.model"

    _description = "Car Model Table"


    name = fields.Char(string="Model name", required=True)

    description = fields.Text(string="Description")


    brand_name = fields.Many2one('car.brand', 'Brand name')


Checked __manifest__.py and also security csv and everything seems correct.

I'm working with Odoo version 13.0 Community Edition.

(Question also asked on StackOverflow: https://stackoverflow.com/questions/64113753/odoo-column-is-not-showing)

Ảnh đại diện
Huỷ bỏ

Are you sure you updated your apps list and/or updated the app itself?

Tác giả Câu trả lời hay nhất

Found the issue. I had to change the order of the import in the __init__.py,

Thanks anyways!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 1 21
4697
1
thg 1 20
5749
3
thg 4 25
4708
4
thg 5 24
12636
1
thg 4 24
3273