agriculture
agriculture copied to clipboard
Add functionality to recalculate weight on server and display in tree view
For these new doctypes pending PR and approval: New DocType Animal Group and Tree View frappe/erpnext#15209
The functionality we developed depends on each Animal Group being opened and saved for proper weight calculations to occur, given serialized animal group members whose weight instances update each time the doctype is opened and saved. Thus, when observing in tree view, the weights shown are the total weights for the group when user last opened that animal group in ERPNext and refreshed resaved it. This can eventually lead to incorrect data if too many animal groups exist.
The proposed functionality will enable the same calculations run by animal group doctype on the server, to occur every time the tree view for animal group is loaded, this ensures data consistency, and guarantees that the displayed data is the most up to date.
This problem happens because serialized animals can have individual weights, and only the last weight instance is considered when loading, refreshing and re-saving the animal group doctype. @monroy95