diff options
| author | Raphael Collet <rco@openerp.com> | 2016-09-02 15:58:39 +0200 |
|---|---|---|
| committer | Raphael Collet <rco@openerp.com> | 2016-09-02 17:28:12 +0200 |
| commit | 9e64f9f9514194d74e166b032add8511182f2677 (patch) | |
| tree | 5086710c04c6b923be18a6d1d97b3f0f3a2a9c4a /odoo/addons/test_documentation_examples/delegation.py | |
| parent | 11812b0b9e82b2b1b9041d8250ce01e7b4a5f7ee (diff) | |
[REF] openerp: move `openerp` to `odoo`
Diffstat (limited to 'odoo/addons/test_documentation_examples/delegation.py')
| -rw-r--r-- | odoo/addons/test_documentation_examples/delegation.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/odoo/addons/test_documentation_examples/delegation.py b/odoo/addons/test_documentation_examples/delegation.py new file mode 100644 index 00000000000..3f9ba035168 --- /dev/null +++ b/odoo/addons/test_documentation_examples/delegation.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields + +class Child0(models.Model): + _name = 'delegation.child0' + + field_0 = fields.Integer() + +class Child1(models.Model): + _name = 'delegation.child1' + + field_1 = fields.Integer() + +class Delegating(models.Model): + _name = 'delegation.parent' + + _inherits = { + 'delegation.child0': 'child0_id', + 'delegation.child1': 'child1_id', + } + + child0_id = fields.Many2one('delegation.child0', required=True, ondelete='cascade') + child1_id = fields.Many2one('delegation.child1', required=True, ondelete='cascade') |
