From 8b081c0c43b331008747ef653ee27182b27ba586 Mon Sep 17 00:00:00 2001 From: Dibik Date: Mon, 5 Aug 2024 19:50:16 +0530 Subject: [PATCH] G2P-2717: Feedback changes on views and model file --- g2p_enumerator/models/g2p_enumerator.py | 7 +++--- g2p_enumerator/models/res_partner.py | 5 +++- g2p_enumerator/views/g2p_enumerator_view.xml | 24 +++++++++++++++++-- g2p_enumerator/views/group_view.xml | 25 ++++---------------- 4 files changed, 34 insertions(+), 27 deletions(-) diff --git a/g2p_enumerator/models/g2p_enumerator.py b/g2p_enumerator/models/g2p_enumerator.py index 66562d2..55a74a1 100644 --- a/g2p_enumerator/models/g2p_enumerator.py +++ b/g2p_enumerator/models/g2p_enumerator.py @@ -3,10 +3,11 @@ class G2PEnumerator(models.Model): _name = "g2p.enumerator" + _rec = "name" # Enum Details - enumerator_name = fields.Char() - enumerator_id = fields.Char() + name = fields.Char() + enumerator_user_id = fields.Char() data_collection_date = fields.Date() # Location @@ -14,5 +15,3 @@ class G2PEnumerator(models.Model): enum_longitude = fields.Float(string="Longitude", digits=(10, 7)) enum_altitude = fields.Float(string="Altitude") enum_accuracy = fields.Float(string="Accuracy") - - partner_id = fields.Many2one("res.partner") diff --git a/g2p_enumerator/models/res_partner.py b/g2p_enumerator/models/res_partner.py index ff47b1b..c856cba 100644 --- a/g2p_enumerator/models/res_partner.py +++ b/g2p_enumerator/models/res_partner.py @@ -5,4 +5,7 @@ class G2PRegistrant(models.Model): _inherit = "res.partner" - enumerator_ids = fields.One2many("g2p.enumerator", "partner_id") + enumerator_id = fields.Many2one("g2p.enumerator") + enumerator_user_id = fields.Char(related="enumerator_id.enumerator_user_id") + + data_collection_date = fields.Date(related="enumerator_id.data_collection_date") diff --git a/g2p_enumerator/views/g2p_enumerator_view.xml b/g2p_enumerator/views/g2p_enumerator_view.xml index 8496f38..8233549 100644 --- a/g2p_enumerator/views/g2p_enumerator_view.xml +++ b/g2p_enumerator/views/g2p_enumerator_view.xml @@ -8,8 +8,8 @@ g2p.enumerator - - + + @@ -19,6 +19,26 @@ + + view_enumerator_config_form + g2p.enumerator + +
+ + + + + + + + + + + +
+
+
+ enumerator action ir.actions.act_window diff --git a/g2p_enumerator/views/group_view.xml b/g2p_enumerator/views/group_view.xml index eb3f4a2..172c760 100644 --- a/g2p_enumerator/views/group_view.xml +++ b/g2p_enumerator/views/group_view.xml @@ -10,26 +10,11 @@ - - - - - - -
- - - - - - - - - - - -
-
+ + + + +