Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
5560 Lượt xem

Hallo!I have a situation in my test environment - i created two companies, each company have some employees, some partners, some clients and some contacts. But all these are seen by ALL companies and all users, but the scenario that i am interested to create is - seperate clients for each company, seperate employees and seperate contacts even for each employee... buth with public contacs as well... is it even possible, or i need to create for each company seperate Odoo instance?.

And also - is it possible to encrypt  Odoo instance to be compliant with GDPR in europe?

Thx.

Best regards

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I'm working on the same issue.

Tip: Start here: Odoo 10.0\server\odoo\addons\base\security\base_security.xml

Here you may see interesting code:

    <record model="ir.rule" id="res_partner_rule">
            <field name="name">res.partner company</field>
            <field name="model_id" ref="model_res_partner"/>
            <!--
                Show partners from ancestors and descendants companies
                (or company-less), this is usually a better default for
                multicompany setups.
            -->
            <field name="domain_force">['|','|',('company_id.child_ids','child_of',[user.company_id.id]),('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>
            <field name="active" eval="False"/>
        </record>

Also you might find it useful: https://www.odoo.com/forum/how-to/developers-13/setting-up-rules-access-right-in-xml-csv-files-12667

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You can use Odoo access rules feature to achieve that.Also you can inherit search method for the objects and you can use the domain based on your requirement at the method to have the functionality.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi,

This would help.

<record id="current_company_vendors" model="ir.rule">

        <field name="name">Current Company Partners</field>

        <field name="model_id" ref="base.model_res_partner"/>

        <field name="global" eval="True"/>

        <field name="domain_force">['|',('company_id','child_of',[user.company_id.id]),('company_id','=',False)]</field>

    </record>


Regards,

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Bought some books about Odoo.. but still didn't get an manual for creating such a thing :/

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 10 19
6167
1
thg 7 19
4317
2
thg 8 24
2379
0
thg 7 23
2072
1
thg 11 15
5210