From 704ac03ca91c2d7046aba9b4d161de9c6f73ed65 Mon Sep 17 00:00:00 2001 From: michel Date: Thu, 16 Nov 2017 16:37:46 +0100 Subject: [PATCH] Add many2one fields coworker1 and 2. and relation --- coworking_relation/models/relation.py | 12 ++++++++- coworking_relation/views/coworker_views.xml | 24 +++++++++++++++++ coworking_relation/views/relation_views.xml | 30 +++++++++++++-------- 3 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 coworking_relation/views/coworker_views.xml diff --git a/coworking_relation/models/relation.py b/coworking_relation/models/relation.py index f4c47c8..696f636 100644 --- a/coworking_relation/models/relation.py +++ b/coworking_relation/models/relation.py @@ -10,4 +10,14 @@ class CoworkerRelation(models.Model): _description = 'relation model definition' _order = 'id asc' - titre = fields.Char() + name = fields.Char() + + coworker1 = fields.Many2one( + 'coworking.coworker', 'Coworker', index=True, required=True, + domain="[('coworker_type', 'in', ['staffer', 'member', 'worker', 'volunteer', 'visitor'])]" + ) + coworker2 = fields.Many2one( + 'coworking.coworker', 'Coworker', index=True, required=True, + domain="[('coworker_type', 'in', ['staffer', 'member', 'worker', 'volunteer', 'visitor'])]" + ) + relation = fields.Char(index=True, required=True) diff --git a/coworking_relation/views/coworker_views.xml b/coworking_relation/views/coworker_views.xml new file mode 100644 index 0000000..68f5668 --- /dev/null +++ b/coworking_relation/views/coworker_views.xml @@ -0,0 +1,24 @@ + + + + + + + Coworker Form adaptations + coworking.coworker + + + + + + + + + + + + + + + diff --git a/coworking_relation/views/relation_views.xml b/coworking_relation/views/relation_views.xml index ac04da6..3882f78 100644 --- a/coworking_relation/views/relation_views.xml +++ b/coworking_relation/views/relation_views.xml @@ -2,15 +2,23 @@ - - Relation Form - coworking.relation - -
- - - -
-
-
+ + Relation Form + coworking.relation + +
+ + + + + + + + + +
+
+
+ +