I am looking for an pobibility to update data in a linked doctype.
Example:
We are collecting all information about the (possible) order in CRM=>Opportunity
If the Opportunity is converted (approved) customer are doing all the sales calculation in an aditional craftsmanship software.
To track the invoices and payment we are creating a Sales Invoice fetching all the informations from Opportunity. This is working well.
What I want to do:
Step 1: send Sales Invoice date to Opportunity to have the info also there.
Step 2: set status of Opportunity to “closed”, if Sales Invoice is payed.
When a sales invoice is submitted, use the on_submit doc_events (server script) to update all information in the opportunity and close the opportunity.
My code is simple, and it’s working woth DocType Event “After Submit”,
but non of the other DocType Events are working if I am submitting a payment to the invoice. The Invoice is set to “Paid” but the script is not running.
You have to check the update_status logic in the sales invoice/payment entry, because when payment entry submit with full payment then run the update_status