Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Papa Tamsir Kane
erp5
Commits
9d710981
Commit
9d710981
authored
9 years ago
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code factorization for security permissions in Solvers
parent
e447832e
master
after_rebase
allow_login_change
allow_login_change_differentiate_id_and_login
allow_login_change_wip
arnau
bt5_config
cherry-pick-4a8e045d
cleanup_acquisition_base_category
compact_title_no_reference
cr_test
cr_test_rebase
delivery_item_barcode
dsn-phase3
eos-dev
erp5-component
erp5-vifib
erp5-vifib-cleanup
erp5_catalog
erp5testnode_max_timeout
experiment/coding_style_test_suite
feat/accounting_balance_sheet_profit_and_loss_cleanups
feat/accounting_stop_using_getObject
feat/accounting_translate_gap
feat/no_useless_records_in_predicate_table
feat/olapy
feat/trade_shipment_report
feat/wendelin-py-data
feature/renderjs-formbox
feature/renderjs-matrixbox
feature/renderjs-ui-no-header
fix/full_text_script_conflict
fix/login_validate_check_consistency
fix/repair_graph_editor
fix/xvfb_all_displays_locked
for_testrunner_1
for_testrunner_2
for_testrunner_3
gadget-json-value
isDeletable
item_tracking_graph_editor
jm/form-action-guard
joblib-activity
maste_copy
master_calendar_wip_patches
master_calendar_wip_patches_extend_security
master_no_guard_on_workflow_transition
master_no_guard_on_workflow_transition_plus_calendar_wip_patchs
monitoring
no_longer_simulated_state
officejs_clean
officejs_zip
portal_callables
portal_solver_process_security_configuration
reindex_calendar_after_change_calendar_exception
reverse_logistics
rewrite_test_21_AcquiredPortalType
sms_more_than_140_characters
sws_fix
taskdistribution-xmlrpc-binary
tmp/getInstalledBusinessTemplate_never_installed_bt
tristan-merge
view-aggregated-amounts
erp5.util-0.4.49
erp5.util-0.4.46
erp5.util-0.4.44
No related merge requests found
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
15 additions
and
33 deletions
+15
-33
product/ERP5/Document/AcceptSolver.py
product/ERP5/Document/AcceptSolver.py
+1
-5
product/ERP5/Document/AdoptSolver.py
product/ERP5/Document/AdoptSolver.py
+1
-5
product/ERP5/Document/ItemListSplitSolver.py
product/ERP5/Document/ItemListSplitSolver.py
+1
-5
product/ERP5/Document/MovementSplitSolver.py
product/ERP5/Document/MovementSplitSolver.py
+1
-4
product/ERP5/Document/QuantitySplitSolver.py
product/ERP5/Document/QuantitySplitSolver.py
+1
-4
product/ERP5/Document/TradeModelSolver.py
product/ERP5/Document/TradeModelSolver.py
+1
-5
product/ERP5/Document/UnifySolver.py
product/ERP5/Document/UnifySolver.py
+1
-5
product/ERP5/mixin/solver.py
product/ERP5/mixin/solver.py
+8
-0
No files found.
product/ERP5/Document/AcceptSolver.py
View file @
9d710981
...
...
@@ -29,7 +29,6 @@
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5.mixin.solver
import
ConfigurablePropertySolverMixin
class
AcceptSolver
(
ConfigurablePropertySolverMixin
):
...
...
@@ -42,10 +41,7 @@ class AcceptSolver(ConfigurablePropertySolverMixin):
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
# ISolver Implementation
security
.
declarePrivate
(
'solve'
)
@
UnrestrictedMethod
def
solve
(
self
,
activate_kw
=
None
):
def
_solve
(
self
,
activate_kw
=
None
):
"""
Adopt new property to simulation movements, with keeping the
original one recorded.
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/Document/AdoptSolver.py
View file @
9d710981
...
...
@@ -29,7 +29,6 @@
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5.mixin.solver
import
ConfigurablePropertySolverMixin
class
AdoptSolver
(
ConfigurablePropertySolverMixin
):
...
...
@@ -42,10 +41,7 @@ class AdoptSolver(ConfigurablePropertySolverMixin):
security
=
ClassSecurityInfo
()
security
.
declareObjectProtected
(
Permissions
.
AccessContentsInformation
)
# ISolver Implementation
security
.
declarePrivate
(
'solve'
)
@
UnrestrictedMethod
def
solve
(
self
,
activate_kw
=
None
):
def
_solve
(
self
,
activate_kw
=
None
):
"""
Adopt new property to movements or deliveries.
"""
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/Document/ItemListSplitSolver.py
View file @
9d710981
...
...
@@ -31,7 +31,6 @@ import zope.interface
from
AccessControl
import
ClassSecurityInfo
from
Acquisition
import
aq_base
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5.mixin.solver
import
SolverMixin
from
Products.ERP5.mixin.configurable
import
ConfigurableMixin
...
...
@@ -65,10 +64,7 @@ class ItemListSplitSolver(SolverMixin, ConfigurableMixin, XMLObject):
interfaces
.
IConfigurable
,
)
# ISolver Implementation
security
.
declarePrivate
(
'solve'
)
@
UnrestrictedMethod
def
solve
(
self
,
activate_kw
=
None
):
def
_solve
(
self
,
activate_kw
=
None
):
"""This method create new movement based on difference of aggregate sets.
It supports only removed items.
Quantity divergence is also solved with sum of aggregated quantities stored
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/Document/MovementSplitSolver.py
View file @
9d710981
...
...
@@ -58,10 +58,7 @@ class MovementSplitSolver(SolverMixin, ConfigurableMixin, XMLObject):
interfaces
.
IConfigurable
,
)
# ISolver Implementation
security
.
declarePrivate
(
'solve'
)
@
UnrestrictedMethod
def
solve
(
self
,
activate_kw
=
None
):
def
_solve
(
self
,
activate_kw
=
None
):
"""
This method splits a Delivery and move movements in to a new
Delivery. Splitting is done by duplicating the Delivery, removing
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/Document/QuantitySplitSolver.py
View file @
9d710981
...
...
@@ -31,7 +31,6 @@ import zope.interface
from
AccessControl
import
ClassSecurityInfo
from
Acquisition
import
aq_base
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5Type.Globals
import
PersistentMapping
from
Products.ERP5.mixin.solver
import
SolverMixin
...
...
@@ -67,9 +66,7 @@ class QuantitySplitSolver(SolverMixin, ConfigurableMixin, XMLObject):
)
# ISolver Implementation
security
.
declarePrivate
(
'solve'
)
@
UnrestrictedMethod
def
solve
(
self
,
activate_kw
=
None
):
def
_solve
(
self
,
activate_kw
=
None
):
"""
"""
configuration_dict
=
self
.
getConfigurationPropertyDict
()
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/Document/TradeModelSolver.py
View file @
9d710981
...
...
@@ -29,7 +29,6 @@
import
zope.interface
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5.Document.AcceptSolver
import
AcceptSolver
class
TradeModelSolver
(
AcceptSolver
):
...
...
@@ -58,10 +57,7 @@ class TradeModelSolver(AcceptSolver):
# Declarative interfaces
zope
.
interface
.
implements
(
interfaces
.
ISolver
,)
# ISolver Implementation
security
.
declarePrivate
(
'solve'
)
@
UnrestrictedMethod
def
solve
(
self
,
activate_kw
=
None
):
def
_solve
(
self
,
activate_kw
=
None
):
"""
Adopt new values to simulation movements, with keeping the original
one recorded, and then update Trade Model related lines accordingly.
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/Document/UnifySolver.py
View file @
9d710981
...
...
@@ -30,7 +30,6 @@
import
zope.interface
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
Products.ERP5.Document.AcceptSolver
import
AcceptSolver
class
UnifySolver
(
AcceptSolver
):
...
...
@@ -90,10 +89,7 @@ class UnifySolver(AcceptSolver):
simulation_movement_list
.
append
(
simulation_movement
)
return
simulation_movement_list
# ISolver Implementation
security
.
declarePrivate
(
'solve'
)
@
UnrestrictedMethod
def
solve
(
self
,
activate_kw
=
None
):
def
_solve
(
self
,
activate_kw
=
None
):
"""
Adopt new property value to simulation movements and their deliveries,
while keeping the original one recorded.
...
...
This diff is collapsed.
Click to expand it.
product/ERP5/mixin/solver.py
View file @
9d710981
...
...
@@ -30,6 +30,7 @@
import
zope.interface
from
AccessControl
import
ClassSecurityInfo
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type.UnrestrictedMethod
import
super_user
from
Products.ERP5Type.XMLObject
import
XMLObject
from
Products.ERP5.mixin.configurable
import
ConfigurableMixin
...
...
@@ -44,7 +45,14 @@ class SolverMixin(object):
# Declarative interfaces
zope
.
interface
.
implements
(
interfaces
.
ISolver
,)
def
_solve
(
self
,
activate_kw
=
None
):
raise
NotImplementedError
# Implementation of ISolver
security
.
declarePrivate
(
'solve'
)
def
solve
(
self
,
activate_kw
=
None
):
with
super_user
():
self
.
_solve
(
activate_kw
=
activate_kw
)
def
getPortalTypeValue
(
self
):
return
self
.
getPortalObject
().
portal_solvers
.
_getOb
(
self
.
getPortalType
())
...
...
This diff is collapsed.
Click to expand it.
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