Consider scenario where fetch_from field should auto update value when the parent document value is changed.
Employee field nationality
Expense Claim with field employee and field nationality (nationality is fetched from employee), i.e employee.nationality
If Nationality changes in Employee Record, it should also change in all Doctypes where nationality is fetched from employee.nationality
What do you think about the above.
Is it a good idea?
is there cons to it?
will it be a good feature addition to Frappe?
Just quick thoughts that came to my mind. There is a possibility that I understood the problem partially.
The proposed solution of updated related data for fields in a document on update looks promising, however it may face scalability challenges in high-volume scenarios. Think of companies that generate a significant number of invoices daily and invoice has auto fetch field.
A single change in a field’s value to require updates to thousands or more documents can be a real bottleneck even if queues are added. Additionally, in many scenarios data maybe auto fetched based various logics and hence we may need to update only select documents, in this case the complexity at scales increases further.
An alternative approach would be to keep the data in its original document and link it to related documents dynamically. This can reduce the complexity of updating fields. For better ux we can maybe store the data in a field in view page temporarily, In a cache of some sort.
The link fields associated with auto fetched fields can maybe have metadata to track when the fields were last changed further
improving the performance.
Just let me know what you feel about the thoughts above.