Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
184 Zobrazení

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)

Avatar
Zrušit
Autor

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

Nejlepší odpověď

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.

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
srp 25
1042
1
čvc 25
891
0
čvn 25
805
1
kvě 25
1464
2
bře 25
1881