I'm trying to add a relational field to a model entity ( Odoo 11 ). I have two classes
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class Cantiere(models.Model):
_name = 'modulotest01.cantiere
name = fields.Char(required=True)
description = fields.Text()
direttore = fields.Many2one('modulotest01.direttore', string='Direttore',index=True,ondelete='cascade'
class Direttore(models.Model):
_name = 'modulotest01.direttore'
name = fields.Char(required=True)
start_date = fields.Date(
#cantiere_id = fields.One2Many('modulotest01.cantiere', 'direttore_id'
Obviously this code doesn't work and i don't know why