Glenn
Glenn

Reputation: 34

Odoo 13: field 'product_uom_category_id' does not exist

This is my view:

<record id="view_order_form_inherit_sale_stock" model="ir.ui.view">
    <field name="name">sale.management.order.form</field>
    <field name="model">sale.order</field>
    <field name="inherit_id" ref="sale_stock.view_order_form_inherit_sale_stock"/>
    <field name="arch" type="xml">
        <xpath expr="//group[@name='sale_shipping']" position="attributes">
            <attribute name="invisible">1</attribute>
        </xpath>
    </field>
</record>

This is the error:

Odoo Server Error

Traceback (most recent call last):
  File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 394, in _check_xml
    self.postprocess_and_fields(view.model, view_doc, view.id)
  File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 975, in postprocess_and_fields
    fields_def = self.postprocess(model, node, view_id, False, fields)
  File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 905, in postprocess
    fields.update(self.postprocess(model, f, view_id, in_tree_view, model_fields))
  File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 905, in postprocess
    fields.update(self.postprocess(model, f, view_id, in_tree_view, model_fields))
  File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 905, in postprocess
    fields.update(self.postprocess(model, f, view_id, in_tree_view, model_fields))
  [Previous line repeated 1 more time]
  File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 828, in postprocess
    ).postprocess_and_fields(field.comodel_name, f, view_id)
  File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 987, in postprocess_and_fields
    self.raise_view_error(message, view_id)
  File "/opt/odoo/odoo/addons/base/models/ir_ui_view.py", line 614, in raise_view_error
    raise ValueError(message)
ValueError: Veld 'product_uom_category_id' bestaat niet

Fout context:
Weergave`sale.management.order.form`

The field product_uom_category_id is a default one in Odoo 13? It's in the sale & sale_management addon modules

This is their declaration

So yeah, i'm stuck. What i've tried:

What i've checked:

Should I use the model sale.order.line? It sounds wrong, since the 'base' model is sale.order, but the field appears in sale.order.line which is already in the view

I have no more things to try. Your help is mutch appreciated!

Upvotes: 0

Views: 803

Answers (2)

Glenn
Glenn

Reputation: 34

Found after 4 days: It was another Model that used order_line.product_uom_category_id In that model, there was no product_id present. Which is weird, since that model did not inherit from sale.order.line

Upvotes: 0

Jorge Orozco-Sanchez
Jorge Orozco-Sanchez

Reputation: 89

I was having almost the same issue with a custom inherited view for the helpdesk.tasks model. The problem was in the model name. I included the name of the module at the beginning of the name and it fixed.

<field name="name"><module>.sale.management.order.form</field>

Also, be sure that the inherit_id field is correct.

Upvotes: 0

Related Questions