In certain scenarios involving mutliple payments for multiple
invoices, where the reconciliation happens together and the debit
move is the smaller item the aging duplicates its value, making
the balance greater than it should be.
This fix works by preventing moves where different lines are both partial
reconciled being grouped together by adding the lines id
to the group by clause of _show_buckets_sql_q1
By default we checked for an empty data dict in _get_report_values
however the mail template sends a file type and editor key by default.
We now check if the required company_id is in the dictionary. We also support
supplying force_company in context for setting the company for auto generated
emails.
Before this change, if a payment was reconciled using the bank statement widget
the move was seperated into many multiples of lines making activity
statements twice as long as necessary.
Now payments are a single line