Greetings,
I'm currently trying to create a couple reports for my company, and one of the required fields is the counterpart field from the account.move.line model. Currently I'm writing a Python script for the PostgreSQL backend that Odoo uses, because my company requires some additional things in the report Odoo can't provide, and furthermore, I'm not comfortable with module development yet (and would like to avoid it anyways, for this task at least). The counterpart field is the only field that's missing, the report is otherwise finished completely.
So, my question is, how is the counterpart field calculated / chosen? If it's not too complicated, I'd like to do it myself for reasons stated above.
Thank you very much in advance!
Please explain "Counterpart account". Perhaps with examples.
The "Counterpart" can be found when you go to Accounting > Adviser > Journal Items. On the far right, perhaps some horizontal scrolling is needed, there is a field named counterpart. Its description says: "Compute the counter part accounts of this journal item for this journal entry. This can be needed in reports." The field shows the account number(s) related to a given journal item of a journal entry. https://i.imgur.com/nVlaQX6.png
I am unsure if I can easily replicate its function in a script, but my current idea is to just copy and store its content to a new field, that I can then access from postgres. I will keep this thread updated.