Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
slapos.core
Commits
5f6d212b
Commit
5f6d212b
authored
Feb 14, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: drop not needed SaleInvoiceTransaction_resetPaymentMode
parent
2e8399c8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
113 deletions
+2
-113
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_cancelIfSaleInvoiceTransactionIsLettered.py
...ntTransaction_cancelIfSaleInvoiceTransactionIsLettered.py
+0
-4
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_resetPaymentMode.py
...pos_accounting/SaleInvoiceTransaction_resetPaymentMode.py
+0
-10
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_resetPaymentMode.xml
...os_accounting/SaleInvoiceTransaction_resetPaymentMode.xml
+0
-70
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
.../portal_components/test.erp5.testSlapOSAccountingSkins.py
+2
-29
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_cancelIfSaleInvoiceTransactionIsLettered.py
View file @
5f6d212b
...
...
@@ -12,12 +12,8 @@ if invoice is None:
letter
=
invoice
.
SaleInvoiceTransaction_isLettered
()
if
letter
:
# We should ensure that the order builder won't create another document.
context
.
edit
(
payment_mode
=
None
)
context
.
cancel
(
comment
=
"Payment is cancelled since the invoice is payed by other document,
\
with grouping reference %s"
%
letter
)
# Should be safe now to fix everything XXXXXXX
invoice
.
SaleInvoiceTransaction_resetPaymentMode
()
return
"Payment Cancelled"
return
"Skipped"
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_resetPaymentMode.py
deleted
100644 → 0
View file @
2e8399c8
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
assert
"Sale Invoice Transaction"
==
context
.
getPortalType
()
assert
"stopped"
==
context
.
getSimulationState
()
# Edit as Manager to workarround security when cancel Sale Invoice Transaction
if
context
.
getPaymentMode
()
in
[
"payzen"
,
"wechat"
]:
context
.
edit
(
payment_mode
=
None
)
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/SaleInvoiceTransaction_resetPaymentMode.xml
deleted
100644 → 0
View file @
2e8399c8
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
REQUEST=None
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SaleInvoiceTransaction_resetPaymentMode
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSAccountingSkins.py
View file @
5f6d212b
...
...
@@ -28,7 +28,6 @@
from
erp5.component.test.SlapOSTestCaseMixin
import
SlapOSTestCaseMixin
,
withAbort
from
zExceptions
import
Unauthorized
from
DateTime
import
DateTime
class
TestSlapOSAccounting
(
SlapOSTestCaseMixin
):
...
...
@@ -124,34 +123,6 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
"%s doesn't end with %s?portal_status_message=The%%20payment%%20mode%%20is%%20unsupported."
%
(
redirect
,
sale_invoice_transaction
.
getRelativeUrl
()))
#################################################################
# SaleInvoiceTransaction_resetPaymentMode
#################################################################
def
test_SaleInvoiceTransaction_resetPaymentMode
(
self
):
sale_invoice_transaction
=
self
.
portal
.
accounting_module
.
newContent
(
portal_type
=
"Sale Invoice Transaction"
)
sale_invoice_transaction
.
edit
(
payment_mode
=
"unknown"
,
start_date
=
DateTime
(),
stop_date
=
DateTime
())
sale_invoice_transaction
.
confirm
()
sale_invoice_transaction
.
start
(
)
sale_invoice_transaction
.
stop
()
sale_invoice_transaction
.
SaleInvoiceTransaction_resetPaymentMode
()
self
.
assertEqual
(
sale_invoice_transaction
.
getPaymentMode
(),
"unknown"
)
sale_invoice_transaction
.
edit
(
payment_mode
=
"payzen"
)
sale_invoice_transaction
.
SaleInvoiceTransaction_resetPaymentMode
()
self
.
assertEqual
(
sale_invoice_transaction
.
getPaymentMode
(),
None
)
sale_invoice_transaction
.
edit
(
payment_mode
=
"wechat"
)
sale_invoice_transaction
.
SaleInvoiceTransaction_resetPaymentMode
()
self
.
assertEqual
(
sale_invoice_transaction
.
getPaymentMode
(),
None
)
self
.
assertRaises
(
Unauthorized
,
sale_invoice_transaction
.
SaleInvoiceTransaction_resetPaymentMode
,
REQUEST
=
{})
#################################################################
# SaleInvoiceTransaction_createReversalSaleInvoiceTransaction
#################################################################
...
...
@@ -457,6 +428,8 @@ class TestSlapOSAccounting(SlapOSTestCaseMixin):
self
.
tic
()
self
.
assertEqual
(
"Cancelled"
,
invoice
.
AccountingTransaction_getPaymentState
())
self
.
assertEqual
(
0
,
invoice
.
getTotalPrice
()
+
reversal
.
getTotalPrice
())
self
.
assertTrue
(
invoice
.
SaleInvoiceTransaction_isLettered
())
self
.
assertTrue
(
reversal
.
SaleInvoiceTransaction_isLettered
())
@
withAbort
def
test_AccountingTransaction_getPaymentState_wechat_reversed_payment
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment