Dear All
I do google for "field.One2One" but I could not find one with examples.
I Have two model : Taskgroup and Netsite
each Taskgroup can only be bound to one Netsite and viceversa
----Model Definition-----------
class Taskgroup(ModelSQL, ModelView):
'TaskGroup'
_name = 'nera.taskgroup'
_description = __doc__
party = fields.Many2One('party.party', 'Party',
required=True,
ondelete='CASCADE')
name = fields.Char('TaskGroup Name')
crew = fields.One2Many('nera.crew', 'taskgroup', 'Crews')
#netsite = fields.One2One('nera.netsite', 'taskgroup' ,'Net Site')
Taskgroup()
class Netsite(ModelSQL, ModelView):
'NetSite'
_name = 'nera.netsite'
_description = __doc__
party = fields.Many2One('party.party', 'Party',
required=True,
ondelete='CASCADE')
name = fields.Char('Net Site')
netalert = fields.One2Many('nera.netalert', 'netsite', 'Alert Code')
#taskgroup = fields.One2One('nera.taskgroup', 'netsite', 'Task Group')
NetSite()
------------------
Trytond report that One2One need 4 variables.
Kindly please give me your enlightment on how to write a One2One relation.
Sincerely
-bino-
--
[email protected] mailing list