From 50863c2ae4414c8d846d8e1f2f63945b4bc6e23e Mon Sep 17 00:00:00 2001 From: Arnaud Fontaine <arnaud.fontaine@nexedi.com> Date: Mon, 24 Feb 2020 15:14:14 +0900 Subject: [PATCH] ZODB Components: erp5_payroll: Migrate Documents from FS and its Unit Test. --- .../document.erp5.EmploymentContract.py | 4 +- .../document.erp5.EmploymentContract.xml | 110 ++++++++++++++++ .../document.erp5.PaySheetModel.py | 9 +- .../document.erp5.PaySheetModel.xml | 110 ++++++++++++++++ .../document.erp5.PaySheetModelCell.py | 38 +++--- .../document.erp5.PaySheetModelCell.xml | 110 ++++++++++++++++ .../document.erp5.PaySheetModelLine.py | 0 .../document.erp5.PaySheetModelLine.xml | 106 ++++++++++++++++ .../document.erp5.PaySheetModelSlice.py | 46 +++---- .../document.erp5.PaySheetModelSlice.xml | 110 ++++++++++++++++ .../document.erp5.PaySheetTransaction.py | 0 .../document.erp5.PaySheetTransaction.xml | 104 ++++++++++++++++ .../document.erp5.PaySheetTransactionLine.py | 0 .../document.erp5.PaySheetTransactionLine.xml | 104 ++++++++++++++++ .../test.erp5.testPayroll.py | 13 +- .../test.erp5.testPayroll.xml | 117 ++++++++++++++++++ bt5/erp5_payroll/bt/template_document_id_list | 7 ++ bt5/erp5_payroll/bt/template_test_id_list | 1 + bt5/erp5_payroll/bt/test_dependency_list | 16 +++ .../test.erp5.testPayroll_l10n_fr.py | 8 +- .../test.erp5.testPayroll_l10n_fr.xml | 110 ++++++++++++++++ .../bt/template_test_id_list | 1 + .../bt/test_dependency_list | 16 +++ 23 files changed, 1079 insertions(+), 61 deletions(-) rename product/ERP5/Document/EmploymentContract.py => bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.EmploymentContract.py (98%) create mode 100644 bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.EmploymentContract.xml rename product/ERP5/Document/PaySheetModel.py => bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModel.py (95%) create mode 100644 bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModel.xml rename product/ERP5/Document/PaySheetModelCell.py => bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelCell.py (66%) create mode 100644 bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelCell.xml rename product/ERP5/Document/PaySheetModelLine.py => bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.py (100%) create mode 100644 bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.xml rename product/ERP5/Document/PaySheetModelSlice.py => bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelSlice.py (63%) create mode 100644 bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelSlice.xml rename product/ERP5/Document/PaySheetTransaction.py => bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransaction.py (100%) create mode 100644 bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransaction.xml rename product/ERP5/Document/PaySheetTransactionLine.py => bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransactionLine.py (100%) create mode 100644 bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransactionLine.xml rename product/ERP5/tests/testPayroll.py => bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py (99%) create mode 100644 bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.xml create mode 100644 bt5/erp5_payroll/bt/template_document_id_list create mode 100644 bt5/erp5_payroll/bt/template_test_id_list create mode 100644 bt5/erp5_payroll/bt/test_dependency_list rename product/ERP5/tests/testPayroll_l10n_fr.py => bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testPayroll_l10n_fr.py (95%) create mode 100644 bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testPayroll_l10n_fr.xml diff --git a/product/ERP5/Document/EmploymentContract.py b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.EmploymentContract.py similarity index 98% rename from product/ERP5/Document/EmploymentContract.py rename to bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.EmploymentContract.py index 4019bc5087..26bc30446c 100644 --- a/product/ERP5/Document/EmploymentContract.py +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.EmploymentContract.py @@ -95,9 +95,7 @@ class EmploymentContract(SubscriptionItem): movement_stop_date = stop_date if not self.assertMovementExists(applied_rule, movement_start_date) and\ movement_stop_date.month() <= number_of_months_in_year: - property_dict = {} - - simulation_movement = applied_rule.newContent( + applied_rule.newContent( id = 'movement_%s_%s' % (movement_start_date.year(), movement_stop_date.month()), start_date = movement_start_date, stop_date = movement_stop_date, diff --git a/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.EmploymentContract.xml b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.EmploymentContract.xml new file mode 100644 index 0000000000..71f8c69968 --- /dev/null +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.EmploymentContract.xml @@ -0,0 +1,110 @@ +<?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> diff --git a/product/ERP5/Document/PaySheetModel.py b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModel.py similarity index 95% rename from product/ERP5/Document/PaySheetModel.py rename to bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModel.py index abdff66e3e..52918cd318 100644 --- a/product/ERP5/Document/PaySheetModel.py +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModel.py @@ -31,7 +31,6 @@ from AccessControl import ClassSecurityInfo from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5.Document.TradeCondition import TradeCondition from Products.ERP5Type.XMLMatrix import XMLMatrix -from Products.ERP5.Document.PaySheetTransaction import PaySheetTransaction class PaySheetModel(TradeCondition, XMLMatrix): """A PaySheetModel defines calculation rules for paysheets. @@ -75,9 +74,11 @@ class PaySheetModel(TradeCondition, XMLMatrix): ''' paysheet = kw.get('paysheet') if paysheet is None: - from Products.ERP5Type.Document import newTempPaySheetTransaction - paysheet = newTempPaySheetTransaction(self.getPortalObject(), '', - specialise_value=self) + paysheet = self.getPortalObject().newContent( + temp_object=True, + portal_type='Pay Sheet Transaction', + id='', + specialise_value=self) model_list = self.findEffectiveSpecialiseValueList(paysheet) for specialised_model in model_list: cell = XMLMatrix.getCell(specialised_model, *args, **kw) diff --git a/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModel.xml b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModel.xml new file mode 100644 index 0000000000..279e7d5016 --- /dev/null +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModel.xml @@ -0,0 +1,110 @@ +<?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> diff --git a/product/ERP5/Document/PaySheetModelCell.py b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelCell.py similarity index 66% rename from product/ERP5/Document/PaySheetModelCell.py rename to bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelCell.py index 6f6599eb8f..b0099c60ab 100644 --- a/product/ERP5/Document/PaySheetModelCell.py +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelCell.py @@ -33,26 +33,26 @@ from Products.ERP5.Document.TradeModelCell import TradeModelCell from Products.ERP5Type.Core.Predicate import Predicate class PaySheetModelCell(TradeModelCell): - """Trade Model Line - """ - meta_type = 'ERP5 Pay Sheet Model Cell' - portal_type = 'Pay Sheet Model Cell' - isCell = 1 + """Trade Model Line + """ + meta_type = 'ERP5 Pay Sheet Model Cell' + portal_type = 'Pay Sheet Model Cell' + isCell = 1 - # Declarative security - security = ClassSecurityInfo() - security.declareObjectProtected(Permissions.AccessContentsInformation) + # Declarative security + security = ClassSecurityInfo() + security.declareObjectProtected(Permissions.AccessContentsInformation) - def getMappedValueBaseCategoryList(self): - result = self._baseGetMappedValueBaseCategoryList() - if not result: - if not self.hasCellContent(base_id='variation'): - result = self.getVariationRangeBaseCategoryList() # The current resource variation - return list(result) + ['trade_phase', 'quantity_unit'] + def getMappedValueBaseCategoryList(self): + result = self._baseGetMappedValueBaseCategoryList() + if not result: + if not self.hasCellContent(base_id='variation'): + result = self.getVariationRangeBaseCategoryList() # The current resource variation + return list(result) + ['trade_phase', 'quantity_unit'] - # Redefine some methods as we do not want to turn cells into predicate - def edit(self, **kw): - return super(Predicate, self).edit(**kw) + # Redefine some methods as we do not want to turn cells into predicate + def edit(self, **kw): + return super(Predicate, self).edit(**kw) # pylint: disable=bad-super-call - def setPredicateCategoryList(self, *args, **kw): - pass + def setPredicateCategoryList(self, *args, **kw): + pass diff --git a/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelCell.xml b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelCell.xml new file mode 100644 index 0000000000..a68e25d231 --- /dev/null +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelCell.xml @@ -0,0 +1,110 @@ +<?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> diff --git a/product/ERP5/Document/PaySheetModelLine.py b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.py similarity index 100% rename from product/ERP5/Document/PaySheetModelLine.py rename to bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.py diff --git a/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.xml b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.xml new file mode 100644 index 0000000000..00c6276317 --- /dev/null +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelLine.xml @@ -0,0 +1,106 @@ +<?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> diff --git a/product/ERP5/Document/PaySheetModelSlice.py b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelSlice.py similarity index 63% rename from product/ERP5/Document/PaySheetModelSlice.py rename to bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelSlice.py index 0e3b6cb0a2..14f60d9a36 100644 --- a/product/ERP5/Document/PaySheetModelSlice.py +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelSlice.py @@ -31,30 +31,30 @@ from Products.ERP5Type import Permissions, PropertySheet from Products.ERP5.Document.DeliveryCell import DeliveryCell class PaySheetModelSlice(DeliveryCell): - """ - A PaySheetModelSlice allows to define max and min values - for each slice - """ + """ + A PaySheetModelSlice allows to define max and min values + for each slice + """ - meta_type = 'ERP5 Pay Sheet Model Slice' - portal_type = 'Pay Sheet Model Slice' - isCell = 1 + meta_type = 'ERP5 Pay Sheet Model Slice' + portal_type = 'Pay Sheet Model Slice' + isCell = 1 - # Declarative security - security = ClassSecurityInfo() - security.declareObjectProtected(Permissions.AccessContentsInformation) + # Declarative security + security = ClassSecurityInfo() + security.declareObjectProtected(Permissions.AccessContentsInformation) - # Declarative properties - property_sheets = ( PropertySheet.Base - , PropertySheet.CategoryCore - , PropertySheet.Arrow - , PropertySheet.Amount - , PropertySheet.Task - , PropertySheet.Movement - , PropertySheet.Price - , PropertySheet.Predicate - , PropertySheet.MappedValue - , PropertySheet.ItemAggregation - , PropertySheet.PaySheetModel - ) + # Declarative properties + property_sheets = ( PropertySheet.Base + , PropertySheet.CategoryCore + , PropertySheet.Arrow + , PropertySheet.Amount + , PropertySheet.Task + , PropertySheet.Movement + , PropertySheet.Price + , PropertySheet.Predicate + , PropertySheet.MappedValue + , PropertySheet.ItemAggregation + , PropertySheet.PaySheetModel + ) diff --git a/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelSlice.xml b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelSlice.xml new file mode 100644 index 0000000000..644b3c62ed --- /dev/null +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetModelSlice.xml @@ -0,0 +1,110 @@ +<?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> diff --git a/product/ERP5/Document/PaySheetTransaction.py b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransaction.py similarity index 100% rename from product/ERP5/Document/PaySheetTransaction.py rename to bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransaction.py diff --git a/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransaction.xml b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransaction.xml new file mode 100644 index 0000000000..9e5408537d --- /dev/null +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransaction.xml @@ -0,0 +1,104 @@ +<?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> diff --git a/product/ERP5/Document/PaySheetTransactionLine.py b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransactionLine.py similarity index 100% rename from product/ERP5/Document/PaySheetTransactionLine.py rename to bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransactionLine.py diff --git a/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransactionLine.xml b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransactionLine.xml new file mode 100644 index 0000000000..38bae74013 --- /dev/null +++ b/bt5/erp5_payroll/DocumentTemplateItem/portal_components/document.erp5.PaySheetTransactionLine.xml @@ -0,0 +1,104 @@ +<?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> diff --git a/product/ERP5/tests/testPayroll.py b/bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py similarity index 99% rename from product/ERP5/tests/testPayroll.py rename to bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py index e735a87c17..9259408e51 100644 --- a/product/ERP5/tests/testPayroll.py +++ b/bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.py @@ -1023,8 +1023,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): def stepModelSetCategories(self, sequence=None, **kw): model = sequence.get('model') currency = sequence.get('price_currency') - employer = sequence.get('employer') - employee = sequence.get('employee') model.edit(\ price_currency_value=currency, default_payment_condition_trade_date='custom', @@ -1587,8 +1585,6 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): paysheet_without_date.PaySheetTransaction_applyModel() self.tic() - portal_type_list = ['Pay Sheet Model Line',] - # check the paysheet contail no lines before calculation self.assertEqual(len(paysheet_without_date.contentValues(\ portal_type='Pay Sheet Line')), 0) @@ -1721,7 +1717,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): version='002', 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', variation_settings_category_list=['salary_range/france',], reference='fabien_model_2009', @@ -1759,7 +1755,7 @@ class TestPayrollMixin(TestTradeModelLineMixin, ERP5ReportTestCase): not be created.''' model = sequence.get('model') labour = sequence.get('labour_service') - line = model.newContent( + model.newContent( id='line', reference='zero_price_line', portal_type='Pay Sheet Model Line', @@ -2630,7 +2626,7 @@ class TestPayroll(TestPayrollMixin): provider = self.portal.organisation_module.newContent( portal_type='Organisation', title='Service Provider') - other_provider = self.portal.organisation_module.newContent( + self.portal.organisation_module.newContent( portal_type='Organisation', title='Another Service Provider') ps1 = self.portal.accounting_module.newContent( @@ -2858,7 +2854,7 @@ class TestPayroll(TestPayrollMixin): provider = self.portal.organisation_module.newContent( portal_type='Organisation', title='Service Provider') - other_provider = self.portal.organisation_module.newContent( + self.portal.organisation_module.newContent( portal_type='Organisation', title='Another Service Provider') ps1 = self.portal.accounting_module.newContent( @@ -3319,7 +3315,6 @@ class TestPayroll(TestPayrollMixin): def test_modelSliceInheritance(self): '''Check the slice inheritance''' - base_id = 'cell' paysheet_model_module = self.getPortalObject().paysheet_model_module model_1 = paysheet_model_module.newContent( portal_type='Pay Sheet Model', diff --git a/bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.xml b/bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.xml new file mode 100644 index 0000000000..51c7378332 --- /dev/null +++ b/bt5/erp5_payroll/TestTemplateItem/portal_components/test.erp5.testPayroll.xml @@ -0,0 +1,117 @@ +<?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> diff --git a/bt5/erp5_payroll/bt/template_document_id_list b/bt5/erp5_payroll/bt/template_document_id_list new file mode 100644 index 0000000000..8fa0c38b62 --- /dev/null +++ b/bt5/erp5_payroll/bt/template_document_id_list @@ -0,0 +1,7 @@ +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 diff --git a/bt5/erp5_payroll/bt/template_test_id_list b/bt5/erp5_payroll/bt/template_test_id_list new file mode 100644 index 0000000000..f159f31201 --- /dev/null +++ b/bt5/erp5_payroll/bt/template_test_id_list @@ -0,0 +1 @@ +test.erp5.testPayroll \ No newline at end of file diff --git a/bt5/erp5_payroll/bt/test_dependency_list b/bt5/erp5_payroll/bt/test_dependency_list new file mode 100644 index 0000000000..fa9f074423 --- /dev/null +++ b/bt5/erp5_payroll/bt/test_dependency_list @@ -0,0 +1,16 @@ +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 diff --git a/product/ERP5/tests/testPayroll_l10n_fr.py b/bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testPayroll_l10n_fr.py similarity index 95% rename from product/ERP5/tests/testPayroll_l10n_fr.py rename to bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testPayroll_l10n_fr.py index 3abc5ff9ea..0bf19ac3ea 100644 --- a/product/ERP5/tests/testPayroll_l10n_fr.py +++ b/bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testPayroll_l10n_fr.py @@ -31,7 +31,7 @@ """ 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 class TestPayroll_l10n_fr(TestPayrollMixin): @@ -61,8 +61,10 @@ class TestPayroll_l10n_fr(TestPayrollMixin): def stepCheckYearToDateSliceAmount(self, sequence=None, **kw): paysheet_module = self.portal.getDefaultModule(portal_type=\ 'Pay Sheet Transaction') - paysheet_list = paysheet_module.contentValues(portal_type=\ - 'Pay Sheet Transaction') + paysheet_list = [ + 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 # for this test diff --git a/bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testPayroll_l10n_fr.xml b/bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testPayroll_l10n_fr.xml new file mode 100644 index 0000000000..cd519f9be9 --- /dev/null +++ b/bt5/erp5_payroll_l10n_fr/TestTemplateItem/portal_components/test.erp5.testPayroll_l10n_fr.xml @@ -0,0 +1,110 @@ +<?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> diff --git a/bt5/erp5_payroll_l10n_fr/bt/template_test_id_list b/bt5/erp5_payroll_l10n_fr/bt/template_test_id_list index d6a8ccb4ae..bfdada2962 100644 --- a/bt5/erp5_payroll_l10n_fr/bt/template_test_id_list +++ b/bt5/erp5_payroll_l10n_fr/bt/template_test_id_list @@ -1,2 +1,3 @@ test.erp5.testDSNSocialDeclarationReport +test.erp5.testPayroll_l10n_fr test.erp5.testSimplifiedPayslipReport \ No newline at end of file diff --git a/bt5/erp5_payroll_l10n_fr/bt/test_dependency_list b/bt5/erp5_payroll_l10n_fr/bt/test_dependency_list index e43732e427..12f8cdefec 100644 --- a/bt5/erp5_payroll_l10n_fr/bt/test_dependency_list +++ b/bt5/erp5_payroll_l10n_fr/bt/test_dependency_list @@ -1,2 +1,18 @@ 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 \ No newline at end of file -- 2.30.9