diff --git a/product/ERP5Banking/tests/TestERP5BankingMixin.py b/product/ERP5Banking/tests/TestERP5BankingMixin.py index 5c6fa9d00e4d835419b16b8e20b7d00514f62564..61069ae625502e5a1aed8bbad1cd3508a87cfe89 100644 --- a/product/ERP5Banking/tests/TestERP5BankingMixin.py +++ b/product/ERP5Banking/tests/TestERP5BankingMixin.py @@ -309,6 +309,7 @@ class TestERP5BankingMixin: def createCurrency(self, id='EUR', title='Euro'): # create the currency document for euro inside the currency module currency = self.getCurrencyModule().newContent(id=id, title=title, reference=id) + exchange_line = None if id=='USD': # Create an exchange line exchange_line = currency.newContent(portal_type='Currency Exchange Line', @@ -338,6 +339,10 @@ class TestERP5BankingMixin: for cell in cell_list: cell.setBasePrice(1./650.0) + if exchange_line is not None: + exchange_line.confirm() + exchange_line.validate() + return currency @@ -804,6 +809,7 @@ class TestERP5BankingMixin: model = self.checkbook_model_module.newContent(id = id, portal_type = 'Checkbook Model', title='Generic', + account_number_enabled=True, composition=check_model.getRelativeUrl()) model.newContent(id='variant_1',portal_type='Checkbook Model Check Amount Variation', quantity=50,title='50') @@ -822,6 +828,7 @@ class TestERP5BankingMixin: portal_type = 'Check Model', title = 'Check', reference = reference, + account_number_enabled=True, ) def createCheckAndCheckbookModel(self): diff --git a/product/ERP5Banking/tests/testERP5BankingCheckDeposit.py b/product/ERP5Banking/tests/testERP5BankingCheckDeposit.py index 4f1e29e518ff591e995f913bf3d7f559fd322af4..3d6b6159b1db68ad575a7c4bb4ebb165643856eb 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckDeposit.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckDeposit.py @@ -135,6 +135,7 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): # the checkbook module self.checkbook_module = self.getCheckbookModule() + self.createCheckAndCheckbookModel() # create a check self.checkbook_1 = self.createCheckbook(id= 'checkbook_1', vault=None, @@ -145,6 +146,7 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): self.check_1 = self.createCheck(id='check_1', reference='CHKNB1', + resource_value=self.check_model, checkbook=self.checkbook_1) @@ -205,13 +207,15 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): """ Add a check to the check deposit """ - self.check_operation_line_1 = self.check_deposit.newContent(id='check_operation_line_1', - portal_type="Check Operation Line", - aggregate_free_text="CHKNB1", - source_payment_value = self.bank_account_2, - price=2000, - quantity=1, - quantity_unit_value=self.unit) + self.check_operation_line_1 = self.check_deposit.newContent( + id='check_operation_line_1', + portal_type="Check Operation Line", + aggregate_free_text="CHKNB1", + aggregate_resource=self.check_model.getRelativeUrl(), + source_payment_value = self.bank_account_2, + price=2000, + quantity=1, + quantity_unit_value=self.unit) self.assertNotEqual(self.check_operation_line_1, None) self.assertEqual(len(self.check_deposit.objectIds()), 1) @@ -221,13 +225,15 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): Add a check to the check deposit, check number is not defined into site so transition must failed """ - self.check_operation_line_1 = self.check_deposit.newContent(id='check_operation_line_1', - portal_type="Check Operation Line", - aggregate_free_text="CHKNB6", - source_payment_value = self.bank_account_2, - price=2000, - quantity=1, - quantity_unit_value=self.unit) + self.check_operation_line_1 = self.check_deposit.newContent( + id='check_operation_line_1', + portal_type="Check Operation Line", + aggregate_free_text="CHKNB6", + aggregate_resource=self.check_model.getRelativeUrl(), + source_payment_value = self.bank_account_2, + price=2000, + quantity=1, + quantity_unit_value=self.unit) self.assertNotEqual(self.check_operation_line_1, None) self.assertEqual(len(self.check_deposit.objectIds()), 1) @@ -294,11 +300,13 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): def stepClearCheck(self, sequence=None, sequence_list=None, **kw): """ - Remove previous check and create a new one with same reference + Remove previous check and create a new one with same reference, + like this we make sure the workflow history is empty """ self.checkbook_1.manage_delObjects([self.check_1.getId(),]) self.check_1 = self.createCheck(id='check_1', reference='CHKNB1', + resource_value=self.check_model, checkbook=self.checkbook_1) def stepClearCheckDepositModule(self, sequence=None, sequence_list=None, **kw): diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookDelivery.py b/product/ERP5Banking/tests/testERP5BankingCheckbookDelivery.py index 41934bda8482ad810950f212ae5ca4f778e4710b..1284556dfc5ae0a0222ff589a9473b8d30075580 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookDelivery.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookDelivery.py @@ -84,8 +84,7 @@ class TestERP5BankingCheckbookDeliveryMixin: self.createManagerAndLogin() self.createFunctionGroupSiteCategory() - self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1') - self.check_model_1 = self.createCheckModel('check_model_1') + self.createCheckAndCheckbookModel() self.createBanknotesAndCoins() self.vault_transfer_source_site = self.paris.caveau self.vault_transfer_destination_site = self.paris.surface @@ -218,7 +217,7 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin, # Add a line for check and checkbook self.line_1 = self.checkbook_delivery.newContent(quantity=1, resource_value=self.checkbook_model_1, - check_amount_value=self.checkbook_model_1.variant_1, + check_amount_value=self.checkbook_model.variant_1, reference_range_min=1, description='test', reference_range_max=50, diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookMovement.py b/product/ERP5Banking/tests/testERP5BankingCheckbookMovement.py index 1550595903da367ccb8b40decda947e81864381e..8fd5734711309c22230f00a3348abd4bbeec446f 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookMovement.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookMovement.py @@ -86,8 +86,7 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi self.createManagerAndLogin() self.createFunctionGroupSiteCategory(site_list=['paris','madrid']) - self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1') - self.check_model_1 = self.createCheckModel('check_model_1') + self.createCheckAndCheckbookModel() self.createBanknotesAndCoins() self.reception_destination_site = self.paris self.source_site = self.paris diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookReception.py b/product/ERP5Banking/tests/testERP5BankingCheckbookReception.py index 5a5ca83ab962be338afdefd05f2395fd0deaff67..e060de489603ff4f0edab130dc109335262b77ea 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookReception.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookReception.py @@ -85,9 +85,7 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): self.createFunctionGroupSiteCategory() self.createBanknotesAndCoins() self.traveler_check_model = self.createTravelerCheckModel('traveler_check_model') - self.check_model_1 = self.createCheckModel('check_model_1') - self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1', - check_model=self.check_model_1) + self.createCheckAndCheckbookModel() self.reception = self.paris.caveau.auxiliaire.encaisse_des_billets_et_monnaies self.destination_site = self.paris self.checkUserFolderType() diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookUsualCashTransfer.py b/product/ERP5Banking/tests/testERP5BankingCheckbookUsualCashTransfer.py index c37a2b954bb99baea4d68a54177950aeeb8010c8..825f2eaea787a0bf3ff61bfb0a13ed85e541f725 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookUsualCashTransfer.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookUsualCashTransfer.py @@ -78,9 +78,7 @@ class TestERP5BankingCheckbookUsualCashTransferMixin( wf_id='checkbook_vault_transfer_workflow') self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_action', wf_id='checkbook_vault_transfer_workflow') - self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_action', - wf_id='checkbook_vault_transfer_workflow') - self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_to_deliver_action', + self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_to_deliver_action', wf_id='checkbook_vault_transfer_workflow') def createCheckbookVaultTransferWithTravelerCheck(self, sequence=None, @@ -106,9 +104,7 @@ class TestERP5BankingCheckbookUsualCashTransferMixin( wf_id='checkbook_vault_transfer_workflow') self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_action', wf_id='checkbook_vault_transfer_workflow') - self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_action', - wf_id='checkbook_vault_transfer_workflow') - self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_to_deliver_action', + self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_to_deliver_action', wf_id='checkbook_vault_transfer_workflow') class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCashTransferMixin, @@ -150,8 +146,7 @@ class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCas self.createManagerAndLogin() self.createFunctionGroupSiteCategory() - self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1') - self.check_model_1 = self.createCheckModel('check_model_1') + self.createCheckAndCheckbookModel() self.createBanknotesAndCoins() self.vault_transfer_source_site = self.paris.caveau self.vault_transfer_destination_site = self.paris.surface diff --git a/product/ERP5Banking/tests/testERP5BankingCheckbookVaultTransfer.py b/product/ERP5Banking/tests/testERP5BankingCheckbookVaultTransfer.py index 9a6a83d1fec318f4de88f187e1c50b8a54ce9f20..8e64e452e1dffc112f99accbbd7a128f2f100859 100755 --- a/product/ERP5Banking/tests/testERP5BankingCheckbookVaultTransfer.py +++ b/product/ERP5Banking/tests/testERP5BankingCheckbookVaultTransfer.py @@ -183,9 +183,7 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe self.createManagerAndLogin() self.createFunctionGroupSiteCategory() - self.check_model_1 = self.createCheckModel('check_model_1') - self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1', - check_model=self.check_model_1) + self.createCheckAndCheckbookModel() self.destination_site = self.paris self.createBanknotesAndCoins() self.reception_destination_site = self.paris diff --git a/product/ERP5Banking/tests/testERP5BankingStopPayment.py b/product/ERP5Banking/tests/testERP5BankingStopPayment.py index d2ae8ecf836157c76c4c9e19922d2aff0341ebe6..b543d17d84281ed02106e49a9d35ce1816ae369f 100755 --- a/product/ERP5Banking/tests/testERP5BankingStopPayment.py +++ b/product/ERP5Banking/tests/testERP5BankingStopPayment.py @@ -129,6 +129,7 @@ class TestERP5BankingStopPayment( TestERP5BankingCheckbookDeliveryMixin, description='test', start_date=self.date, reference_range_min=51, + aggregate_resource_value=self.check_model_1, source_total_asset_price=20000) # set source reference self.setDocumentSourceReference(self.stop_payment) diff --git a/product/ERP5Banking/tests/testERP5BankingTravelerCheckSale.py b/product/ERP5Banking/tests/testERP5BankingTravelerCheckSale.py index fd73234f1f5f63e3814e84f72fd411523b0aac83..8f50ff9200b13e0ec3a41ee2f0b664f25127ffce 100755 --- a/product/ERP5Banking/tests/testERP5BankingTravelerCheckSale.py +++ b/product/ERP5Banking/tests/testERP5BankingTravelerCheckSale.py @@ -118,8 +118,7 @@ class TestERP5BankingTravelerCheckSaleMixin: self.createManagerAndLogin() self.createFunctionGroupSiteCategory() - self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1') - self.check_model_1 = self.createCheckModel('check_model_1') + self.createCheckAndCheckbookModel() self.createBanknotesAndCoins() self.vault_transfer_source_site = self.paris.caveau self.vault_transfer_destination_site = self.paris.surface