# Company rule in account module

**URL:** https://discuss.tryton.org/t/company-rule-in-account-module/1841
**Category:** Developer
**Created:** [October 16, 2019, 8:26am UTC](https://discuss.tryton.org/t/company-rule-in-account-module/1841 "2019-10-16T08:26:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [October 16, 2019, 8:26am UTC](https://discuss.tryton.org/t/company-rule-in-account-module/1841/1 "2019-10-16T08:26:27Z")

</div>

By default the foundation modules which depends on company module preload rules in order to [filter records by the current user company](http://hg.tryton.org/modules/account_invoice/file/tip/invoice.xml#l387).

This is not the case of account module (and analytic\_account) in which by default the rule [use all companies of the user](http://hg.tryton.org/modules/account/file/tip/account.xml#l188) (this is main company and its children).

So I propose to follow the same pattern of the majority of modules and preload rules by current user company. What do you think?  
For me the current implementation is too much open. If we use current user company the users (and partners) could relax the rule group (if required) adding another lines. By now we have to modify this current rule by xml.

---

<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: [October 16, 2019, 9:47am UTC](https://discuss.tryton.org/t/company-rule-in-account-module/1841/2 "2019-10-16T09:47:06Z")

</div>

> [@sergyo](#):
>
> So I propose to follow the same pattern of the majority of modules and preload rules by current user company. What do you think?

Company record rule must be removed: [Remove company record rules (#4080) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue4080)  
This is the only way to have working multi-company in the future.

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [October 16, 2019, 10:01am UTC](https://discuss.tryton.org/t/company-rule-in-account-module/1841/3 "2019-10-16T10:01:10Z")

</div>

> [@ced](#):
>
> Company record rule must be removed: [Remove company record rules (#4080) · Issues · Tryton / Tryton · GitLab](https://bugs.tryton.org/issue4080)  
> This is the only way to have working multi-company in the future.

That’s right but this issue is pending for a long time ..  
I remember it was proposed in the last crowd-funding but it wasn’t upvoted as candidate. So probably it isn’t so interesting for the community.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [October 16, 2019, 11:42am UTC](https://discuss.tryton.org/t/company-rule-in-account-module/1841/4 "2019-10-16T11:42:47Z")

</div>

> [@sergyo](#):
>
> I remember it was proposed in the last crowd-funding but it wasn’t upvoted as candidate. So probably it isn’t so interesting for the community.

Indeed this is something I also was interested on make it happen, i started to work on it but unfortunatly I do not have anymore time to invest on it.

Should we try the crowd-funding another time?

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [October 16, 2019, 1:49pm UTC](https://discuss.tryton.org/t/company-rule-in-account-module/1841/5 "2019-10-16T13:49:42Z")

</div>

> [@pokoli](#):
>
> Should we try the crowd-funding another time?

If you try again [we](http://datalifeit.es) will contribute (again).  
Indeed would be great to create a discuss topic about this, pointing to existing issue conversations, in order to know and discuss the final implementation.

---

<div class="post-metadata">

### Author: ![dave](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/d/ee7513/32.png) [@dave](https://discuss.tryton.org/u/dave)
#### Post date: [October 17, 2019, 1:31pm UTC](https://discuss.tryton.org/t/company-rule-in-account-module/1841/6 "2019-10-17T13:31:04Z")

</div>

> [@sergyo](#):
>
> I remember it was proposed in the last crowd-funding but it wasn’t upvoted as candidate. So probably it isn’t so interesting for the community.

This is one item that I am interested in (and would now be able to contibute to), as well as [Issue 5694: Remove multidatabase support](https://bugs.tryton.org/issue5694)
