Reputation: 155
I would like to calculate the total debt of partner_id, with all his debit on every his invoice
as an example:
In Accounting\Customer Invoices
I have a
when I click on bbb
opens
when I click on the report, in my case Automatski racun
I want to enter in the field Vaš ukupan dug
the total debt of all accounts that bbb
has
And can you tell me how to iterate over all partner_id eg. in the Journal Items
Because I tried this way to get a total of bbb
debt, but I did not know how to iterate
If I'm not clear enough or you need more information, please let me know
Upvotes: 0
Views: 178
Reputation: 685
Here it is the code.
@api.onchange('partner_id')
def set_customer_credit(self):
self.custom_field = self.partner_id.credit
Upvotes: 1