Skip to content

Commit

Permalink
G2P-2717: Added enumerator as a separate package
Browse files Browse the repository at this point in the history
  • Loading branch information
Dibik committed Aug 2, 2024
1 parent be4f3c6 commit c9fd04f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
6 changes: 1 addition & 5 deletions g2p_enumerator/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
"website": "https://openg2p.org",
"license": "Other OSI approved licence",
"depends": ["g2p_registry_group"],
"data": [
"security/ir.model.access.csv",
"views/g2p_enumerator_view.xml",
"views/group_view.xml"
],
"data": ["security/ir.model.access.csv", "views/g2p_enumerator_view.xml", "views/group_view.xml"],
"assets": {
"web.assets_frontend": [],
"web.assets_common": [],
Expand Down
1 change: 0 additions & 1 deletion g2p_enumerator/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from . import g2p_enumerator
from . import res_partner

5 changes: 2 additions & 3 deletions g2p_enumerator/models/g2p_enumerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
class G2PEnumerator(models.Model):
_name = "g2p.enumerator"

#Enum Details
# Enum Details
enumerator_name = fields.Char()
enumerator_id = fields.Char()
data_collection_date = fields.Date()

#Location
# Location
enum_latitude = fields.Float(string="Latitude", digits=(10, 7))
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")

4 changes: 2 additions & 2 deletions g2p_enumerator/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Part of OpenG2P Registry. See LICENSE file for full copyright and licensing details.
from odoo import _, api, fields, models
from odoo import fields, models


class G2PRegistrant(models.Model):
_inherit = "res.partner"

enumerator_ids = fields.One2many("g2p.enumerator","partner_id")
enumerator_ids = fields.One2many("g2p.enumerator", "partner_id")
10 changes: 5 additions & 5 deletions g2p_enumerator/views/g2p_enumerator_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
<field name="arch" type="xml">
<tree>
<field name="enumerator_name" />
<field name="enumerator_id"/>
<field name="data_collection_date"/>
<field name="enumerator_id" />
<field name="data_collection_date" />
<field name="enum_latitude" />
<field name="enum_longitude"/>
<field name="enum_altitude"/>
<field name="enum_longitude" />
<field name="enum_altitude" />
<field name="enum_accuracy" />
</tree>
</field>
Expand All @@ -24,7 +24,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">g2p.enumerator</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_enumerator_config_tree"/>
<field name="view_id" ref="view_enumerator_config_tree" />
<field name="context">{}</field>
<field name="domain">[]</field>
<field name="help" type="html">
Expand Down
8 changes: 4 additions & 4 deletions g2p_enumerator/views/group_view.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Part of OpenG2P Registry. See LICENSE file for full copyright and licensing details.
-->
Expand All @@ -13,13 +13,13 @@
<field name="enumerator_ids" nolabel="1" colspan="2">
<tree>
<field name="enumerator_name" />
<field name="enumerator_id" string="Enumerator ID"/>
<field name="enumerator_id" string="Enumerator ID" />
<field name="data_collection_date" />
</tree>
<form>
<group string="Enumerator Info">
<field name="enumerator_name" />
<field name="enumerator_id" string="Enumerator ID"/>
<field name="enumerator_id" string="Enumerator ID" />
<field name="data_collection_date" />
</group>
<group string="Enumerator Location">
Expand All @@ -35,4 +35,4 @@
</field>
</record>

</odoo>
</odoo>

0 comments on commit c9fd04f

Please sign in to comment.