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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
d4e96b43
Commit
d4e96b43
authored
Apr 06, 2021
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop using getParent deprecated accessor
parent
61dd90e0
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
30 additions
and
30 deletions
+30
-30
bt5/erp5_accounting_l10n_pl/SkinTemplateItem/portal_skins/erp5_accounting_l10n_pl/FiscalReportCell_getWojewodztwo.py
...rp5_accounting_l10n_pl/FiscalReportCell_getWojewodztwo.py
+1
-1
bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelModel_asCellRange.py
...tem/portal_skins/erp5_apparel/ApparelModel_asCellRange.py
+1
-1
bt5/erp5_configurator_run_my_doc/SkinTemplateItem/portal_skins/erp5_configurator_run_my_doc/BusinessConfiguration_setupRunMyDocPreferences.py
..._my_doc/BusinessConfiguration_setupRunMyDocPreferences.py
+1
-1
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/ERP5Consulting_getActorItemList.py
..._skins/erp5_consulting/ERP5Consulting_getActorItemList.py
+1
-1
bt5/erp5_tiosafe_core/ModuleComponentTemplateItem/portal_components/module.erp5.ERP5PaymentTransactionConduit.py
...l_components/module.erp5.ERP5PaymentTransactionConduit.py
+1
-1
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/CategoryMapping_getCategoryList.py
...skins/erp5_integration/CategoryMapping_getCategoryList.py
+4
-4
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/CategoryMapping_getIndentedCategoryTitle.py
...5_integration/CategoryMapping_getIndentedCategoryTitle.py
+3
-3
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/IntegrationSite_getFastInputCategoryMappingLineList.py
...on/IntegrationSite_getFastInputCategoryMappingLineList.py
+1
-1
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/IntegrationSite_setCategoryMappingLineList.py
...integration/IntegrationSite_setCategoryMappingLineList.py
+3
-3
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/IntegrationSite_updateCategoryMappingLineList.py
...egration/IntegrationSite_updateCategoryMappingLineList.py
+12
-12
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testPackingList.py
...mplateItem/portal_components/test.erp5.testPackingList.py
+2
-2
No files found.
bt5/erp5_accounting_l10n_pl/SkinTemplateItem/portal_skins/erp5_accounting_l10n_pl/FiscalReportCell_getWojewodztwo.py
View file @
d4e96b43
org
=
context
.
restrictedTraverse
(
context
.
REQUEST
.
organisation
)
org
=
context
.
restrictedTraverse
(
context
.
REQUEST
.
organisation
)
adr
=
org
.
getAddress
()
adr
=
org
.
getAddress
()
woj
=
adr
.
getRegionValue
()
woj
=
adr
.
getRegionValue
()
kraj
=
woj
.
getParent
()
kraj
=
woj
.
getParent
Value
()
return
woj
.
getTitle
(),
kraj
.
getTitle
()
return
woj
.
getTitle
(),
kraj
.
getTitle
()
bt5/erp5_apparel/SkinTemplateItem/portal_skins/erp5_apparel/ApparelModel_asCellRange.py
View file @
d4e96b43
...
@@ -2,7 +2,7 @@ cell_range = []
...
@@ -2,7 +2,7 @@ cell_range = []
# Those value are define on property sheet of portal type
# Those value are define on property sheet of portal type
resource
=
context
.
getDefaultResourceValue
()
resource
=
context
.
getDefaultResourceValue
()
if
resource
is
None
:
# When we have a supply line in the resource
if
resource
is
None
:
# When we have a supply line in the resource
resource
=
context
.
getParent
()
resource
=
context
.
getParent
Value
()
base_category_list
=
resource
.
getVariationBaseCategoryList
()
base_category_list
=
resource
.
getVariationBaseCategoryList
()
...
...
bt5/erp5_configurator_run_my_doc/SkinTemplateItem/portal_skins/erp5_configurator_run_my_doc/BusinessConfiguration_setupRunMyDocPreferences.py
View file @
d4e96b43
...
@@ -7,7 +7,7 @@ default_available_language = kw.get('default_available_language', 'en')
...
@@ -7,7 +7,7 @@ default_available_language = kw.get('default_available_language', 'en')
context
.
setGlobalConfigurationAttr
(
default_available_language
=
default_available_language
)
context
.
setGlobalConfigurationAttr
(
default_available_language
=
default_available_language
)
configuration_save
=
context
.
restrictedTraverse
(
configuration_save_url
)
configuration_save
=
context
.
restrictedTraverse
(
configuration_save_url
)
business_configuration
=
configuration_save
.
getParent
()
business_configuration
=
configuration_save
.
getParent
Value
()
# if preferred email is not specified used previously saved company email.
# if preferred email is not specified used previously saved company email.
company_email
=
context
.
getGlobalConfigurationAttr
(
'company_email'
)
company_email
=
context
.
getGlobalConfigurationAttr
(
'company_email'
)
...
...
bt5/erp5_consulting/SkinTemplateItem/portal_skins/erp5_consulting/ERP5Consulting_getActorItemList.py
View file @
d4e96b43
...
@@ -19,7 +19,7 @@ if item_portal_type[0] is not None:
...
@@ -19,7 +19,7 @@ if item_portal_type[0] is not None:
while
context_obj
is
not
None
\
while
context_obj
is
not
None
\
and
hasattr
(
context_obj
,
'getPortalType'
)
\
and
hasattr
(
context_obj
,
'getPortalType'
)
\
and
context_obj
.
getPortalType
()
!=
item_portal_type
[
1
]:
and
context_obj
.
getPortalType
()
!=
item_portal_type
[
1
]:
context_obj
=
context_obj
.
getParent
()
context_obj
=
context_obj
.
getParent
Value
()
if
context_obj
is
not
None
\
if
context_obj
is
not
None
\
and
hasattr
(
context_obj
,
'getPortalType'
)
\
and
hasattr
(
context_obj
,
'getPortalType'
)
\
and
context_obj
.
getPortalType
()
==
item_portal_type
[
1
]:
and
context_obj
.
getPortalType
()
==
item_portal_type
[
1
]:
...
...
bt5/erp5_tiosafe_core/ModuleComponentTemplateItem/portal_components/module.erp5.ERP5PaymentTransactionConduit.py
View file @
d4e96b43
...
@@ -127,7 +127,7 @@ class ERP5PaymentTransactionConduit(TioSafeBaseConduit):
...
@@ -127,7 +127,7 @@ class ERP5PaymentTransactionConduit(TioSafeBaseConduit):
sub_object
.
setPriceCurrencyValue
(
link_object
)
sub_object
.
setPriceCurrencyValue
(
link_object
)
bank_account_object
=
integration_site
.
getDefaultSourcePaymentValue
()
bank_account_object
=
integration_site
.
getDefaultSourcePaymentValue
()
sub_object
.
setDefaultSourcePaymentValue
(
bank_account_object
)
sub_object
.
setDefaultSourcePaymentValue
(
bank_account_object
)
sub_object
.
setSourceSectionValue
(
bank_account_object
.
getParent
())
sub_object
.
setSourceSectionValue
(
bank_account_object
.
getParent
Value
())
# Mapping between tag and element
# Mapping between tag and element
node_dict
=
{
node_dict
=
{
...
...
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/CategoryMapping_getCategoryList.py
View file @
d4e96b43
...
@@ -13,7 +13,7 @@ def getERP5CategoryUrl(category):
...
@@ -13,7 +13,7 @@ def getERP5CategoryUrl(category):
if
category
.
getPortalType
()
==
"Base Category"
:
if
category
.
getPortalType
()
==
"Base Category"
:
return
category
.
getTitle
()
return
category
.
getTitle
()
else
:
else
:
return
"%s/%s"
%
(
getERP5CategoryUrl
(
category
.
getParent
()),
category
.
getTitle
())
return
"%s/%s"
%
(
getERP5CategoryUrl
(
category
.
getParent
Value
()),
category
.
getTitle
())
def
isUrlInTupleList
(
tuple_list
,
url
):
def
isUrlInTupleList
(
tuple_list
,
url
):
for
(
k
,
v
)
in
tuple_list
:
for
(
k
,
v
)
in
tuple_list
:
...
@@ -23,14 +23,14 @@ def isUrlInTupleList(tuple_list, url):
...
@@ -23,14 +23,14 @@ def isUrlInTupleList(tuple_list, url):
if
context
.
getPortalType
()
==
"Integration Category Mapping"
:
if
context
.
getPortalType
()
==
"Integration Category Mapping"
:
try
:
try
:
uid
=
"_"
.
join
(
context
.
getParent
().
getRelativeUrl
().
split
(
"/"
)[
2
:])
uid
=
"_"
.
join
(
context
.
getParent
Value
().
getRelativeUrl
().
split
(
"/"
)[
2
:])
category_url
=
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
category_url
=
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
except
:
except
:
category_url
=
context
.
getParent
().
getDestinationReference
()
category_url
=
context
.
getParent
Value
().
getDestinationReference
()
if
category_url
is
not
None
and
category_url
!=
""
:
if
category_url
is
not
None
and
category_url
!=
""
:
container
=
context
.
restrictedTraverse
(
"portal_categories/%s"
%
category_url
)
container
=
context
.
restrictedTraverse
(
"portal_categories/%s"
%
category_url
)
try
:
try
:
uid
=
"_"
.
join
(
context
.
getParent
().
getRelativeUrl
().
split
(
"/"
)[
2
:])
uid
=
"_"
.
join
(
context
.
getParent
Value
().
getRelativeUrl
().
split
(
"/"
)[
2
:])
new_destination_reference
=
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
new_destination_reference
=
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
if
new_destination_reference
==
""
:
if
new_destination_reference
==
""
:
value
=
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
context
.
getId
()]
value
=
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
context
.
getId
()]
...
...
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/CategoryMapping_getIndentedCategoryTitle.py
View file @
d4e96b43
NBSP_UTF8
=
u'
\
xA0
'
.
encode
(
'utf-8'
)
NBSP_UTF8
=
u'
\
xA0
'
.
encode
(
'utf-8'
)
def
getCategoryLevel
(
category
=
None
):
def
getCategoryLevel
(
category
=
None
):
if
getattr
(
category
.
getParent
(),
"getDestinationReference"
,
None
)
is
None
:
if
getattr
(
category
.
getParent
Value
(),
"getDestinationReference"
,
None
)
is
None
:
return
0
return
0
return
1
+
getCategoryLevel
(
category
.
getParent
())
return
1
+
getCategoryLevel
(
category
.
getParentValue
())
level
=
getCategoryLevel
(
context
.
getParent
())
level
=
getCategoryLevel
(
context
.
getParent
Value
())
return
"%s%s"
%
(
NBSP_UTF8
*
8
*
level
,
context
.
getSourceReference
())
return
"%s%s"
%
(
NBSP_UTF8
*
8
*
level
,
context
.
getSourceReference
())
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/IntegrationSite_getFastInputCategoryMappingLineList.py
View file @
d4e96b43
...
@@ -9,7 +9,7 @@ len_line_list = len(line_list)
...
@@ -9,7 +9,7 @@ len_line_list = len(line_list)
if
len_line_list
!=
0
:
if
len_line_list
!=
0
:
for
line
in
line_list
:
for
line
in
line_list
:
container
=
integration_site
container
=
integration_site
parent
=
line
.
getParent
()
parent
=
line
.
getParent
Value
()
if
line
.
getPortalType
()
==
"Integration Category Mapping"
and
parent
is
not
None
:
if
line
.
getPortalType
()
==
"Integration Category Mapping"
and
parent
is
not
None
:
container
=
parent
container
=
parent
obj
=
container
.
newContent
(
portal_type
=
line
.
getPortalType
(),
obj
=
container
.
newContent
(
portal_type
=
line
.
getPortalType
(),
...
...
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/IntegrationSite_setCategoryMappingLineList.py
View file @
d4e96b43
from
Products.ERP5Type.Message
import
translateString
from
Products.ERP5Type.Message
import
translateString
def
getCategoryUrl
(
category_mapping
=
None
):
def
getCategoryUrl
(
category_mapping
=
None
):
if
getattr
(
category_mapping
.
getParent
(),
"getDestinationReference"
,
None
)
is
None
:
if
getattr
(
category_mapping
.
getParent
Value
(),
"getDestinationReference"
,
None
)
is
None
:
return
"portal_categories"
return
"portal_categories"
return
"%s/%s"
%
(
getCategoryUrl
(
category_mapping
.
getParent
()),
category_mapping
.
getDestinationReference
())
return
"%s/%s"
%
(
getCategoryUrl
(
category_mapping
.
getParent
Value
()),
category_mapping
.
getDestinationReference
())
def
createCategory
(
object_mapping
=
None
,
category
=
""
):
def
createCategory
(
object_mapping
=
None
,
category
=
""
):
if
object_mapping
is
None
or
category
==
""
:
if
object_mapping
is
None
or
category
==
""
:
return
return
category_url
=
getCategoryUrl
(
object_mapping
.
getParent
())
category_url
=
getCategoryUrl
(
object_mapping
.
getParent
Value
())
category_object
=
context
.
restrictedTraverse
(
category_url
)
category_object
=
context
.
restrictedTraverse
(
category_url
)
if
category_object
is
not
None
:
if
category_object
is
not
None
:
if
category_object
.
getId
()
==
"portal_categories"
:
if
category_object
.
getId
()
==
"portal_categories"
:
...
...
bt5/erp5_tiosafe_core/SkinTemplateItem/portal_skins/erp5_integration/IntegrationSite_updateCategoryMappingLineList.py
View file @
d4e96b43
...
@@ -57,28 +57,28 @@ if len_line_list!=0:
...
@@ -57,28 +57,28 @@ if len_line_list!=0:
line_id
=
your_mapping
[
'listbox_key'
]
line_id
=
your_mapping
[
'listbox_key'
]
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
line_id
]
=
your_destination_reference
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
line_id
]
=
your_destination_reference
request
.
form
[
"field_listbox_destination_reference_text_new_%s"
%
line_id
]
=
your_destination_reference_text
request
.
form
[
"field_listbox_destination_reference_text_new_%s"
%
line_id
]
=
your_destination_reference_text
if
line
.
getParent
().
getPortalType
()
in
[
"Integration Category Mapping"
,
"Integration Base Category Mapping"
]:
if
line
.
getParent
Value
().
getPortalType
()
in
[
"Integration Category Mapping"
,
"Integration Base Category Mapping"
]:
uid
=
"_"
.
join
(
line
.
getParent
().
getRelativeUrl
().
split
(
"/"
)[
2
:])
uid
=
"_"
.
join
(
line
.
getParent
Value
().
getRelativeUrl
().
split
(
"/"
)[
2
:])
parent_mapping
=
mapping_dict
[
uid
]
parent_mapping
=
mapping_dict
[
uid
]
parent_destination_reference
=
parent_mapping
[
"destination_reference"
]
parent_destination_reference
=
parent_mapping
[
"destination_reference"
]
parent_destination_reference_text
=
parent_mapping
[
"destination_reference_text"
]
parent_destination_reference_text
=
parent_mapping
[
"destination_reference_text"
]
if
parent_destination_reference_text
!=
""
:
if
parent_destination_reference_text
!=
""
:
reset_uid_list
=
reset_uid_list
+
getMappingChildUid
(
line
.
getParent
()).
split
(
'-'
)
reset_uid_list
=
reset_uid_list
+
getMappingChildUid
(
line
.
getParent
Value
()).
split
(
'-'
)
for
uid
in
getMappingChildUid
(
line
.
getParent
()).
split
(
'-'
):
for
uid
in
getMappingChildUid
(
line
.
getParent
Value
()).
split
(
'-'
):
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
kw
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
kw
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
parent_uid
=
"_"
.
join
(
line
.
getParent
().
getRelativeUrl
().
split
(
"/"
)[
2
:])
parent_uid
=
"_"
.
join
(
line
.
getParent
Value
().
getRelativeUrl
().
split
(
"/"
)[
2
:])
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
parent_uid
]
=
""
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
parent_uid
]
=
""
kw
[
"field_listbox_destination_reference_new_%s"
%
parent_uid
]
=
""
kw
[
"field_listbox_destination_reference_new_%s"
%
parent_uid
]
=
""
else
:
else
:
if
parent_destination_reference
==
""
:
if
parent_destination_reference
==
""
:
reset_uid_list
=
reset_uid_list
+
getMappingChildUid
(
line
.
getParent
()).
split
(
'-'
)
reset_uid_list
=
reset_uid_list
+
getMappingChildUid
(
line
.
getParent
Value
()).
split
(
'-'
)
for
uid
in
getMappingChildUid
(
line
.
getParent
()).
split
(
'-'
):
for
uid
in
getMappingChildUid
(
line
.
getParent
Value
()).
split
(
'-'
):
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
kw
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
kw
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
#elif parent_destination_reference != line.getParent().getDestinationReference() \
#elif parent_destination_reference != line.getParent
Value
().getDestinationReference() \
#and line.getParent().getDestinationReference() not in [None, ""]:
#and line.getParent
Value
().getDestinationReference() not in [None, ""]:
elif
line
.
getParent
().
getDestinationReference
()
not
in
[
None
,
""
]:
elif
line
.
getParent
Value
().
getDestinationReference
()
not
in
[
None
,
""
]:
line_uid
=
"_"
.
join
(
line
.
getRelativeUrl
().
split
(
"/"
)[
2
:])
line_uid
=
"_"
.
join
(
line
.
getRelativeUrl
().
split
(
"/"
)[
2
:])
destination_reference
=
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
line_uid
]
destination_reference
=
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
line_uid
]
if
destination_reference
!=
""
and
not
destination_reference
.
startswith
(
parent_destination_reference
):
if
destination_reference
!=
""
and
not
destination_reference
.
startswith
(
parent_destination_reference
):
...
@@ -89,8 +89,8 @@ if len_line_list!=0:
...
@@ -89,8 +89,8 @@ if len_line_list!=0:
for
uid
in
getMappingChildUid
(
line
).
split
(
'-'
):
for
uid
in
getMappingChildUid
(
line
).
split
(
'-'
):
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
request
.
form
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
kw
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
kw
[
"field_listbox_destination_reference_new_%s"
%
uid
]
=
""
#elif parent_destination_reference == line.getParent().getDestinationReference() \
#elif parent_destination_reference == line.getParent
Value
().getDestinationReference() \
#and line.getParent().getDestinationReference() not in [None, ""]:
#and line.getParent
Value
().getDestinationReference() not in [None, ""]:
#line_uid = "_".join(line.getRelativeUrl().split("/")[2:])
#line_uid = "_".join(line.getRelativeUrl().split("/")[2:])
#destination_reference = request.form["field_listbox_destination_reference_new_%s"%line_uid]
#destination_reference = request.form["field_listbox_destination_reference_new_%s"%line_uid]
#if destination_reference != "" and not destination_reference.startswith(parent_destination_reference):
#if destination_reference != "" and not destination_reference.startswith(parent_destination_reference):
...
...
bt5/erp5_trade/TestTemplateItem/portal_components/test.erp5.testPackingList.py
View file @
d4e96b43
...
@@ -756,7 +756,7 @@ class TestPackingListMixin(TestOrderMixin):
...
@@ -756,7 +756,7 @@ class TestPackingListMixin(TestOrderMixin):
delivery_value
=
simulation_movement
.
getDeliveryValue
()
delivery_value
=
simulation_movement
.
getDeliveryValue
()
if
delivery_value
not
in
delivery_value_list
:
if
delivery_value
not
in
delivery_value_list
:
delivery_value_list
.
append
(
delivery_value_list
)
delivery_value_list
.
append
(
delivery_value_list
)
# new_packing_list = delivery_value.getParent()
# new_packing_list = delivery_value.getParent
Value
()
# self.assertNotEquals(new_packing_list.getUid(),packing_list.getUid())
# self.assertNotEquals(new_packing_list.getUid(),packing_list.getUid())
self
.
assertEqual
(
len
(
delivery_value_list
),
len
(
resource_list
))
self
.
assertEqual
(
len
(
delivery_value_list
),
len
(
resource_list
))
...
@@ -784,7 +784,7 @@ class TestPackingListMixin(TestOrderMixin):
...
@@ -784,7 +784,7 @@ class TestPackingListMixin(TestOrderMixin):
delivery_value
=
simulation_movement
.
getDeliveryValue
()
delivery_value
=
simulation_movement
.
getDeliveryValue
()
if
delivery_value
not
in
delivery_value_list
:
if
delivery_value
not
in
delivery_value_list
:
delivery_value_list
.
append
(
delivery_value_list
)
delivery_value_list
.
append
(
delivery_value_list
)
# new_packing_list = delivery_value.getParent()
# new_packing_list = delivery_value.getParent
Value
()
# self.assertNotEquals(new_packing_list.getUid(),packing_list.getUid())
# self.assertNotEquals(new_packing_list.getUid(),packing_list.getUid())
self
.
assertEqual
(
len
(
delivery_value_list
),
len
(
resource_list
))
self
.
assertEqual
(
len
(
delivery_value_list
),
len
(
resource_list
))
...
...
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