Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spp_farmer_registry_base] Add Agricultural Season Management #657

Open
jeremi opened this issue Nov 5, 2024 · 0 comments · May be fixed by #730
Open

[spp_farmer_registry_base] Add Agricultural Season Management #657

jeremi opened this issue Nov 5, 2024 · 0 comments · May be fixed by #730
Assignees
Labels

Comments

@jeremi
Copy link
Member

jeremi commented Nov 5, 2024

Overview

Add support for tracking agricultural seasons in the Farmer Registry module. Seasons represent spans of time during which field operations contribute to a particular growing cycle. This enhancement will allow better organization and analysis of agricultural activities across growing periods.

Technical Details

New Model: spp.farm.season

Create a new model to track agricultural seasons with the following fields:

  • name (Char): Season identifier/name
  • description (Text): Detailed description of the season
  • date_start (Date): Official start date of the season
  • date_end (Date): Official end date of the season
  • active (Boolean): Indicates if the season is currently active
  • state (Selection): Season state management
    • 'draft': Initial state
    • 'active': Currently active
    • 'closed': Season completed

Business Rules

  1. Multiple seasons can be active simultaneously to handle overlap periods
  2. When creating new agricultural activities:
    • Only active seasons should be available for selection
    • The system should default to the most recent active season
  3. Closed seasons cannot be reopened to maintain data integrity
  4. Activities linked to closed seasons should become read-only

Updates to Agricultural Activity

Modify the existing spp.farm.activity model to include:

  • season_id (Many2one): Reference to the associated season

Implementation Tasks

  1. Model Creation

    • Create the Season model
    • Add necessary fields
    • Implement basic validation (end date must be after start date)
  2. Security

    • Update access rights (ir.model.access.csv)
    • Define record rules if needed
  3. Views (Add to another optional module)

    • Create form view for Season management
    • Create tree/list view for Seasons
    • Create search view with filters
    • Add season field to Agricultural Activity views
    • Add season filters and grouping options to Activity views
  4. Testing

    • Add unit tests for Season model
    • Test season validation
    • Test integration with Agricultural Activities
  5. Season State Management

    • Implement state workflow
    • Add state transition buttons in the form view
  6. Activity Constraints

    • Prevent modification of activities in closed seasons
    • Add filters for activities by season state

Acceptance Criteria

  1. Users can create, edit, and delete seasons
  2. Agricultural activities can be associated with seasons
  3. Activities can be filtered and grouped by season
  4. Season dates are properly validated
  5. Appropriate access controls are in place
  6. All views are functional and user-friendly
  7. Multiple seasons can be active simultaneously
  8. Activities can only be created/modified in active seasons
  9. Season state transitions work as expected
  10. Dashboard provides clear overview of active seasons
  11. Users can easily identify which seasons are active
  12. Historical data in closed seasons is protected from modifications

Dependencies

  • spp_farmer_registry_base module

Documentation Updates

  • Update user documentation to include season management
  • Add technical documentation for new model and relationships
@jeremi jeremi assigned jeremi and singhkaranvir25 and unassigned jeremi Nov 5, 2024
@reichie020212 reichie020212 linked a pull request Jan 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants