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
...
@@ -22,8 +22,11 @@ portal.portal_selections.setSelectionParamsFor('accounting_create_related_paymen
if
len
(
object_list
)
>=
1000
:
if
len
(
object_list
)
>=
1000
:
return
context
.
Base_redirect
(
return
context
.
Base_redirect
(
form_id
,
form_id
,
keep_items
=
{
'portal_status_message'
:
translateString
(
keep_items
=
{
'Refusing to process more than 1000 objects, check your selection.'
)})
'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
)
tag
=
'payment_creation_%s'
%
random
.
randint
(
0
,
1000
)
activated
=
0
activated
=
0
...
@@ -35,8 +38,10 @@ for obj in object_list:
...
@@ -35,8 +38,10 @@ for obj in object_list:
return
context
.
Base_redirect
(
return
context
.
Base_redirect
(
form_id
,
form_id
,
abort_transaction
=
True
,
abort_transaction
=
True
,
keep_items
=
{
'portal_status_message'
:
translateString
(
keep_items
=
{
'Payment creation already in progress, abandon.'
)})
'portal_status_message'
:
translateString
(
'Payment creation already in progress, abandon.'
),
'portal_status_level'
:
'error'
,
})
obj
.
activate
(
tag
=
tag
).
Invoice_createRelatedPaymentTransaction
(
obj
.
activate
(
tag
=
tag
).
Invoice_createRelatedPaymentTransaction
(
node
=
node
,
node
=
node
,
payment_mode
=
payment_mode
,
payment_mode
=
payment_mode
,
...
@@ -47,8 +52,10 @@ for obj in object_list:
...
@@ -47,8 +52,10 @@ for obj in object_list:
if
not
activated
:
if
not
activated
:
return
context
.
Base_redirect
(
return
context
.
Base_redirect
(
form_id
,
form_id
,
keep_items
=
{
'portal_status_message'
:
translateString
(
keep_items
=
{
'No invoice in your selection.'
)})
'portal_status_message'
:
translateString
(
'No invoice in your selection.'
),
'portal_status_level'
:
'error'
,
})
# activate something on the folder
# activate something on the folder
context
.
activate
(
after_tag
=
tag
).
getTitle
()
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:
...
@@ -13,9 +13,10 @@ else:
# XXX prevent to call this on the whole module:
# XXX prevent to call this on the whole module:
if
len
(
object_list
)
>=
1000
:
if
len
(
object_list
)
>=
1000
:
return
context
.
Base_redirect
(
form_id
,
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
keep_items
=
dict
(
translateString
(
portal_status_message
=
translateString
(
'Refusing to process more than 1000 objects, check your selection.'
),
'Refusing to process more than 1000 objects, check your selection.'
)))
portal_status_level
=
'error'
,
))
tag
=
'reversal_creation_%s'
%
random
.
randint
(
0
,
1000
)
tag
=
'reversal_creation_%s'
%
random
.
randint
(
0
,
1000
)
activated
=
0
activated
=
0
...
@@ -36,9 +37,12 @@ for obj in object_list:
...
@@ -36,9 +37,12 @@ for obj in object_list:
activated
+=
1
activated
+=
1
if
not
activated
:
if
not
activated
:
return
context
.
Base_redirect
(
form_id
,
return
context
.
Base_redirect
(
keep_items
=
dict
(
portal_status_message
=
form_id
,
translateString
(
'No valid transaction in your selection.'
)))
keep_items
=
dict
(
portal_status_message
=
translateString
(
'No valid transaction in your selection.'
),
portal_status_level
=
'error'
,
))
# activate something on the folder
# activate something on the folder
context
.
activate
(
after_tag
=
tag
).
getTitle
()
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:
...
@@ -18,9 +18,12 @@ for line in line_list:
# redirect to previous page without doing the conversion
# redirect to previous page without doing the conversion
if
exchange_rate
is
None
:
if
exchange_rate
is
None
:
return
context
.
Base_redirect
(
form_id
,
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
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
# update the corresponding price and round it according to the precision of
# the converted currency
# 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:
...
@@ -20,10 +20,12 @@ for line in line_list:
start_date
=
line
.
getStartDate
()))
start_date
=
line
.
getStartDate
()))
# redirect to previous page without doing the conversion
# redirect to previous page without doing the conversion
if
exchange_rate
is
None
:
if
exchange_rate
is
None
:
return
context
.
Base_redirect
(
form_id
,
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
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
# update the corresponding price and round it according to the precision of
# the converted currency
# 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:
...
@@ -37,7 +37,10 @@ if sum(total_payable_price_details.values()) == 0:
if
not
batch_mode
:
if
not
batch_mode
:
return
context
.
Base_redirect
(
return
context
.
Base_redirect
(
form_id
,
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
return
None
related_payment
=
portal
.
accounting_module
.
newContent
(
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