Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
2f2bad3a
Commit
2f2bad3a
authored
Oct 30, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_erp5: give read access to Open Order to sale/accountant people
parent
0c2e2d58
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
90 additions
and
12 deletions
+90
-12
master/bt5/slapos_erp5/LocalRolesTemplateItem/open_sale_order_module.xml
...os_erp5/LocalRolesTemplateItem/open_sale_order_module.xml
+7
-5
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Open%20Sale%20Order%20Module.xml
...talTypeRolesTemplateItem/Open%20Sale%20Order%20Module.xml
+11
-5
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Open%20Sale%20Order.xml
..._erp5/PortalTypeRolesTemplateItem/Open%20Sale%20Order.xml
+12
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
...l_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
+59
-1
master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/local_permission_slapos_interaction_workflow/interaction_OpenSaleOrder_edit.xml
...s_interaction_workflow/interaction_OpenSaleOrder_edit.xml
+1
-1
No files found.
master/bt5/slapos_erp5/LocalRolesTemplateItem/open_sale_order_module.xml
View file @
2f2bad3a
<local_roles_item>
<local_roles_item>
<local_roles>
<local_roles>
<role
id=
'G-COMPANY'
>
<role
id=
'F-ACCOUNTING*'
>
<item>
Auditor
</item>
</role>
<role
id=
'F-SALE*'
>
<item>
Auditor
</item>
<item>
Auditor
</item>
<item>
Author
</item>
</role>
</role>
</local_roles>
</local_roles>
<local_role_group_ids>
<local_role_group_ids>
<local_role_group_id
id=
'
group
'
>
<local_role_group_id
id=
'
function
'
>
<principal
id=
'
G-COMPANY
'
>
Auditor
</principal>
<principal
id=
'
F-ACCOUNTING*
'
>
Auditor
</principal>
<principal
id=
'
G-COMPANY'
>
Auth
or
</principal>
<principal
id=
'
F-SALE*'
>
Audit
or
</principal>
</local_role_group_id>
</local_role_group_id>
</local_role_group_ids>
</local_role_group_ids>
</local_roles_item>
</local_roles_item>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Open%20Sale%20Order%20Module.xml
View file @
2f2bad3a
<type_roles>
<type_roles>
<role
id=
'Author; Auditor'
>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Group company
</property>
<property
id=
'title'
>
Accountant
</property>
<multi_property
id=
'categories'
>
local_role_group/group
</multi_property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
group/company
</multi_property>
<multi_property
id=
'category'
>
function/accounting*
</multi_property>
<multi_property
id=
'base_category'
>
group
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Sale
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/sale*
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
</role>
</type_roles>
</type_roles>
\ No newline at end of file
master/bt5/slapos_erp5/PortalTypeRolesTemplateItem/Open%20Sale%20Order.xml
View file @
2f2bad3a
<type_roles>
<type_roles>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Accountant
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/accounting*
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Auditor'
>
<property
id=
'title'
>
Sale
</property>
<multi_property
id=
'categories'
>
local_role_group/function
</multi_property>
<multi_property
id=
'category'
>
function/sale*
</multi_property>
<multi_property
id=
'base_category'
>
function
</multi_property>
</role>
<role
id=
'Auditor'
>
<role
id=
'Auditor'
>
<property
id=
'title'
>
User
</property>
<property
id=
'title'
>
User
</property>
<property
id=
'condition'
>
python: (here.getDestinationSection('', portal_type='Person') != '') and (context.getLedger("") == "automated")
</property>
<property
id=
'condition'
>
python: (here.getDestinationSection('', portal_type='Person') != '') and (context.getLedger("") == "automated")
</property>
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py
View file @
2f2bad3a
...
@@ -1380,7 +1380,6 @@ class TestSalePackingListModule(TestSlapOSGroupRoleSecurityMixin):
...
@@ -1380,7 +1380,6 @@ class TestSalePackingListModule(TestSlapOSGroupRoleSecurityMixin):
[
'F-SALE*'
,
'F-ACCOUNTING*'
,
module
.
Base_getOwnerId
()],
False
)
[
'F-SALE*'
,
'F-ACCOUNTING*'
,
module
.
Base_getOwnerId
()],
False
)
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
...
@@ -1394,3 +1393,62 @@ class TestSalePackingList(TestSlapOSGroupRoleSecurityMixin):
...
@@ -1394,3 +1393,62 @@ class TestSalePackingList(TestSlapOSGroupRoleSecurityMixin):
self
.
assertRoles
(
delivery
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
class
TestOpenSaleOrderModule
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_OpenSaleOrderModule
(
self
):
module
=
self
.
portal
.
open_sale_order_module
self
.
assertSecurityGroup
(
module
,
[
'F-SALE*'
,
'F-ACCOUNTING*'
,
module
.
Base_getOwnerId
()],
False
)
self
.
assertRoles
(
module
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
module
,
module
.
Base_getOwnerId
(),
[
'Owner'
])
class
TestOpenSaleOrder
(
TestSlapOSGroupRoleSecurityMixin
):
def
test_OpenSaleOrder_default
(
self
):
delivery
=
self
.
portal
.
open_sale_order_module
.
newContent
(
portal_type
=
'Open Sale Order'
)
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALE*'
,
'F-ACCOUNTING*'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
def
test_OpenSaleOrder_user
(
self
):
reference
=
'TESTPERSON-%s'
%
self
.
generateNewId
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
reference
=
reference
)
delivery
=
self
.
portal
.
open_sale_order_module
.
newContent
(
portal_type
=
'Open Sale Order'
)
delivery
.
edit
(
ledger
=
'automated'
,
destination_section_value
=
person
)
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALE*'
,
'F-ACCOUNTING*'
,
self
.
user_id
,
person
.
getUserId
()],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
person
.
getUserId
(),
[
'Auditor'
])
delivery
.
edit
(
ledger
=
None
)
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALE*'
,
'F-ACCOUNTING*'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
delivery
.
edit
(
ledger
=
'automated'
,
destination_section_value
=
None
)
self
.
assertSecurityGroup
(
delivery
,
[
'F-SALE*'
,
'F-ACCOUNTING*'
,
self
.
user_id
],
False
)
self
.
assertRoles
(
delivery
,
self
.
user_id
,
[
'Owner'
])
self
.
assertRoles
(
delivery
,
'F-SALE*'
,
[
'Auditor'
])
self
.
assertRoles
(
delivery
,
'F-ACCOUNTING*'
,
[
'Auditor'
])
master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/local_permission_slapos_interaction_workflow/interaction_OpenSaleOrder_edit.xml
View file @
2f2bad3a
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<key>
<string>
trigger_method_id
</string>
</key>
<key>
<string>
trigger_method_id
</string>
</key>
<value>
<value>
<tuple>
<tuple>
<string>
_setDestination.*
</string>
<string>
_setDestination
Section
.*
</string>
<string>
_setLedger.*
</string>
<string>
_setLedger.*
</string>
</tuple>
</tuple>
</value>
</value>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment