Dear All.

I have two models in One2Many relation.
here it is :
-------START----------
class Alertin(ModelSQL, ModelView):
    'AlertIn'
    _name = 'nera.alertin'
    _description = __doc__
    netalert = fields.Many2One('nera.netalert', 'Keyword',
        ondelete='RESTRICT')
    alertout = fields.One2Many('nera.alertout', 'alertin', 'AlertOut')
    msg = fields.Char('Message Text', select="1")
    rawdata = fields.Text('Raw Data')

Alertin()

class Alertout(ModelSQL, ModelView):
    'AlertOut'
    _name = 'nera.alertout'
    _description = __doc__
    alertin = fields.Many2One('nera.alertin', 'Incoming Alert',
        ondelete='RESTRICT')
    crew = fields.Many2One('nera.crew', 'Send to',
        ondelete='RESTRICT')
    knlurl = fields.Text('Kannel URL')
    knlstate = fields.Char('Kannel State')
    dlr0 = fields.DateTime('DateTime DLR0')
    dlr1 = fields.DateTime('DateTime DLR1')
    dlr2 = fields.DateTime('DateTime DLR2')
    dlr4 = fields.DateTime('DateTime DLR4')
    dlr8 = fields.DateTime('DateTime DLR8')
    dlr16 = fields.DateTime('DateTime DLR16')

Alertout()

--------END------------

What I want is , each time there is a new record added to "Alertin", trytond will add some records to "Alertout" model.
Also I want that "Alertin" records cannot be "updated" nor "deleted"

Kindly please give me your enlightment on how to do it

Sincerely
-bino-

--
[email protected] mailing list

Reply via email to