Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #322 from OpenSPP/farmer-registry-update-gis
Browse files Browse the repository at this point in the history
Farmer registry update gis
  • Loading branch information
reichie020212 authored Feb 2, 2024
2 parents 0033680 + 370cb3b commit 44e2a28
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
1 change: 1 addition & 0 deletions spp_farmer_registry_base/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
from . import land_record
from . import species
from . import farm
from . import partner
10 changes: 10 additions & 0 deletions spp_farmer_registry_base/models/partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from odoo import fields, models


class ResPartner(models.Model):
"""Add geo_point to partner using a function filed"""

_inherit = "res.partner"

geo_point = fields.GeoPoint()
geo_multi_polygon = fields.GeoMultiPolygon()
19 changes: 16 additions & 3 deletions spp_farmer_registry_base/views/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<field name="zip" />
<field name="city" />
<field name="country_id" />
<field name="geo_point" />
<field name="geo_multi_polygon" />
<templates>
<t t-name="info_box">
<b>
Expand All @@ -33,9 +35,9 @@
</field>
</record>

<record id="geoengine_vector_layer_res_partner" model="geoengine.vector.layer">
<field name="geo_field_id" ref="geoengine_partner.field_res_partner__geo_point" />
<field name="name">Partner location</field>
<record id="geoengine_vector_layer_geo_point_res_partner" model="geoengine.vector.layer">
<field name="geo_field_id" ref="spp_farmer_registry_base.field_res_partner__geo_point" />
<field name="name">Partner location geo point</field>
<field eval="1" name="sequence" />
<field name="view_id" ref="ir_ui_view_geo_partner" />
<field name="geo_repr">basic</field>
Expand All @@ -44,6 +46,17 @@
<field eval="1" name="nb_class" />
<field name="begin_color">#FF680A</field>
</record>
<record id="geoengine_vector_layer_geo_multi_poly_res_partner" model="geoengine.vector.layer">
<field name="geo_field_id" ref="spp_farmer_registry_base.field_res_partner__geo_multi_polygon" />
<field name="name">Partner location geo multi polygon</field>
<field eval="1" name="sequence" />
<field name="view_id" ref="ir_ui_view_geo_partner" />
<field name="geo_repr">basic</field>
<field name="active_on_startup" eval="True" />
<field name="layer_opacity">0.8</field>
<field eval="1" name="nb_class" />
<field name="begin_color">#FF680A</field>
</record>
<record id="geoengine_raster_layer_res_partner_osm" model="geoengine.raster.layer">
<field name="raster_type">osm</field>
<field name="name">Partner background</field>
Expand Down

0 comments on commit 44e2a28

Please sign in to comment.