Event Streaming Syncing issue

Am experiencing a weird issue with event streaming

This affects sales invoices with payment

The draft of these invoices are synced but the submitted invoices do not get synced. So in the consumer site the invoices remain as draft.

If there is no payment included in the Invoice it syncs the submitted invoices, but if payment is included only the draft is submitted.

If I submit an unpaid invoice and then make payment entry afterwards the payment entry is synced and the invoice status is properly changed to paid.

I drilled down and discovered that the problem is with Sales Invoice Payment table. If there is a mode of payment with zero value the invoice will not sync when submitted. However if all the mode of payments have values in the Sales Invoice Payment table the submitted invoice will be synced.

I also have the following error in the error sync log

File “/opt/bench/default/apps/frappe/frappe/event_streaming/doctype/event_producer/event_producer.py”, line 372, in check_doc_has_dependencies
sync_child_table_dependencies(doc, table_fields, producer_site)
File “/opt/bench/default/apps/frappe/frappe/event_streaming/doctype/event_producer/event_producer.py”, line 383, in sync_child_table_dependencies
child_doc = frappe._dict(child_doc)
TypeError: ‘NoneType’ object is not iterable

@rucha_mahabal do you want to have an idea of what the issue could be?

@youssef do you want to have a look at this too?

Hi guys, just in case you are not able to reproduce the error in your instance, let me give you step by step to reproducing it

  1. Create a normal sales invoice (not PoS)
  2. Chose "Include Payment PoS’
  3. Make sure the Pos Profile used has more than one mode of payment.
  4. Put all the payment in one mode of payment, let the others have zero value
  5. Save and submit the invoice.

You will notice that at the consumer site the invoice will be in draft and not submitted state.

This is a serious bug in event streaming, and it has been bugging me.

Can you please confirm that you can replicate this issue ?

I think this issue is related to syncing any child table

I think this should fix it:

2 Likes

Thanks @rucha_mahabal

Will test it once this is merged