Community mailing list archives

community@mail.odoo.com

Re: Unlink and ondelete="cascade"

by
Andre Kurniawan
- 03/03/2016 05:21:51
Hello Holger Brunn,

I see, thank you for the answer.

On 03/03/2016 05:17 PM, Holger Brunn wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> > Does |ondelete="cascade"| only delete the |ModelChild| records via
> > database query and not from |unlink| method?
>
> yes. In case you need this to go via the ORM, override unlink() in the
> parent model en do your deletions manually. Then you should also set
> ondelete='restrict' to be notified if things go wrong
>
> - -- 
> Therp - Maatwerk in open ontwikkeling
>
> Holger Brunn - Ontwerp en implementatie
>
> mail: holger@therp.nl
> web: http://therp.nl
> phone: +31 (0)20 3093096
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iF4EAREIAAYFAlbYDd4ACgkQAcl2D+yjrhhdhAD7B3eW/dAS1eJJSPpzYbItF3BL
> EhJ8enzgFrsjF1UqEC0BAIykZdpiWwI9J6I3Ns+d0ksEvrNgKRd5+y0L8MTnAljO
> =KxVo
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-59
> Post to: mailto:community@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe
>

-- 
Regards,
Andre