You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
580 B
Python
21 lines
580 B
Python
8 months ago
|
# -*- coding: utf-8 -*-
|
||
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||
|
|
||
|
from odoo import fields, models
|
||
|
|
||
|
|
||
|
class ModelA(models.Model):
|
||
|
_name = "test_rpc.model_a"
|
||
|
_description = "Model A"
|
||
|
|
||
|
name = fields.Char(required=True)
|
||
|
field_b1 = fields.Many2one("test_rpc.model_b", string="required field", required=True)
|
||
|
field_b2 = fields.Many2one("test_rpc.model_b", string="restricted field", ondelete="restrict")
|
||
|
|
||
|
|
||
|
class ModelB(models.Model):
|
||
|
_name = "test_rpc.model_b"
|
||
|
_description = "Model B"
|
||
|
|
||
|
name = fields.Char(required=True)
|