Display Sum of overdue payments in Customer Form view for each customer
Your smart button on partners should use a new action, like the button for customer or vendor bills. This button definition should include context="{'default_partner_id': active_id} which will allow to change the partner filter later on, or the upcoming action definition should include the partner in its domain.
The action should be for model account.invoice and have to have the following domain:
[('date_due', '<', time.strftime('%Y-%m-%d')), ('state', '=', 'open')]
If you want to filter only outgoing (customer invoices) add a filter tuple for field type.
In accounting -> Customer Invoices, there is a filter called Overdue. Now I want to calculate the overdue payments per user and then display it onto the customer form view.
I just want to know how can we apply the condition of filter in python code. I have already defined a smart button to display it with a (total invoice value) by inheriting account.invoice.
"Overdue" filter in invoice search view:
['&', ('date_due', '<', time.strftime('%Y-%m-%d')), ('state', '=', 'open')]