# Usage of account\_expense from party

**URL:** https://discuss.tryton.org/t/usage-of-account-expense-from-party/1644
**Category:** User
**Tags:** accounting, party
**Created:** [August 6, 2019, 6:09pm UTC](https://discuss.tryton.org/t/usage-of-account-expense-from-party/1644 "2019-08-06T18:09:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![lukio](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/lukio/32/98_2.png) [@lukio](https://discuss.tryton.org/u/lukio)
#### Post date: [August 6, 2019, 6:09pm UTC](https://discuss.tryton.org/t/usage-of-account-expense-from-party/1644/1 "2019-08-06T18:09:23Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 6, 2019, 10:21pm UTC](https://discuss.tryton.org/t/usage-of-account-expense-from-party/1644/2 "2019-08-06T22:21:48Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![lukio](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/lukio/32/98_2.png) [@lukio](https://discuss.tryton.org/u/lukio)
#### Post date: [August 8, 2019, 12:56pm UTC](https://discuss.tryton.org/t/usage-of-account-expense-from-party/1644/3 "2019-08-08T12:56:12Z")

</div>

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.](https://hg.tryton.org/modules/account_invoice/file/tip/invoice.py#l1714)

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 8, 2019, 2:01pm UTC](https://discuss.tryton.org/t/usage-of-account-expense-from-party/1644/4 "2019-08-08T14:01:52Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [August 12, 2019, 9:35am UTC](https://discuss.tryton.org/t/usage-of-account-expense-from-party/1644/5 "2019-08-12T09:35:25Z")

</div>

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.
