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

Commit

Permalink
Merge branch 'farmer-registry' of https://github.com/OpenSPP/openspp-…
Browse files Browse the repository at this point in the history
…registry into farmer-registry-demo-data
  • Loading branch information
reichie020212 committed Feb 3, 2024
2 parents cad4b00 + 517c916 commit af7825a
Show file tree
Hide file tree
Showing 13 changed files with 187 additions and 125 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ name: tests
on:
pull_request:
branches:
- "15.0*"
- "15.1*"
- "17.0*"
push:
branches:
- "15.0"
- "rc/15.0*"
- "15.0-ocabot-*"
- "17.0"
- "17.0-ocabot-*"
- "farmer-registry"
env:
OCA_GIT_USER_NAME: openspp
OCA_GIT_USER_EMAIL: [email protected]
Expand All @@ -18,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
name: Detect unreleased dependencies
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
Expand All @@ -39,26 +38,24 @@ jobs:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.8-odoo15.0:latest
makepot: "true"
- container: ghcr.io/oca/oca-ci/py3.10-odoo17.0:latest
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.8-ocb15.0:latest
- container: ghcr.io/oca/oca-ci/py3.10-ocb17.0:latest
name: test with OCB
makepot: "true"
services:
postgres:
image: postgres:9.6
image: postgres:15.0
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo
ports:
- 5432:5432
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
persist-credentials: false
# Disabling shallow clone for sonarqube
# fetch-depth: 0
- name: Install addons and dependencies
run: oca_install_addons
- name: Check licenses
Expand Down
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 @@ -3,6 +3,7 @@
from . import agricultural_activity
from . import chemical
from . import fertilizer
from . import feed_items
from . import extension_services
from . import farm_asset
from . import farm_details
Expand Down
12 changes: 12 additions & 0 deletions spp_farmer_registry_base/models/feed_items.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import logging

from odoo import api, fields, models

_logger = logging.getLogger(__name__)


class SPPFeedItems(models.Model):
_name = "spp.feed.items"
_description = "Feed Items Types"

name = fields.Char("Feed Items Type")
5 changes: 3 additions & 2 deletions spp_farmer_registry_base/security/ir.model.access.csv
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ spp_farm_details_admin,Farm Details Admin Access,spp_farmer_registry_base.model_
spp_land_record_admin,Land Record Details Admin Access,spp_farmer_registry_base.model_spp_land_record,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_farm_species_admin,Species Admin Access,spp_farmer_registry_base.model_spp_farm_species,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_farmer_admin,Temporary Model for Farmer Admin Access,spp_farmer_registry_base.model_spp_farmer,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_chemical_admin,Chemical Interventions Types Admin Access,spp_farmer_registry_base.model_spp_farmer,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_fertilizer_admin,Fertilizer Interventions Types Admin Access,spp_farmer_registry_base.model_spp_farmer,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_chemical_admin,Chemical Interventions Types Admin Access,spp_farmer_registry_base.model_spp_chemical,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_fertilizer_admin,Fertilizer Interventions Types Admin Access,spp_farmer_registry_base.model_spp_fertilizer,g2p_registry_base.group_g2p_admin,1,1,1,1
spp_feed_items_admin,Feed Items Types Admin Access,spp_farmer_registry_base.model_spp_feed_items,g2p_registry_base.group_g2p_admin,1,1,1,1
4 changes: 4 additions & 0 deletions spp_farmer_registry_demo/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
"data/aqua_data.xml",
"data/crop_data.xml",
"data/livestock_data.xml",
"data/chemical_data.xml",
"data/fertilizer_data.xml",
"data/feed_items_data.xml",
"data/sex_data.xml",
"views/group_view.xml",
"views/individual_view.xml",
"views/generate_farmer_data_view.xml",
Expand Down
15 changes: 15 additions & 0 deletions spp_farmer_registry_demo/data/chemical_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<odoo noupdate="1">
<record id="chemical_fungicides" model="spp.chemical">
<field name="name">Fungicides</field>
</record>
<record id="chemical_herbicides" model="spp.chemical">
<field name="name">Herbicides</field>
</record>
<record id="chemical_insecticides" model="spp.chemical">
<field name="name">Insecticides</field>
</record>
<record id="chemical_rodenticides" model="spp.chemical">
<field name="name">Rodenticides</field>
</record>

</odoo>
36 changes: 36 additions & 0 deletions spp_farmer_registry_demo/data/feed_items_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<odoo noupdate="1">
<record id="feed_items_natural_pasture" model="spp.feed.items">
<field name="name">Natural Pasture</field>
</record>
<record id="feed_items_improved_pasture" model="spp.feed.items">
<field name="name">Improved Pasture</field>
</record>
<record id="feed_items_own_grown_hay" model="spp.feed.items">
<field name="name">Own Grown Hay</field>
</record>
<record id="feed_items_purchased_hay" model="spp.feed.items">
<field name="name">Purchased Hay</field>
</record>
<record id="feed_items_manufactured_meals" model="spp.feed.items">
<field name="name">Manufactured Meals</field>
</record>
<record id="feed_items_home_made_feed_mix" model="spp.feed.items">
<field name="name">Home-made Feed Mix</field>
</record>
<record id="feed_items_chick_mash" model="spp.feed.items">
<field name="name">Chick Mash</field>
</record>
<record id="feed_items_calf_pellets" model="spp.feed.items">
<field name="name">Calf Pellets</field>
</record>
<record id="feed_items_mineral_salts" model="spp.feed.items">
<field name="name">Mineral Salts</field>
</record>
<record id="feed_items_purchased_fodder" model="spp.feed.items">
<field name="name">Purchased Fodder</field>
</record>
<record id="feed_items_pig_starter_finisher" model="spp.feed.items">
<field name="name">Pig Starter-finisher</field>
</record>

</odoo>
60 changes: 60 additions & 0 deletions spp_farmer_registry_demo/data/fertilizer_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<odoo noupdate="1">
<record id="fertilizer_amonia_anhydrous" model="spp.fertilizer">
<field name="name">Amonia Anhydrous</field>
</record>
<record id="fertilizer_ammonium_hydroxide" model="spp.fertilizer">
<field name="name">Ammonium Hydroxide</field>
</record>
<record id="fertilizer_calcium_nitrates" model="spp.fertilizer">
<field name="name">Calcium Nitrate</field>
</record>
<record id="fertilizer_can" model="spp.fertilizer">
<field name="name">CAN</field>
</record>
<record id="fertilizer_dap" model="spp.fertilizer">
<field name="name">DAP</field>
</record>
<record id="fertilizer_double_super_phosphate" model="spp.fertilizer">
<field name="name">Double Super Phosphate</field>
</record>
<record id="fertilizer_magnesium_nitrate" model="spp.fertilizer">
<field name="name">Magnesium Nitrate</field>
</record>
<record id="fertilizer_map" model="spp.fertilizer">
<field name="name">MAP</field>
</record>
<record id="fertilizer_mop" model="spp.fertilizer">
<field name="name">MOP</field>
</record>
<record id="fertilizer_npk" model="spp.fertilizer">
<field name="name">NPK</field>
</record>
<record id="fertilizer_phosphate_rock" model="spp.fertilizer">
<field name="name">Phosphate Rock</field>
</record>
<record id="fertilizer_potassium_nitrate" model="spp.fertilizer">
<field name="name">Potassium Nitrate</field>
</record>
<record id="fertilizer_potassium_sulphate" model="spp.fertilizer">
<field name="name">Potassium Sulphate</field>
</record>
<record id="fertilizer_sulphate_of_ammonia" model="spp.fertilizer">
<field name="name">Sulphate of Ammonia</field>
</record>
<record id="fertilizer_superphosphate" model="spp.fertilizer">
<field name="name">Superphosphate</field>
</record>
<record id="fertilizer_tsp" model="spp.fertilizer">
<field name="name">TSP</field>
</record>
<record id="fertilizer_urea" model="spp.fertilizer">
<field name="name">Urea</field>
</record>
<record id="fertilizer_organic_manure" model="spp.fertilizer">
<field name="name">Organic Manure</field>
</record>
<record id="fertilizer_organic_liquid_fertilizer" model="spp.fertilizer">
<field name="name">Organic Liquid Fertilizer</field>
</record>

</odoo>
11 changes: 11 additions & 0 deletions spp_farmer_registry_demo/data/sex_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<odoo noupdate="1">
<record id="gender_male" model="gender.type">
<field name="code">Male</field>
<field name="value">Male</field>
</record>
<record id="gender_female" model="gender.type">
<field name="code">Female</field>
<field name="value">Female</field>
</record>

</odoo>
58 changes: 3 additions & 55 deletions spp_farmer_registry_demo/models/agricultural_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,43 +19,8 @@ class AgriculturalActivity(models.Model):
],
string="Production system",
)

cultivation_chemical_interventions = fields.Selection(
[
("fungicides", "Fungicides"),
("herbicides", "Herbicides"),
("insecticides", "Insecticides"),
("rodenticides", "Rodenticides"),
("other", "Other"),
],
string="Chemical interventions",
)

cultivation_fertilizer_interventions = fields.Selection(
[
("amonia anhydrous", "Amonia Anhydrous"),
("ammonium hydroxide", "Ammonium Hydroxide"),
("calcium nitrate", "Calcium Nitrate"),
("can", "CAN"),
("dap", "DAP"),
("double super phosphate", "Double Super Phosphate"),
("magnesium nitrate", "Magnesium Nitrate"),
("map", "MAP"),
("mop", "MOP"),
("npk", "NPK"),
("phosphate rock", "Phosphate Rock"),
("potassium nitrate", "Potassium Nitrate"),
("potassium sulphate", "Potassium Sulphate"),
("sulphate of ammonia", "Sulphate of Ammonia"),
("superphosphate", "Superphosphate"),
("tsp", "TSP"),
("urea", "Urea"),
("organic manure", "Organic Manure"),
("organic liquid fertilizer", "Organic Liquid Fertilizer"),
("other", "Other"),
],
string="Fertilizer interventions",
)
cultivation_chemical_interventions = fields.Many2many("spp.chemical", string="Chemical interventions")
cultivation_fertilizer_interventions = fields.Many2many("spp.fertilizer", string="Fertilizer interventions")

# Fields for Livestock Rearing
livestock_production_system = fields.Selection(
Expand All @@ -73,24 +38,7 @@ class AgriculturalActivity(models.Model):
],
string="Production system",
)

livestock_feed_items = fields.Selection(
[
("natural pasture", "Natural Pasture"),
("improved pasture", "Improved Pasture"),
("own grown hay", "Own Grown Hay"),
("purchased hay", "Purchased Hay"),
("manufactured meals", "Manufactured Meals"),
("home-made feed mix", "Home-made Feed Mix"),
("chick mash", "Chick Mash"),
("calf pellets", "Calf Pellets"),
("mineral salts", "Mineral Salts"),
("purchased fodder", "Purchased Fodder"),
("pig starter-finisher", "Pig Starter-finisher"),
("other", "Other"),
],
string="Feed items",
)
livestock_feed_items = fields.Many2many("spp.feed.items", string="Feed items")

# Fields for Aquaculture
aquaculture_production_system = fields.Selection(
Expand Down
Loading

0 comments on commit af7825a

Please sign in to comment.