تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
164 أدوات العرض

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
أغسطس 25
1033
1
يوليو 25
889
0
يونيو 25
803
1
مايو 25
1462
2
مارس 25
1876