Is It Possible to Add Quantities to Assets in FarmOS?

Hello everyone,

I know that logs in FarmOS can track quantities (e.g., harvest amounts, inputs, etc.), but I was wondering if it’s possible to directly assign quantities to assets themselves? We need to sum the nutrient contents of the fertilizer, can we link or associate a quantity directly with an asset for easier tracking?

Is there any built-in feature for managing or summing quantities of specific ingredients or nutrient content within assets, or would that require a custom solution?

If anyone has experience with this or a workaround, I’d love to hear your thoughts!

Thanks!

1 Like

There isn’t a built-in way to directly assign arbitrary quantities to assets in farmOS, although this has been discussed recently (@braught has added some custom fields for land asset dimensions via the FarmData2 module, for instance).

If you are willing to create your own custom module, it’s relatively easy to add custom int or decimal fields to assets. Just be careful to namespace them so they don’t create potential conflicts later. For more info, refer to these documentation pages:

This discussion may also have some related ideas:

Are you thinking about Material assets, specifically?

If so, I wonder if it would actually make more sense to add these kinds of measurements to Material Type taxonomy terms, instead of the assets. Then, you could have multiple Material assets that reference the same Material Type, and therefore share the same values.

Another option might be to simply put your data into the “Description” field of the Material Type terms. Not ideal (hard to extract/use this data elsewhere), but available now without any modifications, and visible to users in farmOS UI. :person_shrugging:

2 Likes

I meant to also mention: the Inventory module allows you to track inventory level(s) on assets, which is one way of “assigning quantities” to them. But the inventory adjustments are recorded via logs, and the intention is that they change over time. So it’s not exactly what you were describing, with regards to material nutrient levels. But worth noting as another potential workaround/option perhaps.

Hello Mike, thanks for the quick response!
We run a arable farm and are looking for a solution that helps us efficiently manage the government-required documentation. We want to use the documentation to calculate gross margins per field. Additionally, we want to be able to sum up the nutrient contents of fertilizers to optimize our nutrient balances per year and plant.
Attached is an PDF file with a draft data model, including an example for each entity.
I’d like to avoid re-entering all the nutrient contents with each input log, which is why I’m hoping to link the quantities directly to an asset to make tracking easier.
I’d really appreciate your help!
Thank you!

Data-model-en.pdf (28.7 KB)

2 Likes

Thanks for sharing that data model PDF @Ludwig! Very helpful to see how you’re modeling things. It looks great!

One small suggestion: In your seeding, input, medical, and harvest logs I notice that you include two assets in the log’s asset field (eg: “W-Rapeseed Field A Plant 24/25” plant asset and “W-Rapeseed Otello KWS Seed” seed asset in the seeding log). This may have unintended consequences. For example, seeding logs are “movements” by default, and any assets referenced in the asset field will be “moved” by them. The asset field is generally meant to be used for “the assets that are receiving the action” (as opposed to the location field which is “where the action took place”, or the equipment field which is “the equipment that performed the action”).

It makes sense that you would want to reference the seed, material, and product assets the way that you are, but I think it would be better to move them somewhere else.

One way to do it is to reference those “secondary” assets from the “Inventory Asset” field on your quantities. This would also allow you to start tracking inventory for those seed, material, and product assets.

For example, you could reference the “Innovert Rapeseed Material” asset from the “Price” quantity on that log, and record it as an inventory “decrement”. Then, you can also record Purchase logs that “increment” the inventory of the material asset.

These are both great ideas, and probably each warrant their own dedicated forum topic! :slight_smile:

The gross margin calculation will require establishing a standard convention for recording costs and sale prices. If you haven’t already, check out this forum topic about conventions:

I’m sure there are others that would benefit from nutrient balance optimization features too.

There are two ways to go about feature development in farmOS: custom or general. I always try to encourage designing general solutions that can be built and maintained by the community. But sometimes custom solutions are necessary to get the job done in the short term. :slight_smile:

To understand generally how stuff gets built, read this:

We also created a “Jobs Board” category a while back, although it hasn’t had much action :sweat_smile: - if you want to offer sponsored development of a custom module (which could be a start to a community module), you can consider posting there! Jobs Board - farmOS

1 Like