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
142
Merge Requests
142
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
672224e5
Commit
672224e5
authored
Oct 04, 2022
by
Kazuhiko Shiozaki
Committed by
Jérome Perrin
Aug 21, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! py2/py3: stop using deprecated string functions, that are removed in python 3.
parent
d0c86acf
Changes
23
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
33 additions
and
59 deletions
+33
-59
bt5/erp5_barcode/ExtensionTemplateItem/portal_components/extension.erp5.Barcode.py
...nTemplateItem/portal_components/extension.erp5.Barcode.py
+2
-3
bt5/erp5_barcode/SkinTemplateItem/portal_skins/erp5_barcode/BarcodeModule_getLastGeneratedId.py
...al_skins/erp5_barcode/BarcodeModule_getLastGeneratedId.py
+1
-2
bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_hashVariationCategoryList.py
...skins/erp5_budget/BudgetLine_hashVariationCategoryList.py
+2
-2
bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/Budget_hashVariationCategoryList.py
...tal_skins/erp5_budget/Budget_hashVariationCategoryList.py
+2
-2
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/FastInput_generateObjectStructure.py
...kins/erp5_consulting/FastInput_generateObjectStructure.py
+0
-2
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/FastInput_generateTwoLevelObjectStructure.py
...5_consulting/FastInput_generateTwoLevelObjectStructure.py
+1
-3
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/FastInput_initialize.py
...Item/portal_skins/erp5_consulting/FastInput_initialize.py
+1
-2
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/UseCase_generateUseCaseScenarioList.py
...ns/erp5_consulting/UseCase_generateUseCaseScenarioList.py
+0
-2
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.AmortisationRule.py
...eItem/portal_components/document.erp5.AmortisationRule.py
+2
-3
bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationSystem_addAmortisationMethod.py
...mmobilisation/AmortisationSystem_addAmortisationMethod.py
+2
-5
bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/PortalType_ImmobilisationMovement_addAmortisationMethodActions.py
...pe_ImmobilisationMovement_addAmortisationMethodActions.py
+2
-4
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getReportFailedResultList.py
...l_skins/erp5_ooo_import/Base_getReportFailedResultList.py
+2
-3
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getReportResultList.py
.../portal_skins/erp5_ooo_import/Base_getReportResultList.py
+2
-3
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getSpreadsheetColumnNameList.py
...kins/erp5_ooo_import/Base_getSpreadsheetColumnNameList.py
+2
-3
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Amount_hashVariationCategoryItemList.py
...al_skins/erp5_pdm/Amount_hashVariationCategoryItemList.py
+2
-2
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/TransformedResource_hashVariationCategoryItemList.py
..._pdm/TransformedResource_hashVariationCategoryItemList.py
+2
-2
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_initializeFastInput.py
.../portal_skins/erp5_project/Project_initializeFastInput.py
+1
-2
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project_trade/Delivery_updateTaskFastInputDialog.py
.../erp5_project_trade/Delivery_updateTaskFastInputDialog.py
+1
-2
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/DeliveryLine_hashVariationCategoryItemList.py
.../erp5_trade/DeliveryLine_hashVariationCategoryItemList.py
+2
-2
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getDivergenceMessageList.py
...tal_skins/erp5_trade/Delivery_getDivergenceMessageList.py
+1
-3
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisableItem.py
...Item/portal_components/document.erp5.ImmobilisableItem.py
+1
-2
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationMovement.py
...portal_components/document.erp5.ImmobilisationMovement.py
+1
-3
product/ZMySQLDA/db.py
product/ZMySQLDA/db.py
+1
-2
No files found.
bt5/erp5_barcode/ExtensionTemplateItem/portal_components/extension.erp5.Barcode.py
View file @
672224e5
...
...
@@ -26,7 +26,6 @@
##############################################################################
import
os
from
string
import
zfill
from
urllib
import
urlencode
import
tempfile
from
DateTime
import
DateTime
...
...
@@ -82,14 +81,14 @@ def printBarcodeSheet(self, sheet_number=1, input_list=[], test=False):
tempfile
.
tempdir
=
tempdir
if
test
:
#Fake list
input_list
=
os
.
linesep
.
join
([
'TEST%s'
%
zfill
(
b
,
8
)
for
b
in
range
(
1111111
,
1111111
+
(
row_number
*
column_number
*
sheet_number
))])
input_list
=
os
.
linesep
.
join
([
'TEST%s'
%
str
(
b
).
zfill
(
8
)
for
b
in
range
(
1111111
,
1111111
+
(
row_number
*
column_number
*
sheet_number
))])
elif
input_list
not
in
(
''
,
None
):
if
not
isinstance
(
input_list
,
list
):
input_list
=
os
.
linesep
.
join
(
map
(
escapeString
,
input_list
.
split
(
os
.
linesep
)))
else
:
input_list
=
os
.
linesep
.
join
(
input_list
)
else
:
input_list
=
os
.
linesep
.
join
([
'%s'
%
zfill
(
self
.
portal_ids
.
generateNewId
(
id_group
=
'barcode'
),
12
)
for
b
in
range
(
row_number
*
column_number
*
sheet_number
)])
input_list
=
os
.
linesep
.
join
([
'%s'
%
str
(
self
.
portal_ids
.
generateNewId
(
id_group
=
'barcode'
)).
zfill
(
12
)
for
b
in
range
(
row_number
*
column_number
*
sheet_number
)])
text_command
=
'echo "%s" > %s'
%
(
input_list
,
new_txt_file_path
)
ret
=
os
.
system
(
text_command
)
if
ret
!=
0
:
...
...
bt5/erp5_barcode/SkinTemplateItem/portal_skins/erp5_barcode/BarcodeModule_getLastGeneratedId.py
View file @
672224e5
from
string
import
zfill
return
zfill
(
context
.
portal_ids
.
getLastGeneratedId
(
id_group
=
'barcode'
),
12
)
return
str
(
context
.
portal_ids
.
getLastGeneratedId
(
id_group
=
'barcode'
)).
zfill
(
12
)
bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/BudgetLine_hashVariationCategoryList.py
View file @
672224e5
...
...
@@ -35,8 +35,8 @@ for item in item_list:
item_value
=
item
[
int
(
not
is_right_display
)]
# Hash key from item_value
item_split
=
string
.
split
(
item_value
,
'/'
)
item_key
=
string
.
join
(
item_split
[:
split_depth
]
,
'/'
)
item_split
=
item_value
.
split
(
'/'
)
item_key
=
'/'
.
join
(
item_split
[:
split_depth
]
)
base_category
=
item_split
[
0
]
multi
=
True
...
...
bt5/erp5_budget/SkinTemplateItem/portal_skins/erp5_budget/Budget_hashVariationCategoryList.py
View file @
672224e5
...
...
@@ -30,8 +30,8 @@ for item in item_list:
item_value
=
item
[
int
(
not
is_right_display
)]
# Hash key from item_value
item_split
=
string
.
split
(
item_value
,
'/'
)
item_key
=
string
.
join
(
item_split
[:
split_depth
]
,
'/'
)
item_split
=
item_value
.
split
(
'/'
)
item_key
=
'/'
.
join
(
item_split
[:
split_depth
]
)
base_category
=
item_split
[
0
]
multi
=
False
# XXX or now budget level are only single value.
...
...
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/FastInput_generateObjectStructure.py
View file @
672224e5
from
string
import
zfill
##################################################
#### About the transformation_rules structure ####
# a key indicate that input of that level having the same value must be grouped together
...
...
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/FastInput_generateTwoLevelObjectStructure.py
View file @
672224e5
from
string
import
zfill
##################################################
#### About the transformation_rules structure ####
# a key indicate that input of that level having the same value must be grouped together
...
...
@@ -92,7 +90,7 @@ for upper_level_key in structured_input_data:
for
second_level
in
structured_input_data
[
upper_level_key
][
1
]:
second_level_id
+=
10
new_2nd_level_obj
=
new_1st_level_obj
.
newContent
(
portal_type
=
level_portal_types
[
1
]
,
id
=
zfill
(
second_level_id
,
4
)
,
id
=
str
(
second_level_id
).
zfill
(
4
)
)
for
property_title
in
second_level
.
keys
():
new_2nd_level_obj
.
setProperty
(
property_title
,
second_level
[
property_title
])
...
...
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/FastInput_initialize.py
View file @
672224e5
from
Products.ERP5Type.Document
import
newTempBase
from
string
import
zfill
global
portal_object
,
new_id
,
l
...
...
@@ -14,7 +13,7 @@ def createInputLine():
int_len
=
3
o
=
newTempBase
(
portal_object
,
str
(
new_id
)
,
uid
=
'new_%s'
%
zfill
(
new_id
,
int_len
)
,
uid
=
'new_%s'
%
str
(
new_id
).
zfill
(
int_len
)
)
l
.
append
(
o
)
...
...
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/UseCase_generateUseCaseScenarioList.py
View file @
672224e5
from
string
import
zfill
destination_obj
=
context
.
getObject
()
first_level_type
=
'Use Case Scenario'
...
...
bt5/erp5_immobilisation/DocumentTemplateItem/portal_components/document.erp5.AmortisationRule.py
View file @
672224e5
...
...
@@ -28,7 +28,6 @@
from
AccessControl
import
ClassSecurityInfo
from
DateTime
import
DateTime
from
string
import
capitalize
from
erp5.component.module.DateUtils
import
centis
,
getClosestDate
,
addToDate
from
erp5.component.module.DateUtils
import
getDecimalNumberOfYearsBetween
...
...
@@ -99,7 +98,7 @@ class AmortisationRule(RuleMixin):
modified_properties
=
[]
for
(
key
,
value
)
in
calculated_movement
.
items
():
if
key
not
in
(
'name'
,
'status'
,
'id'
,
'divergent'
):
getter_name
=
'get%s'
%
''
.
join
([
capitalize
(
o
)
for
o
in
key
.
split
(
'_'
)])
getter_name
=
'get%s'
%
''
.
join
([
o
.
capitalize
(
)
for
o
in
key
.
split
(
'_'
)])
getter
=
getattr
(
simulation_movement
,
getter_name
)
previous_value
=
getter
()
# Check if this property changes
...
...
@@ -109,7 +108,7 @@ class AmortisationRule(RuleMixin):
if
value
is
None
and
key
.
split
(
'_'
)[
-
1
]
==
'value'
:
key
=
'_'
.
join
(
key
.
split
(
'_'
)[:
-
1
])
setter_name
=
'set%s'
%
''
.
join
([
capitalize
(
o
)
for
o
in
key
.
split
(
'_'
)])
setter_name
=
'set%s'
%
''
.
join
([
o
.
capitalize
(
)
for
o
in
key
.
split
(
'_'
)])
setter
=
getattr
(
simulation_movement
,
setter_name
)
setter
(
value
)
simulation_movement
.
edit
(
start_date
=
simulation_movement
.
getStopDate
())
...
...
bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/AmortisationSystem_addAmortisationMethod.py
View file @
672224e5
...
...
@@ -5,9 +5,6 @@
# This script adds the needed actions in the Immobilisation portal_type, and
# each amortisable portal_type
from
string
import
capitalize
def
addAction
(
portal_type
,
portal_type_type
,
country
,
amortisation_method
):
print
'Adding UI tab "Amortisation Details" for method %s on portal_type %s... '
%
(
amortisation_method
,
portal_type
),
id
=
"%s_%s_amortisation_details_view"
%
(
country
,
amortisation_method
)
...
...
@@ -22,8 +19,8 @@ def addAction(portal_type, portal_type_type, country, amortisation_method):
name
=
"Amortisation Details"
,
action
=
action
,
condition
=
"object/IsUsing%s%sAmortisationMethod"
%
(
c
apitalize
(
country
),
""
.
join
([
capitalize
(
x
)
for
x
in
amortisation_method
.
split
(
'_'
)])
),
c
ountry
.
capitalize
(
),
""
.
join
([
x
.
capitalize
(
)
for
x
in
amortisation_method
.
split
(
'_'
)])
),
permission
=
(
'View'
,),
category
=
"object_view"
,
visible
=
1
)
...
...
bt5/erp5_immobilisation/SkinTemplateItem/portal_skins/erp5_immobilisation/PortalType_ImmobilisationMovement_addAmortisationMethodActions.py
View file @
672224e5
from
string
import
capitalize
view_id_basis
=
"%s_%s_amortisation_method_view_details"
view_action_basis
=
"Immobilisation_%s%sAmortisationMethodViewDetails"
view_condition_basis
=
"object/Immobilisation_isUsing%s%sAmortisationMethod"
...
...
@@ -27,9 +25,9 @@ for method in amortisation_method_list:
exists
=
1
if
not
exists
:
capitalized_id
=
""
.
join
([
capitalize
(
o
)
for
o
in
id
.
split
(
"_"
)])
capitalized_id
=
""
.
join
([
o
.
capitalize
(
)
for
o
in
id
.
split
(
"_"
)])
action_action
=
view_action_basis
%
(
region
,
capitalized_id
)
action_condition
=
view_condition_basis
%
(
capitalize
(
region
),
capitalized_id
)
action_condition
=
view_condition_basis
%
(
region
.
capitalize
(),
capitalized_id
)
context
.
addAction
(
id
=
action_id
,
name
=
"Amortisation Details"
,
action
=
action_action
,
...
...
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getReportFailedResultList.py
View file @
672224e5
from
Products.ERP5Type.Document
import
newTempBase
from
string
import
zfill
portal_object
=
context
.
getPortalObject
()
num
=
0
...
...
@@ -20,8 +19,8 @@ for [method_id, result] in result_list:
int_len
=
7
if
not
result
[
'success'
]:
o
=
newTempBase
(
portal_object
,
safe_id
)
o
.
setUid
(
'new_%s'
%
zfill
(
num
,
int_len
))
# XXX There is a security issue here
o
.
edit
(
uid
=
'new_%s'
%
zfill
(
num
,
int_len
))
# XXX There is a security issue here
o
.
setUid
(
'new_%s'
%
str
(
num
).
zfill
(
int_len
))
# XXX There is a security issue here
o
.
edit
(
uid
=
'new_%s'
%
str
(
num
).
zfill
(
int_len
))
# XXX There is a security issue here
o
.
edit
(
**
result
[
'object'
])
result_listbox
.
append
(
o
)
...
...
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getReportResultList.py
View file @
672224e5
from
Products.ERP5Type.Document
import
newTempBase
from
string
import
zfill
portal_object
=
context
.
getPortalObject
()
num
=
0
...
...
@@ -25,8 +24,8 @@ for [method_id, result] in result_list:
num
+=
1
int_len
=
3
o
=
newTempBase
(
portal_object
,
safe_id
)
o
.
setUid
(
'new_%s'
%
zfill
(
num
,
int_len
))
# XXX There is a security issue here
o
.
edit
(
uid
=
'new_%s'
%
zfill
(
num
,
int_len
))
# XXX There is a security issue here
o
.
setUid
(
'new_%s'
%
str
(
num
).
zfill
(
int_len
))
# XXX There is a security issue here
o
.
edit
(
uid
=
'new_%s'
%
str
(
num
).
zfill
(
int_len
))
# XXX There is a security issue here
o
.
edit
(
method_id
=
method_id
,
result
=
result
[
'message'
]
,
object_url
=
result
[
'object_url'
]
...
...
bt5/erp5_ooo_import/SkinTemplateItem/portal_skins/erp5_ooo_import/Base_getSpreadsheetColumnNameList.py
View file @
672224e5
from
Products.ERP5Type.Document
import
newTempBase
from
string
import
zfill
num
=
0
listbox_lines
=
[]
...
...
@@ -23,8 +22,8 @@ for spreadsheet in spreadsheets.keys():
# int_len is used to fill the uid of the created object like 0000001
int_len
=
7
o
=
newTempBase
(
context
,
safe_id
)
o
.
setUid
(
'new_%s'
%
zfill
(
num
,
int_len
))
# XXX There is a security issue here
o
.
edit
(
uid
=
'new_%s'
%
zfill
(
num
,
int_len
))
# XXX There is a security issue here
o
.
setUid
(
'new_%s'
%
str
(
num
).
zfill
(
int_len
))
# XXX There is a security issue here
o
.
edit
(
uid
=
'new_%s'
%
str
(
num
).
zfill
(
int_len
))
# XXX There is a security issue here
o
.
edit
(
id
=
safe_id
,
spreadsheet_name
=
spreadsheet
,
...
...
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/Amount_hashVariationCategoryItemList.py
View file @
672224e5
...
...
@@ -11,8 +11,8 @@ for item in item_list:
item_value
=
item
[
int
(
not
is_right_display
)]
# Hash key from item_value
item_split
=
string
.
split
(
item_value
,
'/'
)
item_key
=
string
.
join
(
item_split
[:
split_depth
]
,
'/'
)
item_split
=
item_value
.
split
(
'/'
)
item_key
=
'/'
.
join
(
item_split
[:
split_depth
]
)
base_category
=
item_split
[
0
]
if
item_key
not
in
sub_field_dict
:
# Create property dict
...
...
bt5/erp5_pdm/SkinTemplateItem/portal_skins/erp5_pdm/TransformedResource_hashVariationCategoryItemList.py
View file @
672224e5
...
...
@@ -11,8 +11,8 @@ for item in item_list:
item_value
=
item
[
int
(
not
is_right_display
)]
# Hash key from item_value
item_split
=
string
.
split
(
item_value
,
'/'
)
item_key
=
string
.
join
(
item_split
[:
split_depth
]
,
'/'
)
item_split
=
item_value
.
split
(
'/'
)
item_key
=
'/'
.
join
(
item_split
[:
split_depth
]
)
if
item_key
not
in
sub_field_dict
:
# Create property dict
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_initializeFastInput.py
View file @
672224e5
from
Products.ERP5Type.Document
import
newTempBase
from
string
import
zfill
portal_object
=
context
.
getPortalObject
()
...
...
@@ -15,7 +14,7 @@ def createInputLine(new_id):
int_len
=
3
o
=
newTempBase
(
portal_object
,
str
(
new_id
),
uid
=
'new_%s'
%
zfill
(
new_id
,
int_len
)
uid
=
'new_%s'
%
str
(
new_id
).
zfill
(
int_len
)
)
l
.
append
(
o
)
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project_trade/Delivery_updateTaskFastInputDialog.py
View file @
672224e5
...
...
@@ -5,7 +5,6 @@ information is correct.
portal
=
context
.
getPortalObject
()
line_portal_type
=
"Sale Order Line"
request
=
context
.
REQUEST
from
string
import
zfill
from
Products.PythonScripts.standard
import
Object
from
Products.ERP5Type.Message
import
translateString
...
...
@@ -31,7 +30,7 @@ i = 1
project_search_dict
=
{}
for
line
in
line_list
:
line_dict
=
{}
key
=
zfill
(
i
,
3
)
key
=
str
(
i
).
zfill
(
3
)
for
property_name
in
(
'title'
,
'quantity_unit_title'
,
'quantity'
,
'resource_title'
,
'total_price'
,
'price'
,
'reference'
,
'relative_url'
):
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/DeliveryLine_hashVariationCategoryItemList.py
View file @
672224e5
...
...
@@ -17,8 +17,8 @@ for item in item_list:
# Get value of the item
item_value
=
item
[
int
(
not
is_right_display
)]
# Hash key from item_value
item_split
=
string
.
split
(
item_value
,
'/'
)
item_key
=
string
.
join
(
item_split
[:
split_depth
]
,
'/'
)
item_split
=
item_value
.
split
(
'/'
)
item_key
=
'/'
.
join
(
item_split
[:
split_depth
]
)
base_category
=
item_split
[
0
]
sub_field_property_dict
=
sub_field_dict
.
setdefault
(
item_key
,
default_sub_field_property_dict
.
copy
())
...
...
bt5/erp5_trade/SkinTemplateItem/portal_skins/erp5_trade/Delivery_getDivergenceMessageList.py
View file @
672224e5
divergence_messages_list
=
context
.
getDivergenceList
()
from
Products.ERP5Type.Document
import
newTempBase
from
string
import
zfill
portal_object
=
context
.
getPortalObject
()
l
=
[]
...
...
@@ -13,7 +11,7 @@ def createInputLine(d_message, new_id):
o
=
newTempBase
(
portal_object
,
str
(
new_id
)
,
uid
=
'new_%s'
%
zfill
(
new_id
,
int_len
)
,
uid
=
'new_%s'
%
str
(
new_id
).
zfill
(
int_len
)
,
message
=
str
(
d_message
.
getTranslatedMessage
())
,
tested_property_id
=
d_message
.
getProperty
(
'tested_property'
)
,
object_title
=
d_message
.
getObject
().
getTranslatedTitle
()
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisableItem.py
View file @
672224e5
...
...
@@ -32,7 +32,6 @@ import zope.interface
from
AccessControl
import
ClassSecurityInfo
from
DateTime
import
DateTime
from
string
import
capitalize
from
Products.ERP5Type
import
Permissions
,
PropertySheet
from
erp5.component.interface.IImmobilisationItem
import
IImmobilisationItem
...
...
@@ -469,7 +468,7 @@ class ImmobilisableItem(Item, Amount):
property_list
.
extend
(
movement
.
getUncontinuousNeededSpecificParameterListForItem
(
self
))
property_list
.
extend
(
movement
.
getFacultativeSpecificParameterListForItem
(
self
))
for
key
,
value
,
_
in
property_list
:
value
=
'get'
+
''
.
join
(
map
(
capitalize
,
value
.
split
(
'_'
)
))
value
=
'get'
+
''
.
join
(
e
.
capitalize
()
for
e
in
value
.
split
(
'_'
))
value
=
getattr
(
movement
,
value
,
None
)
if
value
is
not
None
:
value
=
value
()
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.ImmobilisationMovement.py
View file @
672224e5
...
...
@@ -33,8 +33,6 @@ from Products.ERP5Type import Permissions, PropertySheet
from
Products.ERP5Type.XMLObject
import
XMLObject
from
erp5.component.document.Movement
import
Movement
from
string
import
capitalize
UNIMMOBILISING_METHOD
=
"unimmobilise"
NO_CHANGE_METHOD
=
"no_change"
AMORTISATION_METHOD_PREFIX
=
"portal_skins/erp5_accounting_"
...
...
@@ -103,7 +101,7 @@ class ImmobilisationMovement(Movement, XMLObject):
def
checkValuesAreNotNone
(
property_list
):
errors
=
[]
for
key
,
value
,
name
in
property_list
:
value
=
'get'
+
''
.
join
(
map
(
capitalize
,
value
.
split
(
'_'
)
))
value
=
'get'
+
''
.
join
(
capitalize
(
e
)
for
e
in
value
.
split
(
'_'
))
value
=
getattr
(
self
,
value
,
None
)
if
value
is
not
None
:
value
=
value
()
...
...
product/ZMySQLDA/db.py
View file @
672224e5
...
...
@@ -354,7 +354,6 @@ class DB(TM):
c
=
self
.
_query
(
'SHOW COLUMNS FROM %s'
%
table_name
)
except
Exception
:
return
()
from
string
import
join
r
=
[]
for
Field
,
Type
,
Null
,
Key
,
Default
,
Extra
in
c
.
fetch_row
(
0
):
info
=
{}
...
...
@@ -378,7 +377,7 @@ class DB(TM):
info
[
'Name'
]
=
Field
info
[
'Type'
]
=
type_xlate
.
get
(
short_type
,
'string'
)
info
[
'Extra'
]
=
Extra
,
info
[
'Description'
]
=
join
([
Type
,
field_default
,
Extra
or
''
,
info
[
'Description'
]
=
' '
.
join
([
Type
,
field_default
,
Extra
or
''
,
key_types
.
get
(
Key
,
Key
or
''
),
Null
!=
'YES'
and
'NOT NULL'
or
''
]),
info
[
'Nullable'
]
=
Null
==
'YES'
...
...
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