Hi hello, please somebody can help with this code, look ok for me but I got this error all the time, please i need help to understand
class sale_order(models.Model):
_inherit = 'sale.order'
warehouse_log = fields.One2many('warehouse.log', 'sale_order', 'Warehouse Log')
class WarehouseLog(models.Model):
_name = 'warehouse.log'
_description = 'Warehouse log'
name = fields.Char('Name')
sale_order = fields.Many2one('sale.order', 'Sale Order')
<odoo>
<data>
<record id="sale_order_form_page_warehouse_log" model="ir.ui.view">
<field name="name">sale_order_form_page_warehouse_log</field>
<field name="model">sale.order</field><!-- Model -->
<field name="inherit_id" ref="sale.view_order_form"/><!-- External ID -->
<field name="arch" type="xml">
<notebook position="inside">
<page string="Warehouse Log">
<field name="warehouse_log">
<tree editable='bottom'>
<field name="id"/>
<field name="name"/>
</tree>
</field>
</page>
</notebook>
</field>
</record>
</data>
</odoo>
File "/opt/odoo/odoo/models.py", line 1130, in _validate_fields
raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
odoo.tools.convert.ParseError: "Error while validating constraint
Field `warehouse_log` does not exist
Error context:
View `sale_order_form_page_warehouse_log`
[view_id: 1585, xml_id: general_options.sale_order_form_page_warehouse_log, model: sale.order, parent_id: 1034]
None" while parsing /opt/odoo/extra_addons/ours/general_options/views/sale_order.xml:5, near
If you are new to odoo development, this will help: https://www.youtube.com/watch?v=DJyPx5u6sd0&list=PLqRRLx0cl0homY1elJbSoWfeQbRKJ-oPO