Understanding Seed Assets + Seeding Logs + Plant/Seed Locations

I would recommend thinking about this differently. Here is how I would model it:

  • Use a seed asset to represent your inventory of a particular seed.
  • Create a plant asset and a seeding log whenever some of that seed is planted in the ground.
  • The plant can optionally reference the seed as its parent, if that’s useful for traceability.
  • The seeding log should reference the plant asset in the “Assets” field of the log… it should NOT reference the seed asset there.
  • The seeding log should be a movement. That is the default behavior of a seeding log. And the plant asset should not be “fixed”.
  • Add a Quantity to the seeding log which references the seed asset as an inventory adjustment, which decrements the amount of seed that was used.

This serves to link both the plant and seed assets to the seeding log, for different purposes. It’s better to think about it as “I am seeding the plant asset” rather than “I am seeding the seed asset”. You are decrementing the inventory of the seed asset in the process of seeding (creating+locating/moving) the plant asset… if that makes sense. :slight_smile:

Even though your plant’s “don’t move” during their lifecycle (after being seeded), it is still better to use the default seeding log is_movement behavior to assign their location. They just have one movement. And that’s OK. :slight_smile:

Yes, that is one way of thinking about it, but as you said: you are not moving ALL the seed.

So a better way to think about it is: you are “using up” the seed to create a plant asset. And you are moving that plant asset to the field.

(As an aside: if you were planting into plug trays first, you would be moving the plant asset to a greenhouse first perhaps, and then moving them again to the field as transplants. Or, if you sell starts/potted plants then they may move multiple times.)

Outside of the context of farmOS, these words all sort of mean the same thing. But inside farmOS, it’s important to have these distinctions, so that everything works correctly. You discovered that if you “move” the seed asset you run into two issues: it changes the location of the seed asset, which you don’t want, and it doesn’t handle the fact that you still have more seed left over. So, by thinking of it differently, leaving the seed where it is, decrementing its inventory, and moving the new plant asset, you can resolve both of those issues and have a “current location” of both your seed and plant assets that are accurate. And seed inventory too!

Hope that all makes sense. This would be a good candidate for a core convention, IMO. I might write one up to provide as reference in the future.

2 Likes