Usage of account_expense from party

Hi,

I will like to set an account_expense at party level, so when I created a new invoice.line at account_invoice module the domain of expense accounts to be used are only the ones that I set it to the party. Is there any module to achieve this?

Thanks!

That is a very weird request. The expense are not booked by party but by usage.
For me, it looks like a pseudo analytic accounting.

Hi! It’s a weird request, but that’s what the customer ask for. I also believe that the analytic accounting would be much better.

To achieve it, I found that I can restrict the domain of the account field inheriting the _account_domain method.

I think this is something that should not be done (even if the customer is requesting it). Especially because the system is not built to allow such usage and it can have many side effects.
I’m pretty sure the need is something else that must be discovered by questioning the customer.

1 Like

Now, I recall that some accounting usage want to separate the expense/revenue for the same product depending on the destination. For example, one account for purchase/sale in the country, one for CE and another for out of EU. Usually it is for tax reporting but this is managed by the tax line in Tryton.
We could have an extension of the tax rule to replace the expense/revenue accounts but it seems over engineering to match an old manual usage. Also in case of mistakes it is much more complex to fix a posted move in the wrong account than a tax line.