Add a concept of "lifespan" to assets, similar to "location", "group membership", etc - and allow it to be tracked via logs. So one log can define the start of an asset's life, and one can define the end.

Old summary:

(The following is the old summary of this issue. See #2934961: Change asset "active" property to "archived" for insight into how/why this changed.)

Currently assets are marked as "active" or "inactive" via a checkbox when you edit the asset. This serves the most-basic purpose of showing/hiding assets in farmOS (so you can hide old plantings, for example) - but it's not very advanced.

Ideally, the "active" status of an asset would be determined by logs - similar to it's location. In other words, when you log an activity (and/or other log types) on an asset, you should have the ability to change the status of the asset along with that log. If you had multiple logs affecting the asset's status, the most recent one would be the determining factor (just like location determination via movement logs).

Comments

m.stenta created an issue. See original summary.

m.stenta’s picture

Project: Farm Asset » farmOS
Component: Documentation » Farm Assets

All farmOS repositories have been merged into the farmOS distribution (see #2876992: Merge farmOS repositories into drupal.org/project/farm). I'm going through and moving all open issues from the various project issue queues to the central queue now...

m.stenta’s picture

Title: Activate/deactivate assets via logs » Define asset lifespan via logs
Issue summary: View changes

I am adapting this feature request to dovetail with: #2934961: Change asset "active" property to "archived"

This feature will add a log-based lifespan concept to assets, whereas the other one will be specifically for "archiving" assets. They are two separate things, and should be treated as such.

m.stenta’s picture

Question: what happens if you have more than two logs defining start and end to the asset's lifespan? Do we just take the earliest and latest ones and ignore everything in between?

m.stenta’s picture

m.stenta’s picture

m.stenta’s picture

Interesting and related idea from this forum post: https://farmos.discourse.group/t/feedback-after-my-first-2-months-questi...

having a general timer function would be nice. I have seen posts before about linking two logs together for different purposes, i.e., “pig was bred” linked to “pig gave birth” log. These linked together with a timer that calculated the days between the logs would be great. This would help for tracking gestation time, weaning time, lifespan, days on a single paddock, growing time of a seedling or planting. Or, even an open ended time it has been X days since “my pig was bred” and once it gives birth, I can stop that timer. This was touched on a bit in drupal.org/project/farm/issues/2630218, but I think this can be implemented more generally to extract more info than just asset life span. I envision this as timers being their own tab inside a log similar to quantity, inventory, files, etc. Maybe timers are there own asset type? In the timer tab, any log could create or end multiple timers. Maybe there is an option for a count down or count up timer. This leaves huge flexibility on how the timers can be used.

m.stenta’s picture

Moving this to 8.x-2.x. Curious if we can leverage the State Machine module: https://www.drupal.org/project/state_machine - perhaps with some way of linking state changes/revisions to Logs?

m.stenta’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev
m.stenta’s picture

Version: 8.x-2.x-dev » 2.x-dev
m.stenta’s picture

Status: Active » Closed (outdated)

Closing old discussions... let's use the forum instead.