Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
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
Léo-Paul Géneau
erp5
Commits
8d9f0270
Commit
8d9f0270
authored
Oct 27, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting: set portal_status_level in error case of dialog actions
parent
38935ab5
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
20 deletions
+39
-20
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_createRelatedPaymentTransactionList.py
...gTransactionModule_createRelatedPaymentTransactionList.py
+13
-6
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_createReversalTransactionList.py
...ountingTransactionModule_createReversalTransactionList.py
+10
-6
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertDestinationPrice.py
...counting/AccountingTransaction_convertDestinationPrice.py
+6
-3
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertSourcePrice.py
...p5_accounting/AccountingTransaction_convertSourcePrice.py
+6
-4
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Invoice_createRelatedPaymentTransaction.py
...rp5_accounting/Invoice_createRelatedPaymentTransaction.py
+4
-1
No files found.
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_createRelatedPaymentTransactionList.py
View file @
8d9f0270
...
...
@@ -22,8 +22,11 @@ portal.portal_selections.setSelectionParamsFor('accounting_create_related_paymen
if
len
(
object_list
)
>=
1000
:
return
context
.
Base_redirect
(
form_id
,
keep_items
=
{
'portal_status_message'
:
translateString
(
'Refusing to process more than 1000 objects, check your selection.'
)})
keep_items
=
{
'portal_status_message'
:
translateString
(
'Refusing to process more than 1000 objects, check your selection.'
),
'portal_status_level'
:
'error'
,
})
tag
=
'payment_creation_%s'
%
random
.
randint
(
0
,
1000
)
activated
=
0
...
...
@@ -35,8 +38,10 @@ for obj in object_list:
return
context
.
Base_redirect
(
form_id
,
abort_transaction
=
True
,
keep_items
=
{
'portal_status_message'
:
translateString
(
'Payment creation already in progress, abandon.'
)})
keep_items
=
{
'portal_status_message'
:
translateString
(
'Payment creation already in progress, abandon.'
),
'portal_status_level'
:
'error'
,
})
obj
.
activate
(
tag
=
tag
).
Invoice_createRelatedPaymentTransaction
(
node
=
node
,
payment_mode
=
payment_mode
,
...
...
@@ -47,8 +52,10 @@ for obj in object_list:
if
not
activated
:
return
context
.
Base_redirect
(
form_id
,
keep_items
=
{
'portal_status_message'
:
translateString
(
'No invoice in your selection.'
)})
keep_items
=
{
'portal_status_message'
:
translateString
(
'No invoice in your selection.'
),
'portal_status_level'
:
'error'
,
})
# activate something on the folder
context
.
activate
(
after_tag
=
tag
).
getTitle
()
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransactionModule_createReversalTransactionList.py
View file @
8d9f0270
...
...
@@ -13,9 +13,10 @@ else:
# XXX prevent to call this on the whole module:
if
len
(
object_list
)
>=
1000
:
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
'Refusing to process more than 1000 objects, check your selection.'
)))
keep_items
=
dict
(
portal_status_message
=
translateString
(
'Refusing to process more than 1000 objects, check your selection.'
),
portal_status_level
=
'error'
,
))
tag
=
'reversal_creation_%s'
%
random
.
randint
(
0
,
1000
)
activated
=
0
...
...
@@ -36,9 +37,12 @@ for obj in object_list:
activated
+=
1
if
not
activated
:
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
'No valid transaction in your selection.'
)))
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
'No valid transaction in your selection.'
),
portal_status_level
=
'error'
,
))
# activate something on the folder
context
.
activate
(
after_tag
=
tag
).
getTitle
()
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertDestinationPrice.py
View file @
8d9f0270
...
...
@@ -18,9 +18,12 @@ for line in line_list:
# redirect to previous page without doing the conversion
if
exchange_rate
is
None
:
return
context
.
Base_redirect
(
form_id
,
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
context
.
Base_translateString
(
'No exchange ratio found.'
)))
portal_status_message
=
context
.
Base_translateString
(
'No exchange ratio found.'
),
portal_status_level
=
'error'
,
))
# update the corresponding price and round it according to the precision of
# the converted currency
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/AccountingTransaction_convertSourcePrice.py
View file @
8d9f0270
...
...
@@ -20,10 +20,12 @@ for line in line_list:
start_date
=
line
.
getStartDate
()))
# redirect to previous page without doing the conversion
if
exchange_rate
is
None
:
return
context
.
Base_redirect
(
form_id
,
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
context
.
Base_translateString
(
'No exchange ratio found.'
)))
portal_status_message
=
context
.
Base_translateString
(
'No exchange ratio found.'
),
portal_status_level
=
'error'
,
))
# update the corresponding price and round it according to the precision of
# the converted currency
...
...
bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/Invoice_createRelatedPaymentTransaction.py
View file @
8d9f0270
...
...
@@ -37,7 +37,10 @@ if sum(total_payable_price_details.values()) == 0:
if
not
batch_mode
:
return
context
.
Base_redirect
(
form_id
,
keep_items
=
{
'portal_status_message'
:
Base_translateString
(
'Nothing more to pay.'
)})
keep_items
=
{
'portal_status_message'
:
Base_translateString
(
'Nothing more to pay.'
),
'portal_status_level'
:
'error'
})
return
None
related_payment
=
portal
.
accounting_module
.
newContent
(
...
...
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