Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
154 Widoki

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)

Awatar
Odrzuć
Autor

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

Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
sie 25
1026
1
lip 25
888
0
cze 25
803
1
maj 25
1459
2
mar 25
1874