콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
169 화면

I get this error and I don't know how to fix it:

odoo.tools.convert.ParseError: while parsing /mnt/extra-addons/packing_operation/views/packing_order_views.xml:4, somewhere inside
<record id="view_packing_order_tree" model="ir.ui.view">
    <field name="name">packing.order.tree</field>
    <field name="model">packing.order</field>
    <field name="arch" type="xml">
        <tree>
            <field name="name"/>
            <field name="state" widget="badge" options="{'style': 'color'}"/>
            <field name="user_id"/>
            <field name="full_packing_date"/>
        </tree>
    </field>
    </record>

ChatGPT thinks that tree is OK for ir.ui.view.type.

My model:

class PackingOrder(models.Model):


    _name = "packing.order"

    _description = "Packing Order"


    name = fields.Char(string="Task number",

                       required=True,

                       copy=False,

                       default="New",

    )


    user_id = fields.Many2one("res.users", string="Operator")

    cancellation_reason = fields.Text(string="Cancel reason")

    line_ids = fields.One2many("packing.order.line",

                               "order_id",

                               string="Order lines",

                               )

    full_packing_date = fields.Datetime(

        string="Date of full packing", readonly=True

    )

    barcode_scanner = fields.Char(string="Scanner (product ID)")


    state = fields.Selection([

    ('waiting', 'Waiting'),

    ('in_progress', 'In progress'),

    ('done', 'Done'),

    ('cancel', 'Cancel'),

    ], string="Status", compute='_compute_state', store=True)

아바타
취소
작성자

Thank you very much for answer. Spent a day trying to fix it.

베스트 답변

In Odoo 18, the tree view is no longer supported – it has been fully replaced by list. Sometimes ChatGPT (or even developers who are used to older versions) might still assume that tree is valid because it was used up to Odoo 16. But in reality, from Odoo 17 onward, you must use list instead of tree for list views.

아바타
취소
관련 게시물 답글 화면 활동
0
8월 25
1034
1
7월 25
890
0
6월 25
803
1
5월 25
1462
2
3월 25
1877