Commit e3ee5996 authored by Sebastien Robin's avatar Sebastien Robin

many changes in order to take into account the new design of check and checkbooks

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14585 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 90e260fb
...@@ -309,6 +309,7 @@ class TestERP5BankingMixin: ...@@ -309,6 +309,7 @@ class TestERP5BankingMixin:
def createCurrency(self, id='EUR', title='Euro'): def createCurrency(self, id='EUR', title='Euro'):
# create the currency document for euro inside the currency module # create the currency document for euro inside the currency module
currency = self.getCurrencyModule().newContent(id=id, title=title, reference=id) currency = self.getCurrencyModule().newContent(id=id, title=title, reference=id)
exchange_line = None
if id=='USD': if id=='USD':
# Create an exchange line # Create an exchange line
exchange_line = currency.newContent(portal_type='Currency Exchange Line', exchange_line = currency.newContent(portal_type='Currency Exchange Line',
...@@ -338,6 +339,10 @@ class TestERP5BankingMixin: ...@@ -338,6 +339,10 @@ class TestERP5BankingMixin:
for cell in cell_list: for cell in cell_list:
cell.setBasePrice(1./650.0) cell.setBasePrice(1./650.0)
if exchange_line is not None:
exchange_line.confirm()
exchange_line.validate()
return currency return currency
...@@ -804,6 +809,7 @@ class TestERP5BankingMixin: ...@@ -804,6 +809,7 @@ class TestERP5BankingMixin:
model = self.checkbook_model_module.newContent(id = id, model = self.checkbook_model_module.newContent(id = id,
portal_type = 'Checkbook Model', portal_type = 'Checkbook Model',
title='Generic', title='Generic',
account_number_enabled=True,
composition=check_model.getRelativeUrl()) composition=check_model.getRelativeUrl())
model.newContent(id='variant_1',portal_type='Checkbook Model Check Amount Variation', model.newContent(id='variant_1',portal_type='Checkbook Model Check Amount Variation',
quantity=50,title='50') quantity=50,title='50')
...@@ -822,6 +828,7 @@ class TestERP5BankingMixin: ...@@ -822,6 +828,7 @@ class TestERP5BankingMixin:
portal_type = 'Check Model', portal_type = 'Check Model',
title = 'Check', title = 'Check',
reference = reference, reference = reference,
account_number_enabled=True,
) )
def createCheckAndCheckbookModel(self): def createCheckAndCheckbookModel(self):
......
...@@ -135,6 +135,7 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -135,6 +135,7 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
# the checkbook module # the checkbook module
self.checkbook_module = self.getCheckbookModule() self.checkbook_module = self.getCheckbookModule()
self.createCheckAndCheckbookModel()
# create a check # create a check
self.checkbook_1 = self.createCheckbook(id= 'checkbook_1', self.checkbook_1 = self.createCheckbook(id= 'checkbook_1',
vault=None, vault=None,
...@@ -145,6 +146,7 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -145,6 +146,7 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
self.check_1 = self.createCheck(id='check_1', self.check_1 = self.createCheck(id='check_1',
reference='CHKNB1', reference='CHKNB1',
resource_value=self.check_model,
checkbook=self.checkbook_1) checkbook=self.checkbook_1)
...@@ -205,13 +207,15 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -205,13 +207,15 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
""" """
Add a check to the check deposit Add a check to the check deposit
""" """
self.check_operation_line_1 = self.check_deposit.newContent(id='check_operation_line_1', self.check_operation_line_1 = self.check_deposit.newContent(
portal_type="Check Operation Line", id='check_operation_line_1',
aggregate_free_text="CHKNB1", portal_type="Check Operation Line",
source_payment_value = self.bank_account_2, aggregate_free_text="CHKNB1",
price=2000, aggregate_resource=self.check_model.getRelativeUrl(),
quantity=1, source_payment_value = self.bank_account_2,
quantity_unit_value=self.unit) price=2000,
quantity=1,
quantity_unit_value=self.unit)
self.assertNotEqual(self.check_operation_line_1, None) self.assertNotEqual(self.check_operation_line_1, None)
self.assertEqual(len(self.check_deposit.objectIds()), 1) self.assertEqual(len(self.check_deposit.objectIds()), 1)
...@@ -221,13 +225,15 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -221,13 +225,15 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
Add a check to the check deposit, check number is not defined into site Add a check to the check deposit, check number is not defined into site
so transition must failed so transition must failed
""" """
self.check_operation_line_1 = self.check_deposit.newContent(id='check_operation_line_1', self.check_operation_line_1 = self.check_deposit.newContent(
portal_type="Check Operation Line", id='check_operation_line_1',
aggregate_free_text="CHKNB6", portal_type="Check Operation Line",
source_payment_value = self.bank_account_2, aggregate_free_text="CHKNB6",
price=2000, aggregate_resource=self.check_model.getRelativeUrl(),
quantity=1, source_payment_value = self.bank_account_2,
quantity_unit_value=self.unit) price=2000,
quantity=1,
quantity_unit_value=self.unit)
self.assertNotEqual(self.check_operation_line_1, None) self.assertNotEqual(self.check_operation_line_1, None)
self.assertEqual(len(self.check_deposit.objectIds()), 1) self.assertEqual(len(self.check_deposit.objectIds()), 1)
...@@ -294,11 +300,13 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -294,11 +300,13 @@ class TestERP5BankingCheckDeposit(TestERP5BankingMixin, ERP5TypeTestCase):
def stepClearCheck(self, sequence=None, sequence_list=None, **kw): 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.checkbook_1.manage_delObjects([self.check_1.getId(),])
self.check_1 = self.createCheck(id='check_1', self.check_1 = self.createCheck(id='check_1',
reference='CHKNB1', reference='CHKNB1',
resource_value=self.check_model,
checkbook=self.checkbook_1) checkbook=self.checkbook_1)
def stepClearCheckDepositModule(self, sequence=None, sequence_list=None, **kw): def stepClearCheckDepositModule(self, sequence=None, sequence_list=None, **kw):
......
...@@ -84,8 +84,7 @@ class TestERP5BankingCheckbookDeliveryMixin: ...@@ -84,8 +84,7 @@ class TestERP5BankingCheckbookDeliveryMixin:
self.createManagerAndLogin() self.createManagerAndLogin()
self.createFunctionGroupSiteCategory() self.createFunctionGroupSiteCategory()
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1') self.createCheckAndCheckbookModel()
self.check_model_1 = self.createCheckModel('check_model_1')
self.createBanknotesAndCoins() self.createBanknotesAndCoins()
self.vault_transfer_source_site = self.paris.caveau self.vault_transfer_source_site = self.paris.caveau
self.vault_transfer_destination_site = self.paris.surface self.vault_transfer_destination_site = self.paris.surface
...@@ -218,7 +217,7 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin, ...@@ -218,7 +217,7 @@ class TestERP5BankingCheckbookDelivery(TestERP5BankingCheckbookDeliveryMixin,
# Add a line for check and checkbook # Add a line for check and checkbook
self.line_1 = self.checkbook_delivery.newContent(quantity=1, self.line_1 = self.checkbook_delivery.newContent(quantity=1,
resource_value=self.checkbook_model_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, reference_range_min=1,
description='test', description='test',
reference_range_max=50, reference_range_max=50,
......
...@@ -86,8 +86,7 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi ...@@ -86,8 +86,7 @@ class TestERP5BankingCheckbookMovement(TestERP5BankingCheckbookVaultTransferMixi
self.createManagerAndLogin() self.createManagerAndLogin()
self.createFunctionGroupSiteCategory(site_list=['paris','madrid']) self.createFunctionGroupSiteCategory(site_list=['paris','madrid'])
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1') self.createCheckAndCheckbookModel()
self.check_model_1 = self.createCheckModel('check_model_1')
self.createBanknotesAndCoins() self.createBanknotesAndCoins()
self.reception_destination_site = self.paris self.reception_destination_site = self.paris
self.source_site = self.paris self.source_site = self.paris
......
...@@ -85,9 +85,7 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase): ...@@ -85,9 +85,7 @@ class TestERP5BankingCheckbookReception(TestERP5BankingMixin, ERP5TypeTestCase):
self.createFunctionGroupSiteCategory() self.createFunctionGroupSiteCategory()
self.createBanknotesAndCoins() self.createBanknotesAndCoins()
self.traveler_check_model = self.createTravelerCheckModel('traveler_check_model') self.traveler_check_model = self.createTravelerCheckModel('traveler_check_model')
self.check_model_1 = self.createCheckModel('check_model_1') self.createCheckAndCheckbookModel()
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1',
check_model=self.check_model_1)
self.reception = self.paris.caveau.auxiliaire.encaisse_des_billets_et_monnaies self.reception = self.paris.caveau.auxiliaire.encaisse_des_billets_et_monnaies
self.destination_site = self.paris self.destination_site = self.paris
self.checkUserFolderType() self.checkUserFolderType()
......
...@@ -78,9 +78,7 @@ class TestERP5BankingCheckbookUsualCashTransferMixin( ...@@ -78,9 +78,7 @@ class TestERP5BankingCheckbookUsualCashTransferMixin(
wf_id='checkbook_vault_transfer_workflow') wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_action', self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_action',
wf_id='checkbook_vault_transfer_workflow') wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_action', self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_to_deliver_action',
wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_to_deliver_action',
wf_id='checkbook_vault_transfer_workflow') wf_id='checkbook_vault_transfer_workflow')
def createCheckbookVaultTransferWithTravelerCheck(self, sequence=None, def createCheckbookVaultTransferWithTravelerCheck(self, sequence=None,
...@@ -106,9 +104,7 @@ class TestERP5BankingCheckbookUsualCashTransferMixin( ...@@ -106,9 +104,7 @@ class TestERP5BankingCheckbookUsualCashTransferMixin(
wf_id='checkbook_vault_transfer_workflow') wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_action', self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_action',
wf_id='checkbook_vault_transfer_workflow') wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_action', self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'order_to_deliver_action',
wf_id='checkbook_vault_transfer_workflow')
self.workflow_tool.doActionFor(self.checkbook_vault_transfer, 'confirm_to_deliver_action',
wf_id='checkbook_vault_transfer_workflow') wf_id='checkbook_vault_transfer_workflow')
class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCashTransferMixin, class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCashTransferMixin,
...@@ -150,8 +146,7 @@ class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCas ...@@ -150,8 +146,7 @@ class TestERP5BankingCheckbookUsualCashTransfer(TestERP5BankingCheckbookUsualCas
self.createManagerAndLogin() self.createManagerAndLogin()
self.createFunctionGroupSiteCategory() self.createFunctionGroupSiteCategory()
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1') self.createCheckAndCheckbookModel()
self.check_model_1 = self.createCheckModel('check_model_1')
self.createBanknotesAndCoins() self.createBanknotesAndCoins()
self.vault_transfer_source_site = self.paris.caveau self.vault_transfer_source_site = self.paris.caveau
self.vault_transfer_destination_site = self.paris.surface self.vault_transfer_destination_site = self.paris.surface
......
...@@ -183,9 +183,7 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe ...@@ -183,9 +183,7 @@ class TestERP5BankingCheckbookVaultTransfer(TestERP5BankingCheckbookVaultTransfe
self.createManagerAndLogin() self.createManagerAndLogin()
self.createFunctionGroupSiteCategory() self.createFunctionGroupSiteCategory()
self.check_model_1 = self.createCheckModel('check_model_1') self.createCheckAndCheckbookModel()
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1',
check_model=self.check_model_1)
self.destination_site = self.paris self.destination_site = self.paris
self.createBanknotesAndCoins() self.createBanknotesAndCoins()
self.reception_destination_site = self.paris self.reception_destination_site = self.paris
......
...@@ -129,6 +129,7 @@ class TestERP5BankingStopPayment( TestERP5BankingCheckbookDeliveryMixin, ...@@ -129,6 +129,7 @@ class TestERP5BankingStopPayment( TestERP5BankingCheckbookDeliveryMixin,
description='test', description='test',
start_date=self.date, start_date=self.date,
reference_range_min=51, reference_range_min=51,
aggregate_resource_value=self.check_model_1,
source_total_asset_price=20000) source_total_asset_price=20000)
# set source reference # set source reference
self.setDocumentSourceReference(self.stop_payment) self.setDocumentSourceReference(self.stop_payment)
......
...@@ -118,8 +118,7 @@ class TestERP5BankingTravelerCheckSaleMixin: ...@@ -118,8 +118,7 @@ class TestERP5BankingTravelerCheckSaleMixin:
self.createManagerAndLogin() self.createManagerAndLogin()
self.createFunctionGroupSiteCategory() self.createFunctionGroupSiteCategory()
self.checkbook_model_1 = self.createCheckbookModel('checkbook_model_1') self.createCheckAndCheckbookModel()
self.check_model_1 = self.createCheckModel('check_model_1')
self.createBanknotesAndCoins() self.createBanknotesAndCoins()
self.vault_transfer_source_site = self.paris.caveau self.vault_transfer_source_site = self.paris.caveau
self.vault_transfer_destination_site = self.paris.surface self.vault_transfer_destination_site = self.paris.surface
......
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