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
Labels
Merge Requests
139
Merge Requests
139
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
66499d9e
Commit
66499d9e
authored
Oct 27, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trade: set portal_status_level in error case of dialog actions
parent
8d9f0270
Pipeline
#12008
passed with stage
in 0 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
18 deletions
+31
-18
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_checkConsistencyForDeliveryFastInputDialog.py
...de/Delivery_checkConsistencyForDeliveryFastInputDialog.py
+9
-3
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.py
...tal_skins/erp5_trade/InternalOrder_applyTradeCondition.py
+6
-5
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_printAsODSSummary.py
...teItem/portal_skins/erp5_trade/Order_printAsODSSummary.py
+4
-1
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseOrder_applyPurchaseTradeCondition.py
...s/erp5_trade/PurchaseOrder_applyPurchaseTradeCondition.py
+6
-4
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_applySaleTradeCondition.py
...tal_skins/erp5_trade/SaleOrder_applySaleTradeCondition.py
+6
-5
No files found.
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_checkConsistencyForDeliveryFastInputDialog.py
View file @
66499d9e
...
...
@@ -28,16 +28,22 @@ elif line_portal_type in portal.getPortalInternalTypeList() + portal.getPortalIn
else
:
from
Products.ERP5Type.Message
import
translateString
return
context
.
Base_redirect
(
'view'
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
'Type of document not known to retrieve section.'
)))
portal_status_message
=
translateString
(
'Type of document not known to retrieve section.'
),
portal_status_level
=
'error'
,
))
if
len
(
use_list
)
==
0
:
from
Products.ERP5Type.Message
import
translateString
return
context
.
Base_redirect
(
'view'
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
'Use preference must be defined.'
)))
portal_status_message
=
translateString
(
'Use preference must be defined.'
),
portal_status_level
=
'error'
,
))
if
section_uid
is
None
:
from
Products.ERP5Type.Message
import
translateString
return
context
.
Base_redirect
(
'view'
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
'Section must be defined.'
)))
portal_status_message
=
translateString
(
'Section must be defined.'
),
portal_status_level
=
'error'
,
))
return
context
.
Base_renderForm
(
'Delivery_viewDeliveryFastInputDialog'
,
*
args
,
**
kw
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/InternalOrder_applyTradeCondition.py
View file @
66499d9e
...
...
@@ -64,8 +64,10 @@ while count > 0 and len(trade_condition_list) == 0:
tested_base_category_list
=
tested_base_category_list
[:
count
],
sort_method
=
sort_method
)
if
len
(
trade_condition_list
)
==
0
:
message
=
Base_translateString
(
'No trade condition.'
)
keep_items
=
{}
if
len
(
trade_condition_list
)
==
0
:
keep_items
[
'portal_status_message'
]
=
Base_translateString
(
'No trade condition.'
)
keep_items
[
'portal_status_level'
]
=
'error'
else
:
# if more than one trade condition is found, simply apply the first one
trade_condition
=
trade_condition_list
[
0
].
getObject
()
...
...
@@ -75,8 +77,7 @@ else :
if
hasattr
(
order
,
'getReceivedDate'
)
and
order
.
getReceivedDate
()
is
None
:
context
.
setReceivedDate
(
DateTime
())
message
=
Base_translateString
(
'Order updated.'
)
keep_items
[
'portal_status_message'
]
=
Base_translateString
(
'Order updated.'
)
if
not
batch_mode
:
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
message
))
return
context
.
Base_redirect
(
form_id
,
keep_items
=
keep_items
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Order_printAsODSSummary.py
View file @
66499d9e
...
...
@@ -120,7 +120,10 @@ if error is None:
if
error
is
not
None
:
previous_skin_selection
=
container
.
REQUEST
.
get
(
'previous_skin_selection'
,
None
)
context
.
getPortalObject
().
changeSkin
(
previous_skin_selection
)
return
context
.
Base_redirect
(
'view'
,
keep_items
=
{
'portal_status_message'
:
context
.
Base_translateString
(
error
,
mapping
=
error_kw
)})
return
context
.
Base_redirect
(
'view'
,
keep_items
=
{
'portal_status_message'
:
context
.
Base_translateString
(
error
,
mapping
=
error_kw
),
'portal_status_level'
:
'error'
,
})
# Add a line for unit titles
for
source_trade
in
source_trade_dict
:
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/PurchaseOrder_applyPurchaseTradeCondition.py
View file @
66499d9e
...
...
@@ -55,16 +55,18 @@ while count > 0 and len(trade_condition_list) == 0:
tested_base_category_list
=
tested_base_category_list
[:
count
],
sort_method
=
sort_method
)
keep_items
=
{}
if
len
(
trade_condition_list
)
==
0
:
message
=
Base_translateString
(
'No trade condition.'
)
keep_items
[
'portal_status_message'
]
=
Base_translateString
(
'No trade condition.'
)
keep_items
[
'portal_status_level'
]
=
'error'
else
:
# if more than one trade condition is found, simply apply the first one
trade_condition
=
trade_condition_list
[
0
].
getObject
()
order
.
Order_applyTradeCondition
(
trade_condition
,
force
=
force
)
message
=
Base_translateString
(
'Order updated.'
)
keep_items
[
'portal_status_message'
]
=
Base_translateString
(
'Order updated.'
)
if
not
batch_mode
:
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
message
))
return
context
.
Base_redirect
(
form_id
,
keep_items
=
keep_items
)
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/SaleOrder_applySaleTradeCondition.py
View file @
66499d9e
...
...
@@ -55,8 +55,10 @@ while count > 0 and len(trade_condition_list) == 0:
tested_base_category_list
=
tested_base_category_list
[:
count
],
sort_method
=
sort_method
)
if
len
(
trade_condition_list
)
==
0
:
message
=
Base_translateString
(
'No trade condition.'
)
keep_items
=
{}
if
len
(
trade_condition_list
)
==
0
:
keep_items
[
'portal_status_message'
]
=
Base_translateString
(
'No trade condition.'
)
keep_items
[
'portal_status_level'
]
=
'error'
else
:
# if more than one trade condition is found, simply apply the first one
trade_condition
=
trade_condition_list
[
0
].
getObject
()
...
...
@@ -66,8 +68,7 @@ else :
if
hasattr
(
order
,
'getReceivedDate'
)
and
order
.
getReceivedDate
()
is
None
:
context
.
setReceivedDate
(
DateTime
())
message
=
Base_translateString
(
'Order updated.'
)
keep_items
[
'portal_status_message'
]
=
Base_translateString
(
'Order updated.'
)
if
not
batch_mode
:
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
message
))
return
context
.
Base_redirect
(
form_id
,
keep_items
=
keep_items
)
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