Commit bed358a3 authored by Aurel's avatar Aurel

remove uneeded property

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@6595 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8245bf73
##############################################################################
#
# Copyright (c) 2002, 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
# Romain Courteaud <romain@nexedi.com>
# Alexandre Boeglin <alex@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Rule import Rule
from zLOG import LOG
class AccountingTransactionRule(Rule):
"""
Accounting Transaction Rule object make sure an Accounting Transaction Line
in the simulation is consistent with the real accounting transaction.
WARNING: what to do with movement split ?
"""
# CMF Type Definition
meta_type = 'BAOBAB Accounting Transaction Rule'
portal_type = 'Accounting Transaction Rule'
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Default Properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.DublinCore
)
def test(self, movement):
"""
Tests if the rule (still) applies.
"""
# An accounting transaction rule never applies since it is always
# explicitely instanciated.
return 0
# Simulation workflow
security.declareProtected(Permissions.ModifyPortalContent, 'expand')
def expand(self, applied_rule, force=0, **kw):
"""
Expands the current movement downward:
-> new status -> expanded
An applied rule can be expanded only if its parent movement
is expanded.
"""
delivery_line_type = 'Simulation Movement'
# Get the accounting transaction when we come from.
my_accounting_transaction = applied_rule.getDefaultCausalityValue()
# Only expand if my_accounting_transaction is not None and state is
# not 'confirmed'.
if my_accounting_transaction is not None:
# Only expand accounting transaction rule if accounting transaction
# not yet confirmed (This is consistent with the fact that once
# simulation is launched, we stick to it).
if force or \
(applied_rule.getLastExpandSimulationState() not in \
applied_rule.getPortalReservedInventoryStateList() and \
applied_rule.getLastExpandSimulationState() not in \
applied_rule.getPortalCurrentInventoryStateList()):
# First, check each contained movement and delete previous simulation movements
for movement in applied_rule.contentValues(filter={'portal_type': \
applied_rule.getPortalMovementTypeList()}):
movement.flushActivity(invoke=0)
applied_rule._delObject(movement.getId())
# Copy each accounting movement (line or cell) from the accounting transaction
for accounting_transaction_line_object in my_accounting_transaction.contentValues(filter={ \
'portal_type':applied_rule.Baobab_getAccountingMovementTypeList()}):
LOG('AccountingTransactionRule.expand, examining:',0, \
accounting_transaction_line_object.getPhysicalPath())
try:
if accounting_transaction_line_object.hasCellContent():
for c in accounting_transaction_line_object.getCellValueList():
new_id = accounting_transaction_line_object.getId() + '_' + c.getId()
LOG('Create Cell', 0, str(new_id))
new_line = applied_rule.newContent(
type_name=delivery_line_type,
id=new_id,
order_value = c,
quantity = -c.getQuantity(),
deliverable = 1
)
LOG('AccountingTransactionRule.expand, object created:',0, \
new_line.getPhysicalPath())
else:
new_id = accounting_transaction_line_object.getId()
LOG('Line', 0, str(new_id))
if accounting_transaction_line_object.getVariationCategoryList() == []:
new_line = applied_rule.newContent(
type_name=delivery_line_type,
id=new_id,
order_value = accounting_transaction_line_object,
quantity = -accounting_transaction_line_object.getQuantity(),
deliverable = 1
)
LOG('AccountingTransactionRule.expand, object created:',0, \
new_line.getPhysicalPath())
else:
raise 'Error', 'VariationCategoryList is defined on\
AccountingTransactionLine %s and no cell exists.' %\
accounting_transaction_line_object.getRelativeUrl()
except AttributeError:
LOG('ERP5: WARNING', 0, \
'AttributeError during expand on accounting transaction line %s' \
% accounting_transaction_line_object.absolute_url())
# Now we can set the last expand simulation state
# to the current state
applied_rule.setLastExpandSimulationState( \
my_accounting_transaction.getSimulationState())
# Pass to base class
Rule.expand(self, applied_rule, force=force, **kw)
security.declareProtected(Permissions.ModifyPortalContent, 'solve')
def solve(self, applied_rule, solution_list):
"""
Solve inconsitency according to a certain number of solutions
templates. This updates the
-> new status -> solved
This applies a solution to an applied rule. Once
the solution is applied, the parent movement is checked.
If it does not diverge, the rule is reexpanded. If not,
diverge is called on the parent movement.
"""
security.declareProtected(Permissions.ModifyPortalContent, 'diverge')
def diverge(self, applied_rule):
"""
-> new status -> diverged
This basically sets the rule to "diverged"
and blocks expansion process
"""
# Solvers
security.declareProtected(Permissions.View, 'isDivergent')
def isDivergent(self, applied_rule):
"""
Returns 1 if divergent rule
"""
security.declareProtected(Permissions.View, 'getDivergenceList')
def getDivergenceList(self, applied_rule):
"""
Returns a list Divergence descriptors
"""
security.declareProtected(Permissions.View, 'getSolverList')
def getSolverList(self, applied_rule):
"""
Returns a list Divergence solvers
"""
# Deliverability / orderability
def isOrderable(self, m):
return 0
def isDeliverable(self, m):
if m.getSimulationState() in m.getPortalDraftOrderStateList():
return 0
return 1
\ No newline at end of file
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This proopgram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import WorkflowMethod
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Delivery import Delivery
from Products.ERP5Type.Document.DeliveryCell import DeliveryCell
from Products.ERP5.Document.Movement import Movement
from Products.ERP5.Document.AccountingTransaction import AccountingTransaction
class BankingOperation(Delivery, AccountingTransaction):
# CMF Type Definition
meta_type = 'BAOBAB Banking Operation'
portal_type = 'Banking Operation'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Default Properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.DublinCore
, PropertySheet.Task
, PropertySheet.Arrow
, PropertySheet.BankingOperation
, PropertySheet.ItemAggregation
, PropertySheet.Amount
)
# Special index methods
security.declareProtected(Permissions.View, 'getBaobabSourceUid')
def getBaobabSourceUid(self):
"""
Returns a calculated source.
"""
return self.getSourceUid()
security.declareProtected(Permissions.View, 'getBaobabDestinationUid')
def getBaobabDestinationUid(self):
"""
Returns a calculated destination.
"""
return self.getDestinationUid()
security.declareProtected(Permissions.View, 'getBaobabSourceSectionUid')
def getBaobabSourceSectionUid(self):
"""
Returns a calculated source section.
"""
return self.getSourceSectionUid()
security.declareProtected(Permissions.View, 'getBaobabDestinationSectionUid')
def getBaobabDestinationSectionUid(self):
"""
Returns a calculated destination section.
"""
return self.getDestinationSectionUid()
### Dynamic patch
Delivery.getBaobabSource = lambda x: x.getSource()
Delivery.security.declareProtected(Permissions.View, 'getBaobabSource')
Delivery.getBaobabSourceUid = lambda x: x.getSourceUid()
Delivery.security.declareProtected(Permissions.View, 'getBaobabSourceUid')
Delivery.getBaobabDestinationUid = lambda x: x.getDestinationUid()
Delivery.security.declareProtected(Permissions.View, 'getBaobabDestinationUid')
Delivery.getBaobabSourceSectionUid = lambda x: x.getSourceSectionUid()
Delivery.security.declareProtected(Permissions.View, 'getBaobabSourceSectionUid')
Delivery.getBaobabDestinationSectionUid = lambda x: x.getDestinationSectionUid()
Delivery.security.declareProtected(Permissions.View, 'getBaobabDestinationSectionUid')
### Overload Movement
Movement.getBaobabSource = lambda x: x.getSource()
Movement.security.declareProtected(Permissions.View, 'getBaobabSource')
Movement.getBaobabSourceUid = lambda x: x.getSourceUid()
Movement.security.declareProtected(Permissions.View, 'getBaobabSourceUid')
Movement.getBaobabDestinationUid = lambda x: x.getDestinationUid()
Movement.security.declareProtected(Permissions.View, 'getBaobabDestinationUid')
Movement.getBaobabSourceSectionUid = lambda x: x.getSourceSectionUid()
Movement.security.declareProtected(Permissions.View, 'getBaobabSourceSectionUid')
Movement.getBaobabDestinationSectionUid = lambda x: x.getDestinationSectionUid()
Movement.security.declareProtected(Permissions.View, 'getBaobabDestinationSectionUid')
### Acquire Baobab source / destination uids from parent line
DeliveryCell.getBaobabSource = lambda x: x.aq_parent.getBaobabSource()
DeliveryCell.security.declareProtected(Permissions.View, 'getBaobabSource')
DeliveryCell.getBaobabSourceUid = lambda x: x.aq_parent.getBaobabSourceUid()
DeliveryCell.security.declareProtected(Permissions.View, 'getBaobabSourceUid')
DeliveryCell.getBaobabDestinationUid = lambda x: x.aq_parent.getBaobabDestinationUid()
DeliveryCell.security.declareProtected(Permissions.View, 'getBaobabDestinationUid')
DeliveryCell.getBaobabSourceSectionUid = lambda x: x.aq_parent.getBaobabSourceSectionUid()
DeliveryCell.security.declareProtected(Permissions.View, 'getBaobabSourceSectionUid')
DeliveryCell.BaobabDestinationSectionUid = lambda x: x.aq_parent.getBaobabDestinationSectionUid()
DeliveryCell.security.declareProtected(Permissions.View, 'getBaobabDestinationSectionUid')
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.CMFCore.utils import getToolByName
from Products.CMFCore.WorkflowCore import WorkflowMethod
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.AccountingTransactionLine import AccountingTransactionLine
class BankingOperationLine(AccountingTransactionLine):
# CMF Type Definition
meta_type = 'BAOBAB Banking Operation Line'
portal_type = 'Banking Operation Line'
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Default Properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.DublinCore
)
security.declareProtected(Permissions.View, 'getBaobabSourceUid')
def getBaobabSourceUid(self):
"""
Returns a calculated source.
"""
return self.getSourceUid()
security.declareProtected(Permissions.View, 'getBaobabDestinationUid')
def getBaobabDestinationUid(self):
"""
Returns a calculated destination.
"""
return self.getDestinationUid()
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Container import Container
class CashContainer(Container):
"""
A Cash DeliveryLine object allows to implement lines
in Cash Deliveries (packing list, Check payment, Cash Movement, etc.).
It may include a price (for insurance, for customs, for invoices,
for orders).
"""
meta_type = 'BAOBAB Cash Container'
portal_type = 'Cash Container'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.Amount
, PropertySheet.Task
, PropertySheet.Arrow
, PropertySheet.Movement
, PropertySheet.Price
, PropertySheet.VariationRange
, PropertySheet.ItemAggregation
, PropertySheet.Container
, PropertySheet.CashContainer
, PropertySheet.Reference
)
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Resource import Resource
from zLOG import LOG
class CashCurrency(Resource):
"""
A Resource
"""
meta_type = 'BAOBAB Cash Currency'
portal_type = 'Cash Currency'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative interfaces
__implements__ = ( Interface.Variated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.DublinCore
, PropertySheet.Price
, PropertySheet.Resource
, PropertySheet.Reference
, PropertySheet.FlowCapacity
, PropertySheet.VariationRange
, PropertySheet.CashCurrency
)
security.declareProtected(Permissions.View,'getTitle')
def getTitle(self,**kw):
"""
The title will depend on the Portal Type and the value, for example :
Piece de 500
"""
title = self.portal_types[self.getPortalType()].title
price = self.getBasePrice()
if price is None:
price = 'Not Defined'
else:
price = '%i' % int(price)
title = '%s de %s' % (title, price)
return title
security.declareProtected(Permissions.ModifyPortalContent, '_setVariationList')
def _setVariationList(self,value):
"""
We will create cells by the same time
"""
LOG('_setVariationList, value',0,value)
self._categorySetVariationList(value)
self.setVariationBaseCategoryList(('cash_status','emission_letter','variation'))
#all_variation_list = self.OrderLine_getMatrixItemList()
#emission_letter_list = [x for x in all_variation_list if x.startswith('emission_letter')]
emission_letter_list = [x[1] for x in self.portal_categories.emission_letter.getCategoryChildTitleItemList()[1:]]
self._categorySetEmissionLetterList(emission_letter_list)
#cash_status_list = [x for x in all_variation_list if x.startswith('cash_status')]
cash_status_list = [x[1] for x in self.portal_categories.cash_status.getCategoryChildTitleItemList()[1:]]
self._categorySetCashStatusList(cash_status_list)
security.declareProtected(Permissions.ModifyPortalContent, 'setVariationList')
def setVariationList(self,value):
"""
Call the private method
"""
self._setVariationList(value)
# Cell Related
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
def newCellContent(self, id):
"""
This method can be overriden
"""
self.invokeFactory(type_name="Set Mapped Value",id=id)
return self.get(id)
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Kevin Deldycke <kevin_AT_nexedi_DOT_com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.Delivery import Delivery
class CashDelivery(Delivery):
"""
"""
meta_type = 'BAOBAB Cash Delivery'
portal_type = 'Cash Delivery'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative interfaces
__implements__ = ( Interface.Variated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.Amount
, PropertySheet.Task
, PropertySheet.Arrow
, PropertySheet.Movement
, PropertySheet.Price
, PropertySheet.VariationRange
, PropertySheet.ItemAggregation
)
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.DeliveryLine import DeliveryLine
in_portal_type_list = ('Cash Exchange Line In', 'Cash To Currency Sale Line In','Cash To Currency Purchase Line In', 'Cash Incident Line In')
out_portal_type_list = ('Cash Exchange Line Out', 'Cash To Currency Sale Line Out','Cash To Currency Purchase Line Out','Cash Incident Line Out')
class CashDeliveryLine(DeliveryLine):
"""
A Cash DeliveryLine object allows to implement lines
in Cash Deliveries (packing list, Check payment, Cash Movement, etc.).
It may include a price (for insurance, for customs, for invoices,
for orders).
"""
meta_type = 'BAOBAB Cash Delivery Line'
portal_type = 'Cash Delivery Line'
add_permission = Permissions.AddPortalContent
isPortalContent = 1
isRADContent = 1
# Declarative security
security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative interfaces
__implements__ = ( Interface.Variated, )
# Declarative properties
property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject
, PropertySheet.CategoryCore
, PropertySheet.Amount
, PropertySheet.Task
, PropertySheet.Arrow
, PropertySheet.Movement
, PropertySheet.Price
, PropertySheet.VariationRange
, PropertySheet.ItemAggregation
, PropertySheet.CashDeliveryLine
)
security.declareProtected(Permissions.View, 'getBaobabSourceSectionUid')
def getBaobabSourceSectionUid(self):
"""
Returns a calculated source section
"""
return self.getSourceSectionUid()
security.declareProtected(Permissions.View, 'getBaobabDestinationSectionUid')
def getBaobabDestinationSectionUid(self):
"""
Returns a calculated destination section
"""
return self.getDestinationSectionUid()
security.declareProtected(Permissions.View, 'getBaobabSource')
def getBaobabSource(self):
"""
Returns a calculated source
"""
if self.portal_type in out_portal_type_list:
return self.portal_categories.resolveCategory(self.getSource()).unrestrictedTraverse('sortante').getRelativeUrl()
elif self.portal_type in in_portal_type_list:
return None
return self.getSource()
security.declareProtected(Permissions.View, 'getBaobabSourceUid')
def getBaobabSourceUid(self):
"""
Returns a calculated source
"""
if self.portal_type in out_portal_type_list:
return self.portal_categories.resolveCategory(self.getSource()).unrestrictedTraverse('sortante').getUid()
elif self.portal_type in in_portal_type_list:
return None
return self.getSourceUid()
security.declareProtected(Permissions.View, 'getBaobabDestinationUid')
def getBaobabDestinationUid(self):
"""
Returns a calculated destination
"""
if self.portal_type in in_portal_type_list:
return self.portal_categories.resolveCategory(self.getSource()).unrestrictedTraverse('entrante').getUid()
elif self.portal_type in out_portal_type_list :
return None
return self.getDestinationUid()
<type_roles>
<role id='Auditor'>
<property id='title'>Comptable</property>
<property id='priority'>10</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/banking/comptable</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Chef de section comptable</property>
<property id='priority'>10</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/banking/chef_section_comptable</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Caissier Principal</property>
<property id='priority'>10</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/banking/caissier_principal</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor'>
<property id='title'>Comptable</property>
<property id='priority'>10</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/banking/comptable</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Chef de section comptable</property>
<property id='priority'>10</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/banking/chef_section_comptable</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Caissier Principal</property>
<property id='priority'>10</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/banking/caissier_principal</multi_property>
</role>
</type_roles>
\ No newline at end of file
<type_roles>
<role id='Auditor; Author'>
<property id='title'>Comptable</property>
<property id='priority'>10</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/banking/comptable</multi_property>
</role>
<role id='Author; Auditor'>
<property id='title'>Chef de section comptable</property>
<property id='priority'>10</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/banking/chef_section_comptable</multi_property>
</role>
<role id='Auditor'>
<property id='title'>Caissier Principal</property>
<property id='priority'>10</property>
<property id='base_category_script'>ERP5Type_getSecurityCategoryFromAssignment</property>
<multi_property id='category'>function/banking/caissier_principal</multi_property>
</role>
</type_roles>
\ No newline at end of file
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# K. Toure <ktoure_AT_nexedi_DOT_com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
class BankingOperation:
"""
Person properties and categories
"""
_properties = (
# Subordination properties
{ 'id' : 'movement',
'storage_id' : 'movement',
'description' : 'The current amount',
'type' : 'content',
'portal_type' : ('Accounting Transaction Line'),
'acquired_property_id' : ('source_debit', 'source_credit'),
'mode' : 'w' },
)
_categories = ()
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
class BaobabCategory:
"""
PropertySheetTemplate properties for all Baobab Categories
"""
_properties = (
{
'id' : 'codification',
'description' : 'category codified identifier',
'type' : 'string',
'mode' : 'w',
'default' : None,
'acquisition_base_category' : ('parent',),
'acquisition_portal_type' : ('Category',),
'acquisition_copy_value' : 0,
'acquisition_mask_value' : 1,
'acquisition_accessor_id' : 'getCodification',
},
)
_categories = ('vault_type',)
\ No newline at end of file
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
class CashContainer:
"""
VariationRange which allows to define possible
variations for a Resource, a Transformation, etc.
"""
_properties = (
{ 'id' : 'cash_number_range_start',
'description' : '',
'type' : 'string',
'mode' : 'w'
},
{ 'id' : 'cash_number_range_stop',
'description' : '',
'type' : 'string',
'mode' : 'w'
}
)
_categories = ( 'emission_letter','cash_status','variation')
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
class CashCurrency:
"""
Properties which allow to define a BankNote or a Coin.
"""
_properties = ()
_categories = ( 'emission_letter'
, 'cash_status'
, 'variation'
)
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
# Jean-Paul Smets-Solanes <jp@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
class CashDeliveryLine:
"""
VariationRange which allows to define possible
variations for a Resource, a Transformation, etc.
"""
_properties = (
)
_categories = ( 'emission_letter'
, 'cash_status'
)
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
class Checkbook:
"""
VariationRange which allows to define possible
variations for a Resource, a Transformation, etc.
"""
_properties = (
{ 'id' : 'check_number_range_start',
'description' : '',
'type' : 'string',
'mode' : 'w'
},
{ 'id' : 'check_number_range_stop',
'description' : '',
'type' : 'string',
'mode' : 'w'
},
{ 'id' : 'variation_base_category',
'description' : '',
'type' : 'lines',
'mode' : 'r',
'default' : ['checkbook_type']
}
)
_categories = ('checkbook_type',)
<site_property>
<property>
<id>portal_assignment_base_category_list</id>
<type>lines</type>
<value>
<item>site</item>
<item>group</item>
<item>function</item>
</value>
</property>
<property>
<id>portal_criterion_base_category_list</id>
<type>lines</type>
<value>
<item>source</item>
<item>destination</item>
<item>resource</item>
<item>currency_exchange_type</item>
<item>price_currency</item>
</value>
</property>
<property>
<id>portal_delivery_movement_type_list</id>
<type>lines</type>
<value>
<item>Accounting Transaction Line</item>
<item>Account Transfer Line</item>
<item>Balance Transaction Line</item>
<item>Cash Classification Line In</item>
<item>Cash Classification Line Out</item>
<item>Cash Extraction Line</item>
<item>Check Opposition Cash Reserve</item>
<item>Cash Container Line</item>
<item>Cash Exchange Line In</item>
<item>Cash Exchange Line Out</item>
<item>Cash Inventory Line</item>
<item>Cash Movement Line</item>
<item>Cash Sorting Line In</item>
<item>Cash Sorting Line Out</item>
<item>Cash To Currency Purchase Line In</item>
<item>Cash To Currency Purchase Line Out</item>
<item>Cash To Currency Sale Line In</item>
<item>Cash To Currency Sale Line Out</item>
<item>Cash Transfer Line</item>
<item>Check Payment Line</item>
<item>Classification Survey Line</item>
<item>Currency Purchase Line</item>
<item>Currency Sale Line</item>
<item>Internal Money Deposit Line</item>
<item>Internal Money Payment Line</item>
<item>Monetary Destruction Line</item>
<item>Monetary Issue Line</item>
<item>Monetary Recall Line</item>
<item>Monetary Survey Line</item>
<item>Money Deposit Line</item>
<item>Outsourcing Sort Line In</item>
<item>Outsourcing Sort Line Out</item>
<item>Money Deposit Regulation Line</item>
<item>Purchase Invoice Transaction Line</item>
<item>Sale Invoice Transaction Line</item>
<item>Cash Inventory Cell</item>
<item>Delivery Cell</item>
<item>Supply Cell</item>
<item>Dap Check Payment Line</item>
<item>Currency Exchange Line</item>
<item>Currency Exchange Cell</item>
<item>Checkbook Reception Line</item>
<item>Checkbook Delivery Line</item>
<item>Cash Balance Regulation Line In</item>
<item>Cash Balance Regulation Line Out</item>
<item>Cash Incident Line In</item>
<item>Cash Incident Line Out</item>
</value>
</property>
<property>
<id>portal_delivery_type_list</id>
<type>lines</type>
<value>
<item>Accounting Transaction</item>
<item>Account Transfer</item>
<item>Balance Transaction</item>
<item>Cash Classification</item>
<item>Cash Container</item>
<item>Cash Exchange</item>
<item>Cash Inventory</item>
<item>Cash Movement</item>
<item>Cash Movement Emitted</item>
<item>Cash Movement Emitted From Transit</item>
<item>Cash Movement Emitted To Transit</item>
<item>Cash Movement New</item>
<item>Cash Movement New From Transit</item>
<item>Cash Movement New To Transit</item>
<item>Cash Sorting</item>
<item>Cash To Currency Purchase</item>
<item>Cash To Currency Sale</item>
<item>Cash Transfer</item>
<item>Cash Extraction</item>
<item>Check Payment</item>
<item>Classification Survey</item>
<item>Currency Purchase</item>
<item>Currency Sale</item>
<item>Internal Money Deposit</item>
<item>Internal Money Payment</item>
<item>Check Opposition</item>
<item>Monetary Destruction</item>
<item>Monetary Issue</item>
<item>Monetary Recall</item>
<item>Monetary Survey</item>
<item>Money Deposit</item>
<item>Payment Transaction</item>
<item>Purchase Invoice Transaction</item>
<item>Sale Invoice Transaction</item>
<item>Dap Issue</item>
<item>Outsourcing Sort</item>
<item>Money Deposit Regulation</item>
<item>Dap Check Payment</item>
<item>Checkbook Reception</item>
<item>Checkbook Delivery</item>
<item>Cash Balance Regulation</item>
<item>Cash Incident</item>
</value>
</property>
<property>
<id>portal_supply_type_list</id>
<type>lines</type>
<value>
<item>Supply Line</item>
<item>Supply Cell</item>
<item>Currency Exchange Line</item>
<item>Currency Exchange Cell</item>
</value>
</property>
<property>
<id>portal_variation_type_list</id>
<type>lines</type>
<value>
<item>Variation</item>
<item>Checkbook Type Variation</item>
</value>
</property>
</site_property>
\ No newline at end of file
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