Using v15EE
Have created a very simple module to add a field to the sales order form view. When I try install the module I get the following error:
Field "bay_fsmdesc" does not exist in model "sale.order" View error context: {'file': '/home/odoo/src/user/bay_salefsm_description/views/baysalesorderdescription.xml', 'line': 3, 'name': 'sale.order.form.sale.bay', 'view': ir.ui.view(1568,), 'view.model': 'sale.order', 'view.parent': ir.ui.view(800,), 'xmlid': 'bay_sale_order_customizations_form'}
Module code and manifest
Manifest:
{'name': "bay_salefsm_description",
'summary': """ """,
'description': """ """,
'author': "sveng",
# Categories can be used to filter modules in modules listing# Check https://github.com/odoo/odoo/blob/master/odoo/addons/base/module/module_data.xml# for the full list'category': 'Uncategorized','version': '15.0.1.0','license': 'OPL-1',
# any module necessary for this one to work correctly'depends': ['sale_management', 'fieldservice', 'fieldservice_sale'],
# always loaded'data': ['views/baysalesorderdescription.xml', # Add the modified view ],# only loaded in demonstration mode#'demo': [# 'demo/demo.xml',#],'installable' : True,'application' : False,
}
models:
from odoo import _, api, fields, models
from odoo.exceptions import ValidationError
classSaleOrder(models.Model): _inherit="sale.order"
bay_fsmdesc= fields.Char(string='FSM Order Description')
View:
xml version="1.0" encoding="UTF-8"?><odoo><recordid="bay_sale_order_customizations_form"model="ir.ui.view"><fieldname="name">sale.order.form.sale.bayfield><fieldname="model">sale.orderfield><fieldname="inherit_id"ref="sale.view_order_form"/><fieldname="arch"type="xml"><xpathexpr="//field[@name='partner_shipping_id']"position="after"> <fieldname="bay_fsmdesc"/>xpath> field> record>odoo>
This is embarrassing ... although I had the .py file in the _init_ of the models folder ... I did not have the models folder in the root _init_
Grrr, apologies for posting such a simple fail!