Commit 0d702108 authored by Arnaud Fontaine's avatar Arnaud Fontaine

erp5_budget: Fix errors/warnings reported by pylint.

parent b876df9a
...@@ -63,4 +63,3 @@ class Budget(Predicate, VariatedMixin): ...@@ -63,4 +63,3 @@ class Budget(Predicate, VariatedMixin):
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>Budget</string> </value> <value> <string>Budget</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.Budget</string> </value> <value> <string>Products.ERP5.Document.Budget</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.Budget</string> </value> <value> <string>document.erp5.Budget</string> </value>
...@@ -37,15 +49,7 @@ ...@@ -37,15 +49,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 37, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 42, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 59, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 60, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 61, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 64, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 65, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -55,13 +59,28 @@ ...@@ -55,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -74,7 +93,7 @@ ...@@ -74,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -83,7 +102,7 @@ ...@@ -83,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
...@@ -74,9 +74,9 @@ class BudgetCell(Predicate, MetaNode, Movement): ...@@ -74,9 +74,9 @@ class BudgetCell(Predicate, MetaNode, Movement):
script = self._getTypeBasedMethod('asTitle') script = self._getTypeBasedMethod('asTitle')
if script is not None: if script is not None:
return script() return script()
raise UnboundLocalError,\ raise UnboundLocalError(
"Did not find title script for portal type: %r" %\ "Did not find title script for portal type: %r" %
self.getPortalType() self.getPortalType())
security.declareProtected(Permissions.AccessContentsInformation, 'getCurrentInventory') security.declareProtected(Permissions.AccessContentsInformation, 'getCurrentInventory')
def getCurrentInventory(self, at_date=None, **kw): def getCurrentInventory(self, at_date=None, **kw):
...@@ -110,9 +110,9 @@ class BudgetCell(Predicate, MetaNode, Movement): ...@@ -110,9 +110,9 @@ class BudgetCell(Predicate, MetaNode, Movement):
script = self._getTypeBasedMethod('getConsumedBudget') script = self._getTypeBasedMethod('getConsumedBudget')
if script is not None: if script is not None:
return script(src__=src__) return script(src__=src__)
raise UnboundLocalError,\ raise UnboundLocalError(
"Did not find consumed budget script for portal type: %r" % \ "Did not find consumed budget script for portal type: %r" %
self.getPortalType() self.getPortalType())
security.declareProtected(Permissions.AccessContentsInformation, 'getAvailableBudget') security.declareProtected(Permissions.AccessContentsInformation, 'getAvailableBudget')
def getAvailableBudget(self, at_date=None): def getAvailableBudget(self, at_date=None):
...@@ -129,15 +129,15 @@ class BudgetCell(Predicate, MetaNode, Movement): ...@@ -129,15 +129,15 @@ class BudgetCell(Predicate, MetaNode, Movement):
script = self._getTypeBasedMethod('getEngagedBudget') script = self._getTypeBasedMethod('getEngagedBudget')
if script is not None: if script is not None:
return script(src__=src__) return script(src__=src__)
raise UnboundLocalError,\ raise UnboundLocalError(
"Did not find engaged budget script for portal type: %r" % \ "Did not find engaged budget script for portal type: %r" %
self.getPortalType() self.getPortalType())
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getExplanationValue') 'getExplanationValue')
def getExplanationValue(self, default=None): def getExplanationValue(self):
"""Explanation has no meaning for a budget cell""" """Explanation has no meaning for a budget cell"""
return default return None
security.declareProtected(Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'setSourceCredit') 'setSourceCredit')
...@@ -161,7 +161,7 @@ class BudgetCell(Predicate, MetaNode, Movement): ...@@ -161,7 +161,7 @@ class BudgetCell(Predicate, MetaNode, Movement):
source_debit = 0.0 source_debit = 0.0
Movement.setSourceDebit(self, source_debit) Movement.setSourceDebit(self, source_debit)
security.declareProtected( Permissions.ModifyPortalContent, security.declareProtected(Permissions.ModifyPortalContent,
'setDestinationDebit', 'setDestinationCredit' ) 'setDestinationDebit', 'setDestinationCredit' )
setDestinationDebit = setSourceCredit setDestinationDebit = setSourceCredit
setDestinationCredit = setSourceDebit setDestinationCredit = setSourceDebit
\ No newline at end of file
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>BudgetCell</string> </value> <value> <string>BudgetCell</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.BudgetCell</string> </value> <value> <string>Products.ERP5.Document.BudgetCell</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.BudgetCell</string> </value> <value> <string>document.erp5.BudgetCell</string> </value>
...@@ -37,79 +49,7 @@ ...@@ -37,79 +49,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 38, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 44, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 61, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 62, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 63, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 66, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 67, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 69, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 70, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 71, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 74, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 75, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 76, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 77, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 81, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 82, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 83, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 88, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 89, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 90, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 91, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 92, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 93, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 94, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 95, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 97, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 98, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 99, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:102, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:103, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:105, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:106, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:107, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:110, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:111, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:112, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:113, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:117, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:118, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:119, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:122, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:124, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:125, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:126, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:129, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:130, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:131, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:132, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:136, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:138, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:139, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:140, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:142, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:144, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:145, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:148, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:149, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:150, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:151, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:152, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:154, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:155, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:158, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:159, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:160, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:161, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W:162, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W:164, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:166, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:167, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W:138, 4: Arguments number differs from overridden \'getExplanationValue\' method (arguments-differ)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -119,13 +59,28 @@ ...@@ -119,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -138,7 +93,7 @@ ...@@ -138,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -147,7 +102,7 @@ ...@@ -147,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
...@@ -57,7 +57,6 @@ class BudgetTransaction(DeliveryLine): ...@@ -57,7 +57,6 @@ class BudgetTransaction(DeliveryLine):
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'isAccountable') 'isAccountable')
def isAccountable(self): def isAccountable(self):
...@@ -65,4 +64,3 @@ class BudgetTransaction(DeliveryLine): ...@@ -65,4 +64,3 @@ class BudgetTransaction(DeliveryLine):
Supersedes the DeliveryLine definition Supersedes the DeliveryLine definition
""" """
return 1 return 1
\ No newline at end of file
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>BudgetTransaction</string> </value> <value> <string>BudgetTransaction</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.BudgetTransaction</string> </value> <value> <string>Products.ERP5.Document.BudgetTransaction</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.BudgetTransaction</string> </value> <value> <string>document.erp5.BudgetTransaction</string> </value>
...@@ -37,19 +49,7 @@ ...@@ -37,19 +49,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 35, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 40, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 52, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 53, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 54, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 57, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 58, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 61, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 63, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 64, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 67, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -59,13 +59,28 @@ ...@@ -59,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -78,7 +93,7 @@ ...@@ -78,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -87,7 +102,7 @@ ...@@ -87,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
...@@ -36,7 +36,6 @@ class BudgetTransfer(Supply): ...@@ -36,7 +36,6 @@ class BudgetTransfer(Supply):
""" """
BudgetTransfer ... BudgetTransfer ...
""" """
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>BudgetTransfer</string> </value> <value> <string>BudgetTransfer</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.BudgetTransfer</string> </value> <value> <string>Products.ERP5.Document.BudgetTransfer</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.BudgetTransfer</string> </value> <value> <string>document.erp5.BudgetTransfer</string> </value>
...@@ -37,15 +49,7 @@ ...@@ -37,15 +49,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 36, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 41, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 51, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 52, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 53, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 56, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 57, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -55,13 +59,28 @@ ...@@ -55,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -74,7 +93,7 @@ ...@@ -74,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -83,7 +102,7 @@ ...@@ -83,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
...@@ -38,7 +38,6 @@ class BudgetTransferLine(SupplyLine): ...@@ -38,7 +38,6 @@ class BudgetTransferLine(SupplyLine):
""" """
BudgetTransferLine BudgetTransferLine
""" """
# Default Properties # Default Properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.XMLObject , PropertySheet.XMLObject
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>BudgetTransferLine</string> </value> <value> <string>BudgetTransferLine</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.BudgetTransferLine</string> </value> <value> <string>Products.ERP5.Document.BudgetTransferLine</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.BudgetTransferLine</string> </value> <value> <string>document.erp5.BudgetTransferLine</string> </value>
...@@ -37,15 +49,7 @@ ...@@ -37,15 +49,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 38, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 43, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 52, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 53, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 54, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 57, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 58, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -55,13 +59,28 @@ ...@@ -55,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -74,7 +93,7 @@ ...@@ -74,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -83,7 +102,7 @@ ...@@ -83,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
...@@ -30,7 +30,6 @@ from AccessControl import ClassSecurityInfo ...@@ -30,7 +30,6 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from erp5.component.document.BudgetVariation import BudgetVariation from erp5.component.document.BudgetVariation import BudgetVariation
class CategoryBudgetVariation(BudgetVariation): class CategoryBudgetVariation(BudgetVariation):
""" A budget variation based on a category """ A budget variation based on a category
""" """
...@@ -141,7 +140,7 @@ class CategoryBudgetVariation(BudgetVariation): ...@@ -141,7 +140,7 @@ class CategoryBudgetVariation(BudgetVariation):
for criterion_category in context.getMembershipCriterionCategoryList(): for criterion_category in context.getMembershipCriterionCategoryList():
if '/' not in criterion_category: # safe ... if '/' not in criterion_category: # safe ...
continue continue
criterion_base_category, category_url = criterion_category.split('/', 1) criterion_base_category, _ = criterion_category.split('/', 1)
if criterion_base_category == base_category: if criterion_base_category == base_category:
if uid_based_axis: if uid_based_axis:
category_uid = self.getPortalObject().portal_categories\ category_uid = self.getPortalObject().portal_categories\
...@@ -184,8 +183,9 @@ class CategoryBudgetVariation(BudgetVariation): ...@@ -184,8 +183,9 @@ class CategoryBudgetVariation(BudgetVariation):
axis = '%s_uid' % axis axis = '%s_uid' % axis
if self.getProperty('full_consumption_detail'): if self.getProperty('full_consumption_detail'):
for title, category in self.getBudgetLineVariationRangeCategoryList(context): for _, category in self.getBudgetLineVariationRangeCategoryList(context):
if not category: continue if not category:
continue
if axis.endswith('_uid'): if axis.endswith('_uid'):
# XXX move out getattrs # XXX move out getattrs
category = self.getPortalObject().portal_categories\ category = self.getPortalObject().portal_categories\
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>CategoryBudgetVariation</string> </value> <value> <string>CategoryBudgetVariation</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.CategoryBudgetVariation</string> </value> <value> <string>Products.ERP5.Document.CategoryBudgetVariation</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.CategoryBudgetVariation</string> </value> <value> <string>document.erp5.CategoryBudgetVariation</string> </value>
...@@ -37,10 +49,7 @@ ...@@ -37,10 +49,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W:144, 31: Unused variable \'category_url\' (unused-variable)</string>
<string>W:187, 10: Unused variable \'title\' (unused-variable)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -50,13 +59,28 @@ ...@@ -50,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -69,7 +93,7 @@ ...@@ -69,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -78,7 +102,7 @@ ...@@ -78,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
...@@ -33,7 +33,6 @@ from erp5.component.document.BudgetVariation import BudgetVariation ...@@ -33,7 +33,6 @@ from erp5.component.document.BudgetVariation import BudgetVariation
from Products.ZSQLCatalog.SQLCatalog import Query, NegatedQuery, ComplexQuery from Products.ZSQLCatalog.SQLCatalog import Query, NegatedQuery, ComplexQuery
class NodeBudgetVariation(BudgetVariation): class NodeBudgetVariation(BudgetVariation):
""" A budget variation for node """ A budget variation for node
...@@ -282,7 +281,7 @@ class NodeBudgetVariation(BudgetVariation): ...@@ -282,7 +281,7 @@ class NodeBudgetVariation(BudgetVariation):
found = False found = False
for node_url in category_list: for node_url in category_list:
if node_url != '%s/budget_special_node/none' % base_category: if node_url != '%s/budget_special_node/none' % base_category:
__traceback_info__ = (node_url, ) __traceback_info__ = (node_url, ) # pylint: disable=unused-variable
if uid_based_axis: if uid_based_axis:
query_dict.setdefault(axis, []).append( query_dict.setdefault(axis, []).append(
portal_categories.getCategoryValue(node_url, portal_categories.getCategoryValue(node_url,
......
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>NodeBudgetVariation</string> </value> <value> <string>NodeBudgetVariation</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.NodeBudgetVariation</string> </value> <value> <string>Products.ERP5.Document.NodeBudgetVariation</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.NodeBudgetVariation</string> </value> <value> <string>document.erp5.NodeBudgetVariation</string> </value>
...@@ -37,10 +49,7 @@ ...@@ -37,10 +49,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W:133, 6: Unused variable \'consumption_dict\' (unused-variable)</string>
<string>W:284, 8: Unused variable \'__traceback_info__\' (unused-variable)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -50,13 +59,28 @@ ...@@ -50,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -69,7 +93,7 @@ ...@@ -69,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -78,7 +102,7 @@ ...@@ -78,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
from Products.ERP5Type.mixin.constraint import ConstraintMixin from Products.ERP5Type.mixin.constraint import ConstraintMixin
from Products.ERP5Type import PropertySheet
class TransactionQuantityValueFeasabilityConstraint(ConstraintMixin): class TransactionQuantityValueFeasabilityConstraint(ConstraintMixin):
""" """
...@@ -41,20 +40,20 @@ class TransactionQuantityValueFeasabilityConstraint(ConstraintMixin): ...@@ -41,20 +40,20 @@ class TransactionQuantityValueFeasabilityConstraint(ConstraintMixin):
meta_type = 'ERP5 Transaction Quantity Value Feasability Constraint' meta_type = 'ERP5 Transaction Quantity Value Feasability Constraint'
portal_type = 'Transaction Quantity Value Feasability Constraint' portal_type = 'Transaction Quantity Value Feasability Constraint'
def _checkConsistency(self, object, fixit=0): def _checkConsistency(self, obj, fixit=0, **_):
""" """
Check if the quantity of the transaction is possible Check if the quantity of the transaction is possible
for the source and the destination for the source and the destination
""" """
errors = [] errors = []
source_cell = object.getSourceValue() source_cell = obj.getSourceValue()
destination_cell = object.getDestinationValue() destination_cell = obj.getDestinationValue()
# Check for source and destination # Check for source and destination
for node, sign, node_title in ((source_cell, 1, 'source'), for node, sign, node_title in ((source_cell, 1, 'source'),
(destination_cell, -1, 'destination')): (destination_cell, -1, 'destination')):
# As the quantity can change a few lines letter, # As the quantity can change a few lines letter,
# we need to get it each time. # we need to get it each time.
object_quantity = object.getQuantity() object_quantity = obj.getQuantity()
quantity = object_quantity * sign quantity = object_quantity * sign
if node is not None: if node is not None:
balance = node.getCurrentBalance() balance = node.getCurrentBalance()
...@@ -69,12 +68,12 @@ class TransactionQuantityValueFeasabilityConstraint(ConstraintMixin): ...@@ -69,12 +68,12 @@ class TransactionQuantityValueFeasabilityConstraint(ConstraintMixin):
# Raise error # Raise error
if not is_transaction_ok: if not is_transaction_ok:
if fixit != 0: if fixit != 0:
object.setQuantity(balance) obj.setQuantity(balance)
else: else:
error_message = 'The quantity "%s" of the transaction is not ' \ error_message = 'The quantity "%s" of the transaction is not ' \
'compatible with budget "%s" defined on the ' \ 'compatible with budget "%s" defined on the ' \
'%s "%s".' % \ '%s "%s".' % \
(object_quantity, balance, node_title, node) (object_quantity, balance, node_title, node)
# Add error # Add error
errors.append(self._generateError(object, error_message)) errors.append(self._generateError(obj, error_message))
return errors return errors
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>TransactionQuantityValueFeasabilityConstraint</string> </value> <value> <string>TransactionQuantityValueFeasabilityConstraint</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.TransactionQuantityValueFeasabilityConstraint</string> </value> <value> <string>Products.ERP5.Document.TransactionQuantityValueFeasabilityConstraint</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.TransactionQuantityValueFeasabilityConstraint</string> </value> <value> <string>document.erp5.TransactionQuantityValueFeasabilityConstraint</string> </value>
...@@ -37,38 +49,7 @@ ...@@ -37,38 +49,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 33, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 41, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 42, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 44, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 45, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 49, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 50, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 51, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 53, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 57, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 58, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 59, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 60, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W: 61, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W: 63, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W: 64, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W: 65, 0: Bad indentation. Found 14 spaces, expected 12 (bad-indentation)</string>
<string>W: 66, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W: 67, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W: 68, 0: Bad indentation. Found 14 spaces, expected 12 (bad-indentation)</string>
<string>W: 70, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W: 71, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W: 72, 0: Bad indentation. Found 14 spaces, expected 12 (bad-indentation)</string>
<string>W: 73, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W: 74, 0: Bad indentation. Found 14 spaces, expected 12 (bad-indentation)</string>
<string>W: 79, 0: Bad indentation. Found 14 spaces, expected 12 (bad-indentation)</string>
<string>W: 80, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 44, 32: Redefining built-in \'object\' (redefined-builtin)</string>
<string>W: 44, 4: Arguments number differs from overridden \'_checkConsistency\' method (arguments-differ)</string>
<string>W: 30, 0: Unused PropertySheet imported from Products.ERP5Type (unused-import)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -78,13 +59,28 @@ ...@@ -78,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -97,7 +93,7 @@ ...@@ -97,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -106,7 +102,7 @@ ...@@ -106,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
############################################################################## ##############################################################################
from Products.ERP5Type.mixin.constraint import ConstraintMixin from Products.ERP5Type.mixin.constraint import ConstraintMixin
from Products.ERP5Type import PropertySheet
class TransactionQuantityValueValidityConstraint(ConstraintMixin): class TransactionQuantityValueValidityConstraint(ConstraintMixin):
""" """
...@@ -38,27 +37,26 @@ class TransactionQuantityValueValidityConstraint(ConstraintMixin): ...@@ -38,27 +37,26 @@ class TransactionQuantityValueValidityConstraint(ConstraintMixin):
meta_type = 'ERP5 Transaction Quantity Value Validity Constraint' meta_type = 'ERP5 Transaction Quantity Value Validity Constraint'
portal_type = 'Transaction Quantity Value Validity Constraint' portal_type = 'Transaction Quantity Value Validity Constraint'
def _checkConsistency(self, object, fixit=0): def _checkConsistency(self, obj, fixit=0, **_):
""" """
Check if the quantity of the transaction is greater than the Check if the quantity of the transaction is greater than the
balance of the source. balance of the source.
""" """
errors = [] errors = []
source_cell = object.getSourceValue() source_cell = obj.getSourceValue()
destination_cell = object.getDestinationValue() destination_cell = obj.getDestinationValue()
if (source_cell is not None) and \ if source_cell is not None and destination_cell is not None:
(destination_cell is not None):
# XXX Dirty code ! # XXX Dirty code !
quantity = object.getQuantity() quantity = obj.getQuantity()
budget_list = object.getPortalObject().budget_module.objectValues() budget_list = obj.getPortalObject().budget_module.objectValues()
max_quantity = 0 max_quantity = 0
for obj in budget_list: for obj in budget_list:
for item in obj.objectValues(): for item in obj.objectValues():
if (item.getPortalType() == 'Budget Transfer Line') and \ if item.getPortalType() == 'Budget Transfer Line' and \
(item.getSourceValue() == source_cell) and \ item.getSourceValue() == source_cell and \
(item.getDestinationValue() == destination_cell): item.getDestinationValue() == destination_cell:
max_quantity = item.getQuantity() max_quantity = item.getQuantity()
if quantity > max_quantity: if quantity > max_quantity:
if fixit != 0: if fixit != 0:
...@@ -68,5 +66,5 @@ class TransactionQuantityValueValidityConstraint(ConstraintMixin): ...@@ -68,5 +66,5 @@ class TransactionQuantityValueValidityConstraint(ConstraintMixin):
'the transferable maximum quantity (TMQ): ' \ 'the transferable maximum quantity (TMQ): ' \
'TMQ = %.2f' % max_quantity 'TMQ = %.2f' % max_quantity
# Add error # Add error
errors.append(self._generateError(object, error_message)) errors.append(self._generateError(obj, error_message))
return errors return errors
\ No newline at end of file
...@@ -6,6 +6,12 @@ ...@@ -6,6 +6,12 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>TransactionQuantityValueValidityConstraint</string> </value> <value> <string>TransactionQuantityValueValidityConstraint</string> </value>
...@@ -14,6 +20,12 @@ ...@@ -14,6 +20,12 @@
<key> <string>default_source_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.TransactionQuantityValueValidityConstraint</string> </value> <value> <string>Products.ERP5.Document.TransactionQuantityValueValidityConstraint</string> </value>
</item> </item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>document.erp5.TransactionQuantityValueValidityConstraint</string> </value> <value> <string>document.erp5.TransactionQuantityValueValidityConstraint</string> </value>
...@@ -37,34 +49,7 @@ ...@@ -37,34 +49,7 @@
<item> <item>
<key> <string>text_content_warning_message</string> </key> <key> <string>text_content_warning_message</string> </key>
<value> <value>
<tuple> <tuple/>
<string>W: 33, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 38, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 39, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 41, 0: Bad indentation. Found 4 spaces, expected 2 (bad-indentation)</string>
<string>W: 42, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 46, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 48, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 49, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 51, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 54, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 55, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 56, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 57, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 58, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W: 59, 0: Bad indentation. Found 13 spaces, expected 10 (bad-indentation)</string>
<string>W: 62, 0: Bad indentation. Found 15 spaces, expected 12 (bad-indentation)</string>
<string>W: 63, 0: Bad indentation. Found 8 spaces, expected 6 (bad-indentation)</string>
<string>W: 64, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W: 65, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W: 66, 0: Bad indentation. Found 10 spaces, expected 8 (bad-indentation)</string>
<string>W: 67, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W: 71, 0: Bad indentation. Found 12 spaces, expected 10 (bad-indentation)</string>
<string>W: 72, 0: Bad indentation. Found 6 spaces, expected 4 (bad-indentation)</string>
<string>W: 41, 32: Redefining built-in \'object\' (redefined-builtin)</string>
<string>W: 41, 4: Arguments number differs from overridden \'_checkConsistency\' method (arguments-differ)</string>
<string>W: 30, 0: Unused PropertySheet imported from Products.ERP5Type (unused-import)</string>
</tuple>
</value> </value>
</item> </item>
<item> <item>
...@@ -74,13 +59,28 @@ ...@@ -74,13 +59,28 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="3" aka="AAAAAAAAAAM="> <record id="4" aka="AAAAAAAAAAQ=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle> </pickle>
......
...@@ -85,7 +85,7 @@ class TestBudget(ERP5TypeTestCase): ...@@ -85,7 +85,7 @@ class TestBudget(ERP5TypeTestCase):
budget = self.portal.budget_module.newContent( budget = self.portal.budget_module.newContent(
portal_type='Budget') portal_type='Budget')
budget_line = budget.newContent(portal_type='Budget Line') budget_line = budget.newContent(portal_type='Budget Line')
budget_cell = budget_line.newContent(portal_type='Budget Cell') budget_line.newContent(portal_type='Budget Cell')
self.assertEqual([], budget.checkConsistency()) self.assertEqual([], budget.checkConsistency())
def test_budget_cell_node_variation_with_aggregate(self): def test_budget_cell_node_variation_with_aggregate(self):
...@@ -626,17 +626,18 @@ class TestBudget(ERP5TypeTestCase): ...@@ -626,17 +626,18 @@ class TestBudget(ERP5TypeTestCase):
self.assertEqual(2, len(budget_line.contentValues())) self.assertEqual(2, len(budget_line.contentValues()))
test_class_self = self
class ReferenceQuery: class ReferenceQuery:
"""Helper class to compare queries """Helper class to compare queries
""" """
def __eq__(me, query): def __eq__(self, query):
self.assertTrue(isinstance(query, ComplexQuery)) test_class_self.assertTrue(isinstance(query, ComplexQuery))
self.assertEqual(query.logical_operator, 'or') test_class_self.assertEqual(query.logical_operator, 'or')
self.assertEqual(2, len(query.query_list)) test_class_self.assertEqual(2, len(query.query_list))
self.assertEqual(query.query_list[0].kw, {'project_uid': None}) test_class_self.assertEqual(query.query_list[0].kw, {'project_uid': None})
self.assertEqual(query.query_list[1].kw, test_class_self.assertEqual(query.query_list[1].kw,
{'project_uid': {'project_uid':
[self.portal.organisation_module.my_organisation.getUid()]}) [test_class_self.portal.organisation_module.my_organisation.getUid()]})
return True return True
self.assertEqual( self.assertEqual(
...@@ -730,12 +731,13 @@ class TestBudget(ERP5TypeTestCase): ...@@ -730,12 +731,13 @@ class TestBudget(ERP5TypeTestCase):
self.assertEqual(1, len(budget_line.contentValues())) self.assertEqual(1, len(budget_line.contentValues()))
test_class_self = self
class ReferenceQuery: class ReferenceQuery:
"""Helper class to compare queries """Helper class to compare queries
""" """
def __eq__(me, query): def __eq__(self, query):
self.assertTrue(isinstance(query, Query)) test_class_self.assertTrue(isinstance(query, Query))
self.assertEqual(query.kw, {'project_uid': None}) test_class_self.assertEqual(query.kw, {'project_uid': None})
return True return True
self.assertEqual( self.assertEqual(
......
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