Commit f38a583a authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Add script for replace the builder

   The usage of Entity_createPaymentTransaction is slightly faster since it is used to create the payment before the redirect.

   Since we arent creating Payments globally, call the builder to
produce a single payment would be overkill.
parent 69848c75
from Products.ERP5Type.Message import translateString
from zExceptions import Unauthorized
if REQUEST is not None:
raise Unauthorized
portal = context.getPortalObject()
if not invoice_list:
raise ValueError('You need to provide at least one Invoice transaction')
# For now consider a single value is passed, in future we intend to create
# a single payment per invoice.
current_invoice = invoice_list[0]
payment_tag ="sale_invoice_transaction_create_payment_%s" % current_invoice.getUid()
if context.REQUEST.get(payment_tag, None) is not None:
raise ValueError('This script was already called twice on the same transaction ')
if current_invoice.SaleInvoiceTransaction_isLettered():
raise ValueError('This invoice is already lettered')
context.serialize()
quantity = 0
for movement in current_invoice.searchFolder(
portal_type='Sale Invoice Transaction Line',
default_source_uid=[i.uid for i in context.Base_getReceivableAccountList()]):
quantity += movement.getQuantity()
current_payment = portal.accounting_module.newContent(
portal_type="Payment Transaction",
causality=current_invoice.getRelativeUrl(),
source_section=current_invoice.getSourceSection(),
destination_section=current_invoice.getDestinationSection(),
resource=current_invoice.getResource(),
price_currency=current_invoice.getResource(),
specialise=current_invoice.getSpecialise(),
payment_mode=current_invoice.getPaymentMode(),
start_date=current_invoice.getStartDate(),
stop_date=current_invoice.getStopDate(),
source_payment='%s/bank_account' % current_invoice.getSourceSection(), # the other place defnied: business process
# Workarround to not create default lines.
created_by_builder=1
)
current_payment.newContent(
portal_type="Accounting Transaction Line",
quantity=-1 * quantity,
source='account_module/receivable',
destination='account_module/payable',
start_date=current_invoice.getStartDate(),
stop_date=current_invoice.getStopDate())
current_payment.newContent(
portal_type="Accounting Transaction Line",
quantity=1 * quantity,
source='account_module/payment_to_encash',
destination='account_module/payment_to_encash',
start_date=current_invoice.getStartDate(),
stop_date=current_invoice.getStopDate())
comment = translateString("Initialised by Entity_createPaymentTransaction.")
current_payment.confirm(comment=comment)
# Reindex with a tag to ensure that there will be no generation while the object isn't
# reindexed.
payment_tag ="sale_invoice_transaction_create_payment_%s" % current_invoice.getUid()
current_payment.activate(tag=payment_tag).immediateReindexObject()
# Set a flag on the request for prevent 2 calls on the same transaction
context.REQUEST.set(payment_tag, 1)
return current_payment
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>invoice_list, REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Entity_createPaymentTransaction</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
from zExceptions import Unauthorized
if REQUEST is not None:
raise Unauthorized
portal = context.getObject() portal = context.getObject()
line_list = context.getMovementList( line_list = context.getMovementList(
...@@ -9,6 +13,6 @@ if not len(line_list): ...@@ -9,6 +13,6 @@ if not len(line_list):
source_list = [i.getRelativeUrl() for i in context.Base_getReceivableAccountList()] source_list = [i.getRelativeUrl() for i in context.Base_getReceivableAccountList()]
for line in line_list: for line in line_list:
if line.gerSource() in source_list: if line.getSource() in source_list:
if line.hasGroupingReference(): if line.hasGroupingReference():
return line.getGroupingReference() return line.getGroupingReference()
...@@ -50,7 +50,15 @@ ...@@ -50,7 +50,15 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>REQUEST=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
# -*- coding: utf-8 -*- # -*- coding:utf-8 -*-
############################################################################## ##############################################################################
# #
# Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved. # Copyright (c) 2022 Nexedi SA and Contributors. All Rights Reserved.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# #
############################################################################## ##############################################################################
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin): class TestSlapOSEntityCreatePaymentMixin(SlapOSTestCaseMixin):
def sumReceivable(self, payment_transaction): def sumReceivable(self, payment_transaction):
quantity = .0 quantity = .0
...@@ -63,19 +77,14 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin): ...@@ -63,19 +77,14 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin):
'destination/account_module/payable', 'destination/account_module/payable',
'source/account_module/receivable']) 'source/account_module/receivable'])
def emptyBuild(self, **kw): def fullBuild(self, person, invoice_list):
delivery_list = self._build(**kw) payment = person.Entity_createPaymentTransaction(invoice_list)
self.assertSameSet([], delivery_list) self.assertNotEqual(None, payment)
return delivery_list return payment
def fullBuild(self, **kw): def resetPaymentTag(self, invoice):
delivery_list = self._build(**kw) payment_tag = "sale_invoice_transaction_create_payment_%s" % invoice.getUid()
self.assertNotEqual([], delivery_list) invoice.REQUEST.set(payment_tag, None)
return delivery_list
def _build(self, **kw):
return self.portal.portal_orders.slapos_payment_transaction_builder.build(
**kw)
def _test(self): def _test(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
...@@ -87,12 +96,8 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin): ...@@ -87,12 +96,8 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin):
invoice.confirm() invoice.confirm()
invoice.stop() invoice.stop()
self.tic() self.tic()
payment_list = self.fullBuild(uid=invoice.getUid()) payment = self.fullBuild(person, [invoice])
self.tic() self.tic()
self.assertEqual(1, len(payment_list))
payment = payment_list[0].getObject()
self.assertPayment(payment, invoice) self.assertPayment(payment, invoice)
def _test_twice(self): def _test_twice(self):
...@@ -105,13 +110,13 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin): ...@@ -105,13 +110,13 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin):
invoice.confirm() invoice.confirm()
invoice.stop() invoice.stop()
self.tic() self.tic()
payment_list = self.fullBuild(uid=invoice.getUid()) payment = self.fullBuild(person, [invoice])
self.assertPayment(payment, invoice)
self.tic() self.tic()
self.emptyBuild(uid=invoice.getUid()) self.resetPaymentTag(invoice)
self.assertEqual(1, len(payment_list)) # Create twice, generate 2 payments
payment = self.fullBuild(person, [invoice])
payment = payment_list[0].getObject()
self.assertPayment(payment, invoice) self.assertPayment(payment, invoice)
def _test_twice_transaction(self): def _test_twice_transaction(self):
...@@ -124,13 +129,9 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin): ...@@ -124,13 +129,9 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin):
invoice.confirm() invoice.confirm()
invoice.stop() invoice.stop()
self.tic() self.tic()
payment_list = self.fullBuild(uid=invoice.getUid()) payment = self.fullBuild(person, [invoice])
self.emptyBuild(uid=invoice.getUid()) self.assertRaises(ValueError, person.Entity_createPaymentTransaction, [invoice])
self.tic() self.tic()
self.assertEqual(1, len(payment_list))
payment = payment_list[0].getObject()
self.assertPayment(payment, invoice) self.assertPayment(payment, invoice)
def _test_twice_indexation(self): def _test_twice_indexation(self):
...@@ -143,17 +144,18 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin): ...@@ -143,17 +144,18 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin):
invoice.confirm() invoice.confirm()
invoice.stop() invoice.stop()
self.tic() self.tic()
payment_list = self.fullBuild(uid=invoice.getUid()) payment = self.fullBuild(person, [invoice])
self.commit() self.commit()
# the payment transaction is immediately indexed # Request was over, so emulate start a new one
self.assertEqual(1, len(payment_list)) self.resetPaymentTag(invoice)
self.emptyBuild(uid=invoice.getUid())
self.tic()
# Should we take into account that a payment is ongoing?
payment2 = self.fullBuild(person, [invoice])
payment = payment_list[0].getObject() self.tic()
self.assertPayment(payment, invoice) self.assertPayment(payment, invoice)
self.assertPayment(payment2, invoice)
def _test_cancelled_payment(self): def _test_cancelled_payment(self):
person = self.portal.person_module.template_member\ person = self.portal.person_module.template_member\
...@@ -165,18 +167,13 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin): ...@@ -165,18 +167,13 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin):
invoice.confirm() invoice.confirm()
invoice.stop() invoice.stop()
self.tic() self.tic()
payment_list = self.fullBuild(uid=invoice.getUid()) payment = self.fullBuild(person, [invoice])
payment_list[0].cancel() payment.cancel()
self.tic() self.tic()
self.portal.REQUEST.set("sale_invoice_transaction_order_builder_%s" % invoice.getUid(), None) self.resetPaymentTag(invoice)
payment_list = self.fullBuild(uid=invoice.getUid()) payment = self.fullBuild(person, [invoice])
self.tic() self.tic()
self.emptyBuild(uid=invoice.getUid())
self.assertEqual(1, len(payment_list))
payment = payment_list[0].getObject()
self.assertPayment(payment, invoice) self.assertPayment(payment, invoice)
def _test_two_invoices(self): def _test_two_invoices(self):
...@@ -195,7 +192,8 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin): ...@@ -195,7 +192,8 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin):
invoice_2.confirm() invoice_2.confirm()
invoice_2.stop() invoice_2.stop()
self.tic() self.tic()
payment_list = self.fullBuild(uid=[invoice_1.getUid(), invoice_2.getUid()]) payment_list = [self.fullBuild(person, [invoice_1]),
self.fullBuild(person, [invoice_2])]
self.tic() self.tic()
self.assertEqual(2, len(payment_list)) self.assertEqual(2, len(payment_list))
...@@ -236,21 +234,17 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin): ...@@ -236,21 +234,17 @@ class TestSlapOSPaymentTransactionOrderBuilderMixin(SlapOSTestCaseMixin):
invoice.confirm() invoice.confirm()
invoice.stop() invoice.stop()
self.tic() self.tic()
payment_list = self.fullBuild(uid=[invoice.getUid()]) payment = self.fullBuild(person, [invoice])
self.tic() self.tic()
self.assertEqual(1, len(payment_list))
payment = payment_list[0].getObject()
self.assertPayment(payment, invoice) self.assertPayment(payment, invoice)
class TestSlapOSPaymentTransactionOrderBuilder(TestSlapOSPaymentTransactionOrderBuilderMixin): class TestSlapOSEntityCreatePayment(TestSlapOSEntityCreatePaymentMixin):
payment_mode = "payzen" payment_mode = "wire_transfer"
test = TestSlapOSPaymentTransactionOrderBuilderMixin._test test = TestSlapOSEntityCreatePaymentMixin._test
test_twice = TestSlapOSPaymentTransactionOrderBuilderMixin._test_twice test_twice = TestSlapOSEntityCreatePaymentMixin._test_twice
test_twice_transaction = TestSlapOSPaymentTransactionOrderBuilderMixin._test_twice_transaction test_twice_transaction = TestSlapOSEntityCreatePaymentMixin._test_twice_transaction
test_twice_indexation = TestSlapOSPaymentTransactionOrderBuilderMixin._test_twice_indexation test_twice_indexation = TestSlapOSEntityCreatePaymentMixin._test_twice_indexation
test_cancelled_payment = TestSlapOSPaymentTransactionOrderBuilderMixin._test_cancelled_payment test_cancelled_payment = TestSlapOSEntityCreatePaymentMixin._test_cancelled_payment
test_two_invoices = TestSlapOSPaymentTransactionOrderBuilderMixin._test_two_invoices test_two_invoices = TestSlapOSEntityCreatePaymentMixin._test_two_invoices
test_two_lines = TestSlapOSPaymentTransactionOrderBuilderMixin._test_two_lines test_two_lines = TestSlapOSEntityCreatePaymentMixin._test_two_lines
...@@ -6,15 +6,9 @@ ...@@ -6,15 +6,9 @@
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_recorded_property_dict</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>testSlapOSWechatBuilder</string> </value> <value> <string>testSlapOSEntityCreatePayment</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -24,7 +18,7 @@ ...@@ -24,7 +18,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSWechatBuilder</string> </value> <value> <string>test.erp5.testSlapOSEntityCreatePayment</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
...@@ -55,28 +49,13 @@ ...@@ -55,28 +49,13 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -89,7 +68,7 @@ ...@@ -89,7 +68,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -98,7 +77,7 @@ ...@@ -98,7 +77,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
......
...@@ -7,3 +7,4 @@ test.erp5.testSlapOSAccountingInteractionWorkflow ...@@ -7,3 +7,4 @@ test.erp5.testSlapOSAccountingInteractionWorkflow
test.erp5.testSlapOSAccountingSkins test.erp5.testSlapOSAccountingSkins
test.erp5.testSlapOSAccountingAlarm test.erp5.testSlapOSAccountingAlarm
test.erp5.testSlapOSContractAlarm test.erp5.testSlapOSContractAlarm
test.erp5.testSlapOSEntityCreatePayment
\ No newline at end of file
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (c) 2022 Nexedi SA and Contributors. All Rights Reserved.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from erp5.component.test.testSlapOSEntityCreatePayment import TestSlapOSEntityCreatePaymentMixin
class TestSlapOSEntityCreatePayment(TestSlapOSEntityCreatePaymentMixin):
payment_mode = "payzen"
test = TestSlapOSEntityCreatePaymentMixin._test
test_twice = TestSlapOSEntityCreatePaymentMixin._test_twice
test_twice_transaction = TestSlapOSEntityCreatePaymentMixin._test_twice_transaction
test_twice_indexation = TestSlapOSEntityCreatePaymentMixin._test_twice_indexation
test_cancelled_payment = TestSlapOSEntityCreatePaymentMixin._test_cancelled_payment
test_two_invoices = TestSlapOSEntityCreatePaymentMixin._test_two_invoices
test_two_lines = TestSlapOSEntityCreatePaymentMixin._test_two_lines
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_recorded_property_dict</string> </key> <key> <string>default_reference</string> </key>
<value> <value> <string>testSlapOSPayzenEntityCreatePayment</string> </value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_source_reference</string> </key>
<value> <string>testSlapOSPayzenBuilder</string> </value> <value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSPayzenBuilder</string> </value> <value> <string>test.erp5.testSlapOSPayzenEntityCreatePayment</string> </value>
</item> </item>
<item> <item>
<key> <string>portal_type</string> </key> <key> <string>portal_type</string> </key>
...@@ -55,28 +55,13 @@ ...@@ -55,28 +55,13 @@
<item> <item>
<key> <string>workflow_history</string> </key> <key> <string>workflow_history</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="2" aka="AAAAAAAAAAI="> <record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="PersistentMapping" module="Persistence.mapping"/> <global name="PersistentMapping" module="Persistence.mapping"/>
</pickle> </pickle>
...@@ -89,7 +74,7 @@ ...@@ -89,7 +74,7 @@
<item> <item>
<key> <string>component_validation_workflow</string> </key> <key> <string>component_validation_workflow</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
</dictionary> </dictionary>
...@@ -98,7 +83,7 @@ ...@@ -98,7 +83,7 @@
</dictionary> </dictionary>
</pickle> </pickle>
</record> </record>
<record id="4" aka="AAAAAAAAAAQ="> <record id="3" aka="AAAAAAAAAAM=">
<pickle> <pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/> <global name="WorkflowHistoryList" module="Products.ERP5Type.Workflow"/>
</pickle> </pickle>
......
test.erp5.testSlapOSPayzenBuilder test.erp5.testSlapOSPayzenEntityCreatePayment
test.erp5.testSlapOSPayzenSkins test.erp5.testSlapOSPayzenSkins
test.erp5.testSlapOSPayzenAlarm test.erp5.testSlapOSPayzenAlarm
test.erp5.testSlapOSPayzenWorkflow test.erp5.testSlapOSPayzenWorkflow
\ No newline at end of file
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2012 Nexedi SA and Contributors. All Rights Reserved.
#
##############################################################################
from erp5.component.test.testSlapOSPayzenBuilder import TestSlapOSPaymentTransactionOrderBuilderMixin
class TestSlapOSWechatPaymentTransactionOrderBuilder(TestSlapOSPaymentTransactionOrderBuilderMixin):
payment_mode = "wechat"
test = TestSlapOSPaymentTransactionOrderBuilderMixin._test
test_twice = TestSlapOSPaymentTransactionOrderBuilderMixin._test_twice
test_twice_transaction = TestSlapOSPaymentTransactionOrderBuilderMixin._test_twice_transaction
test_twice_indexation = TestSlapOSPaymentTransactionOrderBuilderMixin._test_twice_indexation
test_cancelled_payment = TestSlapOSPaymentTransactionOrderBuilderMixin._test_cancelled_payment
test_two_invoices = TestSlapOSPaymentTransactionOrderBuilderMixin._test_two_invoices
test_two_lines = TestSlapOSPaymentTransactionOrderBuilderMixin._test_two_lines
\ No newline at end of file
# -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (c) 2022 Nexedi SA and Contributors. All Rights Reserved.
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from erp5.component.test.testSlapOSEntityCreatePayment import TestSlapOSEntityCreatePaymentMixin
class TestSlapOSWechatEntityCreatePayment(TestSlapOSEntityCreatePaymentMixin):
payment_mode = "wechat"
test = TestSlapOSEntityCreatePaymentMixin._test
test_twice = TestSlapOSEntityCreatePaymentMixin._test_twice
test_twice_transaction = TestSlapOSEntityCreatePaymentMixin._test_twice_transaction
test_twice_indexation = TestSlapOSEntityCreatePaymentMixin._test_twice_indexation
test_cancelled_payment = TestSlapOSEntityCreatePaymentMixin._test_cancelled_payment
test_two_invoices = TestSlapOSEntityCreatePaymentMixin._test_two_invoices
test_two_lines = TestSlapOSEntityCreatePaymentMixin._test_two_lines
<?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>testSlapOSWechatEntityCreatePayment</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>test.erp5.testSlapOSWechatEntityCreatePayment</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.testSlapOSWechatSkins test.erp5.testSlapOSWechatSkins
test.erp5.testSlapOSWechatWorkflow test.erp5.testSlapOSWechatWorkflow
test.erp5.testSlapOSWechatAlarm test.erp5.testSlapOSWechatAlarm
test.erp5.testSlapOSWechatBuilder test.erp5.testSlapOSWechatEntityCreatePayment
\ No newline at end of file \ 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