Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions farm_water_source/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=================
Farm Water Source
=================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9d5ee627395550f366a82fe33508898dd73e25e55d39a5ce9a86027ddb10409c
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
:target: https://odoo-community.org/page/development-status
:alt: Alpha
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-ledoent%2Ffarm--pack-lightgray.png?logo=github
:target: https://github.com/ledoent/farm-pack/tree/19.0/farm_water_source
:alt: ledoent/farm-pack

|badge1| |badge2| |badge3|

Tracks water sources on the farm — wells, surface tanks, ponds, streams,
troughs, springs, hydrants — with their location, capacity, last-tested
date, and which fields they serve.

The ``geom`` column is a ``GeoPoint``. All source types are represented
as a single point: the well-head, the tank tap, the centroid of the
pond, the access point on the stream. We picked this in v1 because
base_geoengine 19.0 doesn't ship a "any geometry" type — adding a
polygon footprint for ponds (surface-area, depth contours) or a
linestring for streams would need a follow-up
``farm_water_source_polygon`` extension model.

The ``field_ids`` many2many answers "which fields does this source
serve?", useful when planning rotational grazing or drought contingency.

.. IMPORTANT::
This is an alpha version, the data model and design can change at any time without warning.
Only for development or testing purpose, do not use in production.
`More details on development status <https://odoo-community.org/page/development-status>`_

**Table of contents**

.. contents::
:local:

Usage
=====

1. Open Farm → Water Sources.

2. Click **New** and fill the name, type, optional capacity.

3. Tick the fields this source serves under **Fields Served**.

4. Open the **Location** tab and place the geometry on the map:

============================= ==============================
Type Geometry
============================= ==============================
Well, Trough, Spring, Hydrant Single point
Stream / Creek LineString (multiple vertices)
Pond, Surface Tank Polygon (closed area)
============================= ==============================

5. Save. Switch to the Map view to see every source on the field map.

Day-to-day:

- **Annual water testing**: filter by "Not Tested in 1 Year" to find
sources due for a potability test.
- **Rotational grazing planning**: open a field's map, see which sources
serve which paddocks, plan moves accordingly.
- **Drought contingency**: switch the action to the Map view to see all
active sources at once and identify backup options.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/ledoent/farm-pack/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/ledoent/farm-pack/issues/new?body=module:%20farm_water_source%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Ledo Enterprises

Contributors
------------

- Daniel Kendall <dkendall@ledoweb.com>

Maintainers
-----------

.. |maintainer-dnplkndll| image:: https://github.com/dnplkndll.png?size=40px
:target: https://github.com/dnplkndll
:alt: dnplkndll

Current maintainer:

|maintainer-dnplkndll|

This module is part of the `ledoent/farm-pack <https://github.com/ledoent/farm-pack/tree/19.0/farm_water_source>`_ project on GitHub.

You are welcome to contribute.
1 change: 1 addition & 0 deletions farm_water_source/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
25 changes: 25 additions & 0 deletions farm_water_source/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "Farm Water Source",
"version": "19.0.1.0.0",
"summary": "Wells, ponds, troughs, springs — geometry + which fields they serve",
"author": "Ledo Enterprises, Odoo Community Association (OCA)",
"maintainers": ["dnplkndll"],
"website": "https://github.com/ledoent/farm-pack",
"license": "AGPL-3",
"category": "Vertical/Agriculture",
# Alpha matches farm_field_geo's chain — OCA check-dev-status gate.
"development_status": "Alpha",
"depends": [
"farm_field_geo",
],
"external_dependencies": {
"python": ["shapely"],
},
"data": [
"security/ir.model.access.csv",
"views/farm_water_source_views.xml",
"views/farm_water_source_menu.xml",
],
"installable": True,
"application": False,
}
1 change: 1 addition & 0 deletions farm_water_source/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import farm_water_source
48 changes: 48 additions & 0 deletions farm_water_source/models/farm_water_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from odoo import fields, models


class FarmWaterSource(models.Model):
_name = "farm.water.source"
_description = "Water Source"
_order = "name"

name = fields.Char(required=True)
source_type = fields.Selection(
[
("well", "Well"),
("tank", "Surface Tank"),
("pond", "Pond"),
("stream", "Stream / Creek"),
("trough", "Trough"),
("spring", "Spring"),
("hydrant", "Hydrant / Spigot"),
],
required=True,
)
# All source types record a single point: the well-head, the tank tap,
# the centroid of the pond, the access point on the stream. We picked
# this in v1 because base_geoengine 19.0 (PR #446 head) doesn't ship a
# GeoAnyGeometry type — a future farm_water_source_polygon module can
# add an optional polygon footprint for ponds / streams when a customer
# asks for surface-area calculations.
geom = fields.GeoPoint(string="Location", srid=4326)
field_ids = fields.Many2many(
"farm.field",
string="Fields Served",
help="Which fields draw from this source. Drives the 'where is this "
"field's water coming from' query.",
)
capacity_gallons = fields.Float(
digits=(10, 0),
help="Practical usable volume in gallons. Leave blank for streams / "
"springs where flow rate matters more than reservoir capacity.",
)
last_tested_date = fields.Date(help="Most recent potability / coliform test.")
quality_notes = fields.Text()
active = fields.Boolean(default=True)
company_id = fields.Many2one(
"res.company",
required=True,
default=lambda self: self.env.company,
index=True,
)
3 changes: 3 additions & 0 deletions farm_water_source/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions farm_water_source/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Daniel Kendall &lt;dkendall@ledoweb.com&gt;
13 changes: 13 additions & 0 deletions farm_water_source/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Tracks water sources on the farm — wells, surface tanks, ponds, streams,
troughs, springs, hydrants — with their location, capacity, last-tested
date, and which fields they serve.

The `geom` column is a `GeoPoint`. All source types are represented as a
single point: the well-head, the tank tap, the centroid of the pond, the
access point on the stream. We picked this in v1 because base_geoengine
19.0 doesn't ship a "any geometry" type — adding a polygon footprint for
ponds (surface-area, depth contours) or a linestring for streams would
need a follow-up `farm_water_source_polygon` extension model.

The `field_ids` many2many answers "which fields does this source serve?",
useful when planning rotational grazing or drought contingency.
21 changes: 21 additions & 0 deletions farm_water_source/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
1. Open Farm → Water Sources.
2. Click **New** and fill the name, type, optional capacity.
3. Tick the fields this source serves under **Fields Served**.
4. Open the **Location** tab and place the geometry on the map:

| Type | Geometry |
|---|---|
| Well, Trough, Spring, Hydrant | Single point |
| Stream / Creek | LineString (multiple vertices) |
| Pond, Surface Tank | Polygon (closed area) |

5. Save. Switch to the Map view to see every source on the field map.

Day-to-day:

- **Annual water testing**: filter by "Not Tested in 1 Year" to find sources
due for a potability test.
- **Rotational grazing planning**: open a field's map, see which sources
serve which paddocks, plan moves accordingly.
- **Drought contingency**: switch the action to the Map view to see all
active sources at once and identify backup options.
Empty file.
2 changes: 2 additions & 0 deletions farm_water_source/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_farm_water_source_user,farm.water.source user,model_farm_water_source,base.group_user,1,1,1,1
Loading
Loading