Search code examples
pythonxmlfieldproductodoo-13

Odoo V13 Custom fields in product menu don't show up


I'm trying to add a simple custom field to the product menu but it doesn't appear.

My modifications in the product models are visible in the "technical>models" menu and my view is well loaded in the views list, there's no error or warning.

models/product.py

from odoo import fields, models

class Product(models.Model) :
    _inherit = 'product.product'
    test = fields.Boolean('Material')

models/init.py

# -*- coding: utf-8 -*-

from . import models
from . import material
from . import machine
from . import product

view/product.xml

<?xml version="1.0"?>
<odoo>
    <record id="view_cbd_product" model="ir.ui.view">
        <field name="name">cbd.product</field>
        <field name="model">product.product</field>
        <field name="inherit_id" ref="product.product_normal_form_view"/>
        <field name="arch" type="xml">
            <field name="sale_ok" position="after">
                <field name="test"/>
            </field>
        </field>
    </record>
</odoo>

in the manifest.py

    'data': [
        'views/product.xml'
    ],

Thanks for your help


Solution

    1. In developer mode press the bug
    2. Click on edit view form
    3. Check on inherited view tab to see if your view is there.