Commit 873be052 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting&payzen: newTempSimulationMovement was replaced by newContent

parent 39594073
select_kw = kwargs.copy() select_kw = kwargs.copy()
select_kw.pop('portal_type', None) select_kw.pop('portal_type', None)
select_kw.pop('delivery_relative_url_list', None) select_kw.pop('delivery_relative_url_list', None)
from Products.ERP5Type.Document import newTempSimulationMovement
from Products.ZSQLCatalog.SQLCatalog import Query, NegatedQuery, ComplexQuery from Products.ZSQLCatalog.SQLCatalog import Query, NegatedQuery, ComplexQuery
portal = context.getPortalObject() portal = context.getPortalObject()
newTempSimulationMovement = portal.portal_trash.newContent
business_process_uid_list = [ business_process_uid_list = [
portal.business_process_module.slapos_reservation_refound_business_process.getUid(), portal.business_process_module.slapos_reservation_refound_business_process.getUid(),
portal.business_process_module.slapos_subscription_business_process.getUid()] portal.business_process_module.slapos_subscription_business_process.getUid()]
...@@ -50,7 +51,8 @@ for movement in movement_list: ...@@ -50,7 +51,8 @@ for movement in movement_list:
if movement.getGroupingReference() is not None: if movement.getGroupingReference() is not None:
continue continue
temp_movement = newTempSimulationMovement( temp_movement = newTempSimulationMovement(
portal, movement.getRelativeUrl(), temp_object=True, id=movement.getRelativeUrl(),
portal_type="Simulation Movement",
quantity=movement.getQuantity(), quantity=movement.getQuantity(),
resource=movement.getResource(), resource=movement.getResource(),
source=movement.getDestination(), source=movement.getDestination(),
......
from Products.ERP5Type.Document import newTempSimulationMovement
portal = context.getPortalObject() portal = context.getPortalObject()
newTempSimulationMovement = portal.portal_trash.newContent
select_dict = { select_dict = {
'causality_payment_transaction_related_uid': None, 'causality_payment_transaction_related_uid': None,
'causality_subscription_request_related_uid': None, 'causality_subscription_request_related_uid': None,
...@@ -38,6 +38,7 @@ for invoice in portal.portal_catalog(**select_kw): ...@@ -38,6 +38,7 @@ for invoice in portal.portal_catalog(**select_kw):
default_source_uid=default_source_uid): default_source_uid=default_source_uid):
quantity += movement.getQuantity() quantity += movement.getQuantity()
temp_movement_kw = dict( temp_movement_kw = dict(
portal_type="Simulation Movement",
causality=invoice.getRelativeUrl(), causality=invoice.getRelativeUrl(),
source_section=invoice.getSourceSection(), source_section=invoice.getSourceSection(),
destination_section=invoice.getDestinationSection(), destination_section=invoice.getDestinationSection(),
...@@ -50,7 +51,7 @@ for invoice in portal.portal_catalog(**select_kw): ...@@ -50,7 +51,7 @@ for invoice in portal.portal_catalog(**select_kw):
source_payment='organisation_module/slapos/bank_account', # the other place defnied: business process source_payment='organisation_module/slapos/bank_account', # the other place defnied: business process
) )
temp_movement_rec = newTempSimulationMovement( temp_movement_rec = newTempSimulationMovement(
portal, str(id), temp_object=True, id=str(id),
quantity=-1 * quantity, quantity=-1 * quantity,
source='account_module/receivable', source='account_module/receivable',
destination='account_module/payable', destination='account_module/payable',
...@@ -58,7 +59,7 @@ for invoice in portal.portal_catalog(**select_kw): ...@@ -58,7 +59,7 @@ for invoice in portal.portal_catalog(**select_kw):
) )
id += 1 id += 1
temp_movement_bank = newTempSimulationMovement( temp_movement_bank = newTempSimulationMovement(
portal, str(id), temp_object=True, id=str(id),
quantity=1 * quantity, quantity=1 * quantity,
source='account_module/bank', source='account_module/bank',
destination='account_module/bank', destination='account_module/bank',
......
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