Commit 50863c2a authored by Arnaud Fontaine's avatar Arnaud Fontaine

ZODB Components: erp5_payroll: Migrate Documents from FS and its Unit Test.

parent ffe5bb34
...@@ -95,9 +95,7 @@ class EmploymentContract(SubscriptionItem): ...@@ -95,9 +95,7 @@ class EmploymentContract(SubscriptionItem):
movement_stop_date = stop_date movement_stop_date = stop_date
if not self.assertMovementExists(applied_rule, movement_start_date) and\ if not self.assertMovementExists(applied_rule, movement_start_date) and\
movement_stop_date.month() <= number_of_months_in_year: movement_stop_date.month() <= number_of_months_in_year:
property_dict = {} applied_rule.newContent(
simulation_movement = applied_rule.newContent(
id = 'movement_%s_%s' % (movement_start_date.year(), movement_stop_date.month()), id = 'movement_%s_%s' % (movement_start_date.year(), movement_stop_date.month()),
start_date = movement_start_date, start_date = movement_start_date,
stop_date = movement_stop_date, stop_date = movement_stop_date,
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>EmploymentContract</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.EmploymentContract</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.EmploymentContract</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -31,7 +31,6 @@ from AccessControl import ClassSecurityInfo ...@@ -31,7 +31,6 @@ from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.TradeCondition import TradeCondition from Products.ERP5.Document.TradeCondition import TradeCondition
from Products.ERP5Type.XMLMatrix import XMLMatrix from Products.ERP5Type.XMLMatrix import XMLMatrix
from Products.ERP5.Document.PaySheetTransaction import PaySheetTransaction
class PaySheetModel(TradeCondition, XMLMatrix): class PaySheetModel(TradeCondition, XMLMatrix):
"""A PaySheetModel defines calculation rules for paysheets. """A PaySheetModel defines calculation rules for paysheets.
...@@ -75,9 +74,11 @@ class PaySheetModel(TradeCondition, XMLMatrix): ...@@ -75,9 +74,11 @@ class PaySheetModel(TradeCondition, XMLMatrix):
''' '''
paysheet = kw.get('paysheet') paysheet = kw.get('paysheet')
if paysheet is None: if paysheet is None:
from Products.ERP5Type.Document import newTempPaySheetTransaction paysheet = self.getPortalObject().newContent(
paysheet = newTempPaySheetTransaction(self.getPortalObject(), '', temp_object=True,
specialise_value=self) portal_type='Pay Sheet Transaction',
id='',
specialise_value=self)
model_list = self.findEffectiveSpecialiseValueList(paysheet) model_list = self.findEffectiveSpecialiseValueList(paysheet)
for specialised_model in model_list: for specialised_model in model_list:
cell = XMLMatrix.getCell(specialised_model, *args, **kw) cell = XMLMatrix.getCell(specialised_model, *args, **kw)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>PaySheetModel</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.PaySheetModel</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.PaySheetModel</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -33,26 +33,26 @@ from Products.ERP5.Document.TradeModelCell import TradeModelCell ...@@ -33,26 +33,26 @@ from Products.ERP5.Document.TradeModelCell import TradeModelCell
from Products.ERP5Type.Core.Predicate import Predicate from Products.ERP5Type.Core.Predicate import Predicate
class PaySheetModelCell(TradeModelCell): class PaySheetModelCell(TradeModelCell):
"""Trade Model Line """Trade Model Line
""" """
meta_type = 'ERP5 Pay Sheet Model Cell' meta_type = 'ERP5 Pay Sheet Model Cell'
portal_type = 'Pay Sheet Model Cell' portal_type = 'Pay Sheet Model Cell'
isCell = 1 isCell = 1
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
def getMappedValueBaseCategoryList(self): def getMappedValueBaseCategoryList(self):
result = self._baseGetMappedValueBaseCategoryList() result = self._baseGetMappedValueBaseCategoryList()
if not result: if not result:
if not self.hasCellContent(base_id='variation'): if not self.hasCellContent(base_id='variation'):
result = self.getVariationRangeBaseCategoryList() # The current resource variation result = self.getVariationRangeBaseCategoryList() # The current resource variation
return list(result) + ['trade_phase', 'quantity_unit'] return list(result) + ['trade_phase', 'quantity_unit']
# Redefine some methods as we do not want to turn cells into predicate # Redefine some methods as we do not want to turn cells into predicate
def edit(self, **kw): def edit(self, **kw):
return super(Predicate, self).edit(**kw) return super(Predicate, self).edit(**kw) # pylint: disable=bad-super-call
def setPredicateCategoryList(self, *args, **kw): def setPredicateCategoryList(self, *args, **kw):
pass pass
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>PaySheetModelCell</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.PaySheetModelCell</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.PaySheetModelCell</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>PaySheetModelLine</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.PaySheetModelLine</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.PaySheetModelLine</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W: 69, 27: Redefining built-in \'id\' (redefined-builtin)</string>
</tuple>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -31,30 +31,30 @@ from Products.ERP5Type import Permissions, PropertySheet ...@@ -31,30 +31,30 @@ from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.DeliveryCell import DeliveryCell from Products.ERP5.Document.DeliveryCell import DeliveryCell
class PaySheetModelSlice(DeliveryCell): class PaySheetModelSlice(DeliveryCell):
""" """
A PaySheetModelSlice allows to define max and min values A PaySheetModelSlice allows to define max and min values
for each slice for each slice
""" """
meta_type = 'ERP5 Pay Sheet Model Slice' meta_type = 'ERP5 Pay Sheet Model Slice'
portal_type = 'Pay Sheet Model Slice' portal_type = 'Pay Sheet Model Slice'
isCell = 1 isCell = 1
# Declarative security # Declarative security
security = ClassSecurityInfo() security = ClassSecurityInfo()
security.declareObjectProtected(Permissions.AccessContentsInformation) security.declareObjectProtected(Permissions.AccessContentsInformation)
# Declarative properties # Declarative properties
property_sheets = ( PropertySheet.Base property_sheets = ( PropertySheet.Base
, PropertySheet.CategoryCore , PropertySheet.CategoryCore
, PropertySheet.Arrow , PropertySheet.Arrow
, PropertySheet.Amount , PropertySheet.Amount
, PropertySheet.Task , PropertySheet.Task
, PropertySheet.Movement , PropertySheet.Movement
, PropertySheet.Price , PropertySheet.Price
, PropertySheet.Predicate , PropertySheet.Predicate
, PropertySheet.MappedValue , PropertySheet.MappedValue
, PropertySheet.ItemAggregation , PropertySheet.ItemAggregation
, PropertySheet.PaySheetModel , PropertySheet.PaySheetModel
) )
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>PaySheetModelSlice</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.PaySheetModelSlice</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.PaySheetModelSlice</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>PaySheetTransaction</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.PaySheetTransaction</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.PaySheetTransaction</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Document Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>PaySheetTransactionLine</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.Document.PaySheetTransactionLine</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>document.erp5.PaySheetTransactionLine</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Document Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -1023,8 +1023,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -1023,8 +1023,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
def stepModelSetCategories(self, sequence=None, **kw): def stepModelSetCategories(self, sequence=None, **kw):
model = sequence.get('model') model = sequence.get('model')
currency = sequence.get('price_currency') currency = sequence.get('price_currency')
employer = sequence.get('employer')
employee = sequence.get('employee')
model.edit(\ model.edit(\
price_currency_value=currency, price_currency_value=currency,
default_payment_condition_trade_date='custom', default_payment_condition_trade_date='custom',
...@@ -1587,8 +1585,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -1587,8 +1585,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
paysheet_without_date.PaySheetTransaction_applyModel() paysheet_without_date.PaySheetTransaction_applyModel()
self.tic() self.tic()
portal_type_list = ['Pay Sheet Model Line',]
# check the paysheet contail no lines before calculation # check the paysheet contail no lines before calculation
self.assertEqual(len(paysheet_without_date.contentValues(\ self.assertEqual(len(paysheet_without_date.contentValues(\
portal_type='Pay Sheet Line')), 0) portal_type='Pay Sheet Line')), 0)
...@@ -1721,7 +1717,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -1721,7 +1717,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
version='002', version='002',
specialise_value=sequence.get('business_process')) specialise_value=sequence.get('business_process'))
model_3 = self.getPortalObject().paysheet_model_module.newContent( \ self.getPortalObject().paysheet_model_module.newContent( \
portal_type='Pay Sheet Model', portal_type='Pay Sheet Model',
variation_settings_category_list=['salary_range/france',], variation_settings_category_list=['salary_range/france',],
reference='fabien_model_2009', reference='fabien_model_2009',
...@@ -1759,7 +1755,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): ...@@ -1759,7 +1755,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase):
not be created.''' not be created.'''
model = sequence.get('model') model = sequence.get('model')
labour = sequence.get('labour_service') labour = sequence.get('labour_service')
line = model.newContent( model.newContent(
id='line', id='line',
reference='zero_price_line', reference='zero_price_line',
portal_type='Pay Sheet Model Line', portal_type='Pay Sheet Model Line',
...@@ -2630,7 +2626,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -2630,7 +2626,7 @@ class TestPayroll(TestPayrollMixin):
provider = self.portal.organisation_module.newContent( provider = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Service Provider') title='Service Provider')
other_provider = self.portal.organisation_module.newContent( self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Another Service Provider') title='Another Service Provider')
ps1 = self.portal.accounting_module.newContent( ps1 = self.portal.accounting_module.newContent(
...@@ -2858,7 +2854,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -2858,7 +2854,7 @@ class TestPayroll(TestPayrollMixin):
provider = self.portal.organisation_module.newContent( provider = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Service Provider') title='Service Provider')
other_provider = self.portal.organisation_module.newContent( self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Another Service Provider') title='Another Service Provider')
ps1 = self.portal.accounting_module.newContent( ps1 = self.portal.accounting_module.newContent(
...@@ -3319,7 +3315,6 @@ class TestPayroll(TestPayrollMixin): ...@@ -3319,7 +3315,6 @@ class TestPayroll(TestPayrollMixin):
def test_modelSliceInheritance(self): def test_modelSliceInheritance(self):
'''Check the slice inheritance''' '''Check the slice inheritance'''
base_id = 'cell'
paysheet_model_module = self.getPortalObject().paysheet_model_module paysheet_model_module = self.getPortalObject().paysheet_model_module
model_1 = paysheet_model_module.newContent( model_1 = paysheet_model_module.newContent(
portal_type='Pay Sheet Model', portal_type='Pay Sheet Model',
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testPayroll</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testPayroll</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testPayroll</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W:151, 2: Arguments number differs from overridden \'login\' method (arguments-differ)</string>
<string>W:331, 28: Redefining built-in \'slice\' (redefined-builtin)</string>
<string>W:591, 4: Unused variable \'movement_to_add\' (unused-variable)</string>
<string>W:1543, 4: Unused variable \'sub_object_list\' (unused-variable)</string>
<string>W:1610, 4: Unused variable \'portal_type_list\' (unused-variable)</string>
<string>W:1957, 6: Unused variable \'result\' (unused-variable)</string>
</tuple>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
document.erp5.EmploymentContract
document.erp5.PaySheetModel
document.erp5.PaySheetModelCell
document.erp5.PaySheetModelLine
document.erp5.PaySheetModelSlice
document.erp5.PaySheetTransaction
document.erp5.PaySheetTransactionLine
\ No newline at end of file
test.erp5.testPayroll
\ No newline at end of file
erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_pdm
erp5_simulation
erp5_trade
erp5_item
erp5_accounting
erp5_invoicing
erp5_simplified_invoicing
erp5_core_proxy_field_legacy
erp5_configurator_standard_solver
erp5_configurator_standard_trade_template
erp5_configurator_standard_accounting_template
erp5_configurator_standard_invoicing_template
erp5_simulation_test
\ No newline at end of file
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
""" """
from Products.ERP5Type.tests.Sequence import SequenceList from Products.ERP5Type.tests.Sequence import SequenceList
from Products.ERP5.tests.testPayroll import TestPayrollMixin from erp5.component.test.testPayroll import TestPayrollMixin
from DateTime import DateTime from DateTime import DateTime
class TestPayroll_l10n_fr(TestPayrollMixin): class TestPayroll_l10n_fr(TestPayrollMixin):
...@@ -61,8 +61,10 @@ class TestPayroll_l10n_fr(TestPayrollMixin): ...@@ -61,8 +61,10 @@ class TestPayroll_l10n_fr(TestPayrollMixin):
def stepCheckYearToDateSliceAmount(self, sequence=None, **kw): def stepCheckYearToDateSliceAmount(self, sequence=None, **kw):
paysheet_module = self.portal.getDefaultModule(portal_type=\ paysheet_module = self.portal.getDefaultModule(portal_type=\
'Pay Sheet Transaction') 'Pay Sheet Transaction')
paysheet_list = paysheet_module.contentValues(portal_type=\ paysheet_list = [
'Pay Sheet Transaction') paysheet for paysheet in paysheet_module.contentValues(
portal_type='Pay Sheet Transaction')
if paysheet.getSpecialiseValue() == sequence['model'] ]
self.assertEqual(len(paysheet_list), 2) # 2 paysheet have been created self.assertEqual(len(paysheet_list), 2) # 2 paysheet have been created
# for this test # for this test
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Test Component" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>default_reference</string> </key>
<value> <string>testPayroll_l10n_fr</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>Products.ERP5.tests.testPayroll_l10n_fr</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testPayroll_l10n_fr</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Test Component</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content_error_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>erp5</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>component_validation_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_log</string> </key>
<value>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>validate</string> </value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>validated</string> </value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
test.erp5.testDSNSocialDeclarationReport test.erp5.testDSNSocialDeclarationReport
test.erp5.testPayroll_l10n_fr
test.erp5.testSimplifiedPayslipReport test.erp5.testSimplifiedPayslipReport
\ No newline at end of file
erp5_full_text_mroonga_catalog erp5_full_text_mroonga_catalog
erp5_core_proxy_field_legacy
erp5_base
erp5_pdm
erp5_simulation
erp5_trade
erp5_item
erp5_accounting
erp5_invoicing
erp5_simplified_invoicing
erp5_core_proxy_field_legacy
erp5_configurator_standard_solver
erp5_configurator_standard_trade_template
erp5_configurator_standard_accounting_template
erp5_configurator_standard_invoicing_template
erp5_simulation_test
erp5_calendar
erp5_payroll_l10n_fr_test erp5_payroll_l10n_fr_test
\ 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