Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UPD] ssi_fixed_asset #119

Merged
merged 1 commit into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 48 additions & 10 deletions ssi_fixed_asset/security/account_asset_security.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,52 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<data noupdate="1">
<data noupdate="0">
<record id="fixed_asset_internal_user_rule" model="ir.rule">
<field name="name">Fixed Asset - Responsible to own data</field>
<field name="model_id" ref="model_fixed_asset_asset" />
<field name="groups" eval="[(4, ref('base.group_user'))]" />
<field name="domain_force">[
('user_id','=',user.id),
]</field>
<field name="perm_unlink" eval="1" />
<field name="perm_write" eval="1" />
<field name="perm_read" eval="1" />
<field name="perm_create" eval="1" />
</record>

<record id="fixed_asset_category_multi_company_rule" model="ir.rule">
<field name="name">Account Asset Category Multi Company</field>
<field ref="model_fixed_asset_category" name="model_id" />
<field eval="True" name="global" />
<field
name="domain_force"
>['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])]</field>
</record>
</data>
<record id="fixed_asset_company_rule" model="ir.rule">
<field name="name">Fixed Asset - Responsible to company data</field>
<field name="model_id" ref="model_fixed_asset_asset" />
<field name="groups" eval="[(4, ref('fixed_asset_company_group'))]" />
<field name="domain_force">[('company_id','=',user.company_id.id)]</field>
<field name="perm_unlink" eval="1" />
<field name="perm_write" eval="1" />
<field name="perm_read" eval="1" />
<field name="perm_create" eval="1" />
</record>

<record id="fixed_asset_company_child_rule" model="ir.rule">
<field
name="name"
>Fixed Asset - Responsible to company and all child companies data</field>
<field name="model_id" ref="model_fixed_asset_asset" />
<field name="groups" eval="[(4, ref('fixed_asset_company_child_group'))]" />
<field name="domain_force">[('company_id','in',user.company_ids.ids)]</field>
<field name="perm_unlink" eval="1" />
<field name="perm_write" eval="1" />
<field name="perm_read" eval="1" />
<field name="perm_create" eval="1" />
</record>

<record id="fixed_asset_all_rule" model="ir.rule">
<field name="name">Fixed Asset - Responsible to all data</field>
<field name="model_id" ref="model_fixed_asset_asset" />
<field name="groups" eval="[(4, ref('fixed_asset_all_group'))]" />
<field name="domain_force">[(1,'=',1)]</field>
<field name="perm_unlink" eval="1" />
<field name="perm_write" eval="1" />
<field name="perm_read" eval="1" />
<field name="perm_create" eval="1" />
</record>
</data>
</odoo>
9 changes: 9 additions & 0 deletions ssi_fixed_asset/security/ir_module_category_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,13 @@
ref="ssi_financial_accounting.financial_accounting_module_category"
/>
</record>

<record id="fixed_asset_data_ownership_module_category" model="ir.module.category">
<field name="name">Fixed Asset</field>
<field
name="parent_id"
ref="ssi_financial_accounting.financial_accounting_data_ownership_module_category"
/>
<field name="sequence">4</field>
</record>
</odoo>
21 changes: 21 additions & 0 deletions ssi_fixed_asset/security/res_group_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,27 @@
/>
</record>

<record id="fixed_asset_company_group" model="res.groups">
<field name="name">Company</field>
<field name="category_id" ref="fixed_asset_data_ownership_module_category" />
</record>

<record id="fixed_asset_company_child_group" model="res.groups">
<field name="name">Company and All Child Companies</field>
<field name="category_id" ref="fixed_asset_data_ownership_module_category" />
<field name="implied_ids" eval="[(4, ref('fixed_asset_company_group'))]" />
</record>

<record id="fixed_asset_all_group" model="res.groups">
<field name="name">All</field>
<field name="category_id" ref="fixed_asset_data_ownership_module_category" />
<field name="implied_ids" eval="[(4, ref('fixed_asset_company_child_group'))]" />
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record>

<!-- Configurator -->
<record id="fixed_asset_category_group" model="res.groups">
<field name="name">Fixed Asset Category</field>
Expand Down
Loading