Add project_work_company_rule.diff. (#5)

Task #048280
This commit is contained in:
juanjo-nan 2021-12-15 13:18:58 +01:00 committed by GitHub
parent 01eaaa61bf
commit 05bd752356
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,21 @@
diff --git a/trytond/trytond/modules/project/work.xml b/trytond/trytond/modules/project/work.xml
index 8a961cf..349c326 100644
--- a/trytond/trytond/modules/project/work.xml
+++ b/trytond/trytond/modules/project/work.xml
@@ -225,5 +225,16 @@ this repository contains the full copyright notices and license terms. -->
<field name="perm_delete" eval="True"/>
</record>
+ <record model="ir.rule.group" id="rule_group_work_companies">
+ <field name="name">User in companies</field>
+ <field name="model" search="[('model', '=', 'project.work')]"/>
+ <field name="global_p" eval="True"/>
+ </record>
+ <record model="ir.rule" id="rule_work_companies">
+ <field name="domain"
+ eval="[('company', 'in', Eval('user', {}).get('companies', []))]"
+ pyson="1"/>
+ <field name="rule_group" ref="rule_group_work_companies"/>
+ </record>
</data>
</tryton>

2
series
View File

@ -108,3 +108,5 @@ issue9049-issue4050.diff # [purchase] Add origin and set on returned purchase +
issue10680.diff # [product] Fix get_template in reference field case
issue10845.diff # [commission] Do not reverse commission when canceling invoice with move
project_work_company_rule.diff # [project] Add company rule at project level [#048280]