Commit c8c365d0 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Hack was added to "make things pass". But in reality, new class is needed for Generated Movements.

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@36056 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8cffa174
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2002 Nexedi SARL and Contributors. All Rights Reserved.
......@@ -172,6 +173,10 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
The second approach is chosen for documentary consistency approach :
in ERP5, documents rules, can be synchronized. Simulation can not be
synchronized
TODO:
- consider creating a class GeneratedMovement
and move some superfluous code to it
"""
meta_type = 'ERP5 Movement'
portal_type = 'Movement'
......@@ -195,7 +200,11 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
, PropertySheet.Arrow
, PropertySheet.Movement
, PropertySheet.Price
, PropertySheet.Simulation # XXX-JPS property should be moved to GeneratedMovement class
)
def isPropertyRecorded(self, k): # XXX-JPS method should be moved to GeneratedMovement class
return False
security.declareProtected(Permissions.AccessContentsInformation, 'isMovement')
def isMovement(self):
......@@ -502,33 +511,6 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
security.declareProtected(Permissions.AccessContentsInformation,
'isFrozen')
def isFrozen(self):
"""
Returns the frozen status of this movement.
a movement in stopped, delivered or cancelled states is automatically frozen.
If frozen is locally set to '0', we must check for a parent set to '1', in
which case, we want the children to be frozen as well.
BPM evaluation allows to set frozen state list per Business Path.
"""
business_path = self.getCausalityValue(portal_type='Business Path')
if business_path is None:
# XXX Hardcoded
# Maybe, we should use getPortalCurrentInventoryStateList
# and another portal method for cancelled (and deleted)
# LOG("Movement, isFrozen", DEBUG, "Hardcoded state list")
if self.getSimulationState() in ('stopped', 'delivered', 'cancelled'):
return 1
else:
# conditional BPM enabled frozen state check
# BPM dynamic configuration
if self.getSimulationState() in business_path.getFrozenStateList():
return True
# manually frozen
if self._baseIsFrozen() == 0:
self._baseSetFrozen(None)
return self._baseGetFrozen() or False
security.declareProtected( Permissions.AccessContentsInformation,
'getExplanation')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment