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
Yusei Tahara
erp5
Commits
ed5af4dd
Commit
ed5af4dd
authored
Mar 10, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
base: fix pylint messages and enable coding style test
parent
cdae0727
Changes
55
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
547 additions
and
307 deletions
+547
-307
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Currency.py
...tTemplateItem/portal_components/document.erp5.Currency.py
+1
-1
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Currency.xml
...TemplateItem/portal_components/document.erp5.Currency.xml
+31
-6
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Image.py
...mentTemplateItem/portal_components/document.erp5.Image.py
+44
-13
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Image.xml
...entTemplateItem/portal_components/document.erp5.Image.xml
+31
-18
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Login.py
...mentTemplateItem/portal_components/document.erp5.Login.py
+2
-2
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MappedProperty.py
...ateItem/portal_components/document.erp5.MappedProperty.py
+3
-3
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MappedProperty.xml
...teItem/portal_components/document.erp5.MappedProperty.xml
+31
-8
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OOoDocument.py
...mplateItem/portal_components/document.erp5.OOoDocument.py
+3
-5
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OOoDocument.xml
...plateItem/portal_components/document.erp5.OOoDocument.xml
+25
-8
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OrderBuilder.py
...plateItem/portal_components/document.erp5.OrderBuilder.py
+4
-1
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OrderBuilder.xml
...lateItem/portal_components/document.erp5.OrderBuilder.xml
+24
-3
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Person.py
...entTemplateItem/portal_components/document.erp5.Person.py
+12
-4
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Person.xml
...ntTemplateItem/portal_components/document.erp5.Person.xml
+25
-8
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.SimulatedDeliveryBuilder.py
...rtal_components/document.erp5.SimulatedDeliveryBuilder.py
+3
-4
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.SimulatedDeliveryBuilder.xml
...tal_components/document.erp5.SimulatedDeliveryBuilder.xml
+25
-6
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BarcodeUtils.py
...lateItem/portal_components/extension.erp5.BarcodeUtils.py
+1
-1
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BarcodeUtils.xml
...ateItem/portal_components/extension.erp5.BarcodeUtils.xml
+62
-19
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BaseMigration.py
...ateItem/portal_components/extension.erp5.BaseMigration.py
+1
-2
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BaseMigration.xml
...teItem/portal_components/extension.erp5.BaseMigration.xml
+62
-19
bt5/erp5_base/InterfaceTemplateItem/portal_components/interface.erp5.IEncryptedPassword.py
...em/portal_components/interface.erp5.IEncryptedPassword.py
+1
-1
bt5/erp5_base/InterfaceTemplateItem/portal_components/interface.erp5.IEncryptedPassword.xml
...m/portal_components/interface.erp5.IEncryptedPassword.xml
+31
-6
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.EncryptedPasswordMixin.py
...em/portal_components/mixin.erp5.EncryptedPasswordMixin.py
+13
-5
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.EncryptedPasswordMixin.xml
...m/portal_components/mixin.erp5.EncryptedPasswordMixin.xml
+31
-8
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/BankAccount_validateIBAN.py
...teItem/portal_skins/erp5_base/BankAccount_validateIBAN.py
+2
-2
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_changeId.py
.../SkinTemplateItem/portal_skins/erp5_base/Base_changeId.py
+2
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_createMailMessageAsString.py
.../portal_skins/erp5_base/Base_createMailMessageAsString.py
+1
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_createMailMessageAsString.xml
...portal_skins/erp5_base/Base_createMailMessageAsString.xml
+1
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_generateDomain.py
...emplateItem/portal_skins/erp5_base/Base_generateDomain.py
+2
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getDiffBetweenDateAndNow.py
...m/portal_skins/erp5_base/Base_getDiffBetweenDateAndNow.py
+1
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_postQuery.py
...SkinTemplateItem/portal_skins/erp5_base/Base_postQuery.py
+0
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/CurrencyExchange_getExchangeRateList.py
...l_skins/erp5_base/CurrencyExchange_getExchangeRateList.py
+7
-7
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getCellGroupDivergenceList.py
...al_skins/erp5_base/Delivery_getCellGroupDivergenceList.py
+3
-3
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getDeliveryGroupDivergenceList.py
...kins/erp5_base/Delivery_getDeliveryGroupDivergenceList.py
+4
-4
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getLineGroupDivergenceList.py
...al_skins/erp5_base/Delivery_getLineGroupDivergenceList.py
+4
-4
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getODTDataDict.py
...ateItem/portal_skins/erp5_base/Delivery_getODTDataDict.py
+1
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Document_checkConversionFormatPermission.py
...ins/erp5_base/Document_checkConversionFormatPermission.py
+2
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Document_getStandardFileName.py
...em/portal_skins/erp5_base/Document_getStandardFileName.py
+2
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Document_getStandardFilename.py
...em/portal_skins/erp5_base/Document_getStandardFilename.py
+2
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Type_acquireSecurityFromCategory.py
...l_skins/erp5_base/ERP5Type_acquireSecurityFromCategory.py
+5
-5
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Type_acquireSecurityFromCategory.xml
..._skins/erp5_base/ERP5Type_acquireSecurityFromCategory.xml
+1
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/MailMessage_send.py
...inTemplateItem/portal_skins/erp5_base/MailMessage_send.py
+2
-3
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Organisation_init.py
...nTemplateItem/portal_skins/erp5_base/Organisation_init.py
+1
-0
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getCareerStartDate.py
...eItem/portal_skins/erp5_base/Person_getCareerStartDate.py
+1
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedContributionList.py
...ins/erp5_base/Person_getPersonDetailedContributionList.py
+22
-23
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedEventList.py
...rtal_skins/erp5_base/Person_getPersonDetailedEventList.py
+0
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPrimaryGroup.py
...lateItem/portal_skins/erp5_base/Person_getPrimaryGroup.py
+1
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_shiftDefaultCareer.py
...eItem/portal_skins/erp5_base/Person_shiftDefaultCareer.py
+0
-1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_statPersonDetailedContributionList.py
...ns/erp5_base/Person_statPersonDetailedContributionList.py
+0
-72
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/currency_exchange_line_interaction_workflow/scripts/CurrencyExchangeLine_updateMatrix.py
...ion_workflow/scripts/CurrencyExchangeLine_updateMatrix.py
+1
-2
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Delivery_callSolveDivergenceTransition.py
...orkflow/scripts/Delivery_callSolveDivergenceTransition.py
+2
-4
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Delivery_callSplitAndDeferTransition.py
..._workflow/scripts/Delivery_callSplitAndDeferTransition.py
+0
-2
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Delivery_splitAndDefer.py
...very_causality_workflow/scripts/Delivery_splitAndDefer.py
+4
-4
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Workflow_solveDivergenceAutomatically.py
...workflow/scripts/Workflow_solveDivergenceAutomatically.py
+1
-4
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/query_workflow/scripts/notifyOwner.py
...tem/portal_workflow/query_workflow/scripts/notifyOwner.py
+6
-6
bt5/erp5_base/bt/skip_coding_style_test
bt5/erp5_base/bt/skip_coding_style_test
+0
-1
No files found.
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Currency.py
View file @
ed5af4dd
...
...
@@ -56,7 +56,7 @@ class Currency(Resource):
# Unit conversion
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'convertQuantity'
)
def
convertQuantity
(
self
,
quantity
,
from_unit
,
to_unit
,
variation_list
=
()):
def
convertQuantity
(
self
,
quantity
,
from_unit
,
to_unit
,
variation_list
=
()
,
transformed_resource
=
None
,
transformed_variation_list
=
()
):
# 'variation_list' parameter may be deprecated:
# cf Measure.getConvertedQuantity
return
quantity
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Currency.xml
View file @
ed5af4dd
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
Currency
</string>
</value>
...
...
@@ -14,6 +20,12 @@
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.Document.Currency
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.Currency
</string>
</value>
...
...
@@ -37,9 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 59, 2: Arguments number differs from overridden \'convertQuantity\' method (arguments-differ)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -49,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -68,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -77,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Image.py
View file @
ed5af4dd
...
...
@@ -54,7 +54,7 @@ from Products.ERP5Type.ImageUtil import transformUrlToDataURI
# import mixin
from
Products.ERP5.mixin.text_convertable
import
TextConvertableMixin
def
getDefaultImageQuality
(
portal
,
format
=
None
):
def
getDefaultImageQuality
(
portal
,
format
=
None
):
# pylint: disable=redefined-builtin
preference_tool
=
portal
.
portal_preferences
return
preference_tool
.
getPreferredImageQuality
()
...
...
@@ -173,7 +173,10 @@ class Image(TextConvertableMixin, File, OFSImage):
return
self
.
height
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getContentType'
)
def
getContentType
(
self
,
default
=
_MARKER
):
def
getContentType
(
# pylint: disable=arguments-differ,dangerous-default-value
self
,
default
=
_MARKER
,
):
"""Original photo content_type."""
self
.
_upgradeImage
()
if
self
.
hasData
()
and
not
self
.
hasContentType
():
...
...
@@ -208,8 +211,13 @@ class Image(TextConvertableMixin, File, OFSImage):
return
links
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'displayMap'
)
def
displayMap
(
self
,
exclude
=
None
,
format
=
None
,
quality
=
_MARKER
,
\
resolution
=
None
):
def
displayMap
(
# pylint: disable=dangerous-default-value
self
,
exclude
=
None
,
format
=
None
,
# pylint: disable=redefined-builtin
quality
=
_MARKER
,
resolution
=
None
,
):
"""Return list of displays with size info."""
displays
=
[]
if
quality
is
_MARKER
:
...
...
@@ -236,7 +244,7 @@ class Image(TextConvertableMixin, File, OFSImage):
security
.
declarePrivate
(
'_convertToText'
)
def
_convertToText
(
self
,
format
):
def
_convertToText
(
self
,
format
):
# pylint: disable=redefined-builtin
"""
Convert the image to text with portaltransforms
"""
...
...
@@ -258,7 +266,7 @@ class Image(TextConvertableMixin, File, OFSImage):
return
mime_type
,
result
# Conversion API
def
_convert
(
self
,
format
,
**
kw
):
def
_convert
(
self
,
format
,
**
kw
):
# pylint: disable=redefined-builtin
"""
Implementation of conversion for Image files
"""
...
...
@@ -319,7 +327,16 @@ class Image(TextConvertableMixin, File, OFSImage):
# Photo processing
#
def
_resize
(
self
,
quality
,
width
,
height
,
format
,
resolution
,
frame
,
crop
=
False
):
def
_resize
(
self
,
quality
,
width
,
height
,
format
,
# pylint: disable=redefined-builtin
resolution
,
frame
,
crop
=
False
,
):
"""Resize and resample photo."""
icc_profile
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'..'
,
'misc'
,
'sRGB.icc'
)
...
...
@@ -376,7 +393,15 @@ class Image(TextConvertableMixin, File, OFSImage):
return
StringIO
(
image
)
raise
ConversionError
(
'Image conversion failed (%s).'
%
err
)
def
_getDisplayData
(
self
,
format
,
quality
,
resolution
,
frame
,
image_size
,
crop
):
def
_getDisplayData
(
self
,
format
,
# pylint: disable=redefined-builtin
quality
,
resolution
,
frame
,
image_size
,
crop
,
):
"""Return raw photo data for given display."""
if
crop
:
width
,
height
=
image_size
...
...
@@ -389,13 +414,19 @@ class Image(TextConvertableMixin, File, OFSImage):
return
self
.
getData
()
return
self
.
_resize
(
quality
,
width
,
height
,
format
,
resolution
,
frame
,
crop
)
def
_makeDisplayPhoto
(
self
,
format
=
None
,
quality
=
_MARKER
,
resolution
=
None
,
frame
=
None
,
image_size
=
None
,
crop
=
False
):
def
_makeDisplayPhoto
(
# pylint: disable=dangerous-default-value
self
,
format
=
None
,
# pylint: disable=redefined-builtin
quality
=
_MARKER
,
resolution
=
None
,
frame
=
None
,
image_size
=
None
,
crop
=
False
,
):
"""Create given display."""
if
quality
is
_MARKER
:
quality
=
self
.
getDefaultImageQuality
(
format
)
width
,
height
=
image_size
width
,
height
=
image_size
# pylint: disable=unpacking-non-sequence
base
,
ext
=
splitext
(
self
.
id
)
id_
=
'%s_%s_%s.%s'
%
(
base
,
width
,
height
,
ext
,)
image
=
OFSImage
(
id_
,
self
.
getTitle
(),
...
...
@@ -453,7 +484,7 @@ class Image(TextConvertableMixin, File, OFSImage):
self
.
_update_image_info
()
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getDefaultImageQuality'
)
def
getDefaultImageQuality
(
self
,
format
=
None
):
def
getDefaultImageQuality
(
self
,
format
=
None
):
# pylint: disable=redefined-builtin
"""
Get default image quality for a format.
"""
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Image.xml
View file @
ed5af4dd
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
Image
</string>
</value>
...
...
@@ -14,6 +20,12 @@
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.Document.Image
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.Image
</string>
</value>
...
...
@@ -37,21 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 57, 35: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:176, 2: Dangerous default value _MARKER (__builtin__.list) as argument (dangerous-default-value)
</string>
<string>
W:176, 2: Arguments number differs from overridden \'getContentType\' method (arguments-differ)
</string>
<string>
W:211, 37: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:211, 2: Dangerous default value _MARKER (__builtin__.list) as argument (dangerous-default-value)
</string>
<string>
W:239, 27: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:261, 21: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:322, 44: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:379, 28: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:392, 30: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:392, 2: Dangerous default value _MARKER (__builtin__.list) as argument (dangerous-default-value)
</string>
<string>
W:398, 4: Attempting to unpack a non-sequence defined at line 393 (unpacking-non-sequence)
</string>
<string>
W:456, 35: Redefining built-in \'format\' (redefined-builtin)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -61,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -80,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -89,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Login.py
View file @
ed5af4dd
...
...
@@ -6,7 +6,7 @@
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# g
u
arantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
...
...
@@ -30,9 +30,9 @@ from AccessControl import ClassSecurityInfo
from
erp5.component.mixin.EncryptedPasswordMixin
import
EncryptedPasswordMixin
from
erp5.component.mixin.LoginAccountProviderMixin
import
LoginAccountProviderMixin
from
Products.ERP5Type
import
Permissions
,
PropertySheet
,
interfaces
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5Type.XMLObject
import
XMLObject
class
Login
(
XMLObject
,
LoginAccountProviderMixin
,
EncryptedPasswordMixin
):
meta_type
=
'ERP5 Login'
portal_type
=
'Login'
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MappedProperty.py
View file @
ed5af4dd
...
...
@@ -76,13 +76,13 @@ class MappedProperty(XMLObject):
return
mapping_dict
# XXX do we need to protect this method?
def
getMappedPropertyId
(
self
,
property
,
reverse
=
False
):
def
getMappedPropertyId
(
self
,
property
,
reverse
=
False
):
# pylint: disable=redefined-builtin
return
self
.
getMappingDict
(
reverse
=
reverse
).
get
(
property
,
property
)
# Security should be handled by the target document not by the mapped
# property document.
security
.
declarePublic
(
'getMappedProperty'
)
def
getMappedProperty
(
self
,
document
,
property
):
def
getMappedProperty
(
self
,
document
,
property
):
# pylint: disable=redefined-builtin
if
property
.
endswith
(
'_list'
):
property
=
property
[:
-
5
]
getProperty
=
document
.
getPropertyList
...
...
@@ -98,7 +98,7 @@ class MappedProperty(XMLObject):
# Security should be handled by the target document not by the mapped
# property document.
security
.
declarePublic
(
'setMappedProperty'
)
def
setMappedProperty
(
self
,
document
,
property
,
value
):
def
setMappedProperty
(
self
,
document
,
property
,
value
):
# pylint: disable=redefined-builtin
if
property
.
endswith
(
'_list'
):
property
=
property
[:
-
5
]
setProperty
=
document
.
setPropertyList
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.MappedProperty.xml
View file @
ed5af4dd
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
MappedProperty
</string>
</value>
...
...
@@ -14,6 +20,12 @@
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.Document.MappedProperty
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
document.erp5.MappedProperty
</string>
</value>
...
...
@@ -37,11 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 79, 32: Redefining built-in \'property\' (redefined-builtin)
</string>
<string>
W: 85, 40: Redefining built-in \'property\' (redefined-builtin)
</string>
<string>
W:101, 40: Redefining built-in \'property\' (redefined-builtin)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -51,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -70,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -79,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OOoDocument.py
View file @
ed5af4dd
# -*- coding: utf-8 -*-
##############################################################################
#
...
...
@@ -190,7 +189,7 @@ class OOoDocument(OOoDocumentExtensibleTraversableMixin, BaseConvertableFileMixi
return cached_getTargetFormatItemList(self.getBaseContentType())
def _getConversionFromProxyServer(self, format):
def _getConversionFromProxyServer(self, format):
# pylint: disable=redefined-builtin
"""
Communicates with server to convert a file
"""
...
...
@@ -226,7 +225,7 @@ class OOoDocument(OOoDocumentExtensibleTraversableMixin, BaseConvertableFileMixi
return response_dict['
mime
'], Pdata(dec(response_dict['
data
']))
# Conversion API
def _convert(self, format, frame=0, **kw):
def _convert(self, format, frame=0, **kw):
# pylint: disable=redefined-builtin
"""Convert the document to the given format.
If a conversion is already stored for this format, it is returned
...
...
@@ -346,8 +345,7 @@ class OOoDocument(OOoDocumentExtensibleTraversableMixin, BaseConvertableFileMixi
if
zip_file
is
None
:
format_list
=
[
x
for
x
in
self
.
getTargetFormatList
()
if
x
.
startswith
(
'html'
)
or
x
.
endswith
(
'html'
)]
format
=
format_list
[
0
]
mime
,
data
=
self
.
_getConversionFromProxyServer
(
format
)
mime
,
data
=
self
.
_getConversionFromProxyServer
(
format_list
[
0
])
archive_file
=
cStringIO
.
StringIO
()
archive_file
.
write
(
str
(
data
))
zip_file
=
zipfile
.
ZipFile
(
archive_file
)
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OOoDocument.xml
View file @
ed5af4dd
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
OOoDocument
</string>
</value>
...
...
@@ -43,11 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:193, 42: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:229, 21: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:349, 6: Redefining built-in \'format\' (redefined-builtin)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -57,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -76,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -85,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OrderBuilder.py
View file @
ed5af4dd
...
...
@@ -28,4 +28,7 @@
# for builders, and still distinguish order builders from others
# Once legacy simulation is dropped, "Order Builder" portal type should
# should be changed to use SimulatedDeliveryBuilder class.
from
erp5.component.document.GeneratedDeliveryBuilder
import
GeneratedDeliveryBuilder
as
OrderBuilder
from
erp5.component.document.GeneratedDeliveryBuilder
import
GeneratedDeliveryBuilder
class
OrderBuilder
(
GeneratedDeliveryBuilder
):
pass
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.OrderBuilder.xml
View file @
ed5af4dd
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
OrderBuilder
</string>
</value>
...
...
@@ -53,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -72,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -81,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Person.py
View file @
ed5af4dd
##############################################################################
#
# Copyright (c) 2002-2005 Nexedi SARL and Contributors. All Rights Reserved.
...
...
@@ -46,10 +45,19 @@ else:
from
Products.ERP5Security.ERP5UserManager
import
ERP5UserManager
from
Products.ERP5Security.ERP5LoginUserManager
import
ERP5LoginUserManager
class
UserExistsError
(
ValidationFailed
):
class
UserExistsError
(
ValidationFailed
,
# to workaround pylint's false positive:
# Exception doesn't inherit from standard "Exception" class (nonstandard-exception)
# because it cannot import ValidationFailed (which is set by a monkey patch), we also
# inherit from Exception.
Exception
,
):
def
__init__
(
self
,
user_id
):
super
(
UserExistsError
,
self
).
__init__
(
'user id %s already exists'
%
(
user_id
,
))
class
Person
(
Node
,
LoginAccountProviderMixin
,
EncryptedPasswordMixin
,
ERP5UserMixin
):
"""
An Person object holds the information about
...
...
@@ -91,7 +99,7 @@ class Person(Node, LoginAccountProviderMixin, EncryptedPasswordMixin, ERP5UserMi
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTitle'
)
def
getTitle
(
self
,
**
kw
):
def
getTitle
(
self
,
**
kw
):
# pylint: disable=super-on-old-class
"""
Returns the title if it exists or a combination of
first name, middle name and last name
...
...
@@ -105,7 +113,7 @@ class Person(Node, LoginAccountProviderMixin, EncryptedPasswordMixin, ERP5UserMi
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTranslatedTitle'
)
def
getTranslatedTitle
(
self
,
**
kw
):
def
getTranslatedTitle
(
self
,
**
kw
):
# pylint: disable=super-on-old-class
"""
Returns the title if it exists or a combination of
first name, middle name and last name
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.Person.xml
View file @
ed5af4dd
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
Person
</string>
</value>
...
...
@@ -43,11 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:158, 10: Exception doesn\'t inherit from standard "Exception" class (nonstandard-exception)
</string>
<string>
W:166, 6: Exception doesn\'t inherit from standard "Exception" class (nonstandard-exception)
</string>
<string>
W:178, 6: Exception doesn\'t inherit from standard "Exception" class (nonstandard-exception)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -57,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -76,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -85,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.SimulatedDeliveryBuilder.py
View file @
ed5af4dd
# -*- coding: utf-8 -*-
##############################################################################
#
...
...
@@ -203,8 +202,8 @@ class SimulatedDeliveryBuilder(BuilderMixin):
if
property_dict
in
(
None
,
{}):
return
delivery
=
self
.
getPortalObject
().
restrictedTraverse
(
delivery_relative_url
)
for
(
prop
erty
,
value
)
in
property_dict
.
iteritems
():
delivery
.
setPropertyList
(
prop
erty
,
value
)
for
(
prop
,
value
)
in
property_dict
.
iteritems
():
delivery
.
setPropertyList
(
prop
,
value
)
# Try to remove existing properties/categories from Movements that
# should exist on Deliveries.
...
...
@@ -341,7 +340,7 @@ class SimulatedDeliveryBuilder(BuilderMixin):
'solveDivergence'
)
solveDivergence
=
UnrestrictedMethod
(
_solveDivergence
)
def
_createDelivery
(
self
,
delivery_module
,
movement_list
,
activate_kw
):
def
_createDelivery
(
self
,
delivery_module
,
movement_list
,
activate_kw
):
# pylint: disable=super-on-old-class
"""
Refer to the docstring in GeneratedDeliveryBuilder.
Unlike GeneratedDeliveryBuilder, SimulatedDeliveryBuilder needs to respect
...
...
bt5/erp5_base/DocumentTemplateItem/portal_components/document.erp5.SimulatedDeliveryBuilder.xml
View file @
ed5af4dd
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
SimulatedDeliveryBuilder
</string>
</value>
...
...
@@ -43,9 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W:206, 9: Redefining built-in \'property\' (redefined-builtin)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -55,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -74,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -83,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BarcodeUtils.py
View file @
ed5af4dd
...
...
@@ -10,7 +10,7 @@ def generateBarcodeImage(self, barcode_type, data, REQUEST=None):
stdout
=
PIPE
,
stderr
=
PIPE
,
close_fds
=
True
)
output
,
error
=
process
.
communicate
(
input
=
data
)
output
,
_
=
process
.
communicate
(
input
=
data
)
elif
barcode_type
==
'ean13'
:
from
hubarcode.ean13
import
EAN13Encoder
encoder
=
EAN13Encoder
(
data
)
...
...
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BarcodeUtils.xml
View file @
ed5af4dd
...
...
@@ -6,10 +6,22 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
BarcodeUtils
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.BarcodeUtils
</string>
</value>
...
...
@@ -24,6 +36,18 @@
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
...
...
@@ -31,13 +55,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -50,7 +89,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -59,26 +98,30 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BaseMigration.py
View file @
ed5af4dd
...
...
@@ -37,7 +37,6 @@ def migrateToEmbeddedFile(self, force=0):
if
portal_type
in
(
'File'
,
'Image'
)
and
self
.
getValidationState
()
==
'embedded'
:
embedded_type
=
'Embedded File'
container
=
self
.
getParentValue
()
id
=
self
.
id
if
force
==
1
:
changeObjectClass
(
container
,
id
,
getattr
(
erp5
.
portal_type
,
embedded_type
))
changeObjectClass
(
container
,
self
.
id
,
getattr
(
erp5
.
portal_type
,
embedded_type
))
return
'%s: %s -> %s'
%
(
self
.
getRelativeUrl
(),
portal_type
,
embedded_type
),
bt5/erp5_base/ExtensionTemplateItem/portal_components/extension.erp5.BaseMigration.xml
View file @
ed5af4dd
...
...
@@ -6,10 +6,22 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
BaseMigration
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
extension.erp5.BaseMigration
</string>
</value>
...
...
@@ -24,6 +36,18 @@
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
...
...
@@ -31,13 +55,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -50,7 +89,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -59,26 +98,30 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_base/InterfaceTemplateItem/portal_components/interface.erp5.IEncryptedPassword.py
View file @
ed5af4dd
...
...
@@ -47,7 +47,7 @@ class IEncryptedPassword(Interface):
Check if the password value is acceptable - i.e. follows site rules.
"""
def
setEncodedPassword
(
value
,
format
=
'default'
):
def
setEncodedPassword
(
value
,
format
=
'default'
):
# pylint: disable=redefined-builtin
"""
Set an already encoded password.
"""
...
...
bt5/erp5_base/InterfaceTemplateItem/portal_components/interface.erp5.IEncryptedPassword.xml
View file @
ed5af4dd
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
IEncryptedPassword
</string>
</value>
...
...
@@ -14,6 +20,12 @@
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.interfaces.encrypted_password
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interface.erp5.IEncryptedPassword
</string>
</value>
...
...
@@ -37,9 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 50, 32: Redefining built-in \'format\' (redefined-builtin)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -49,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -68,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -77,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.EncryptedPasswordMixin.py
View file @
ed5af4dd
...
...
@@ -77,14 +77,22 @@ class EncryptedPasswordMixin:
if
not
_checkPermission
(
Permissions
.
SetOwnPassword
,
self
):
raise
AccessControl_Unauthorized
(
'setPassword'
)
def
_setEncodedPassword
(
self
,
value
,
format
=
'default'
):
def
_setEncodedPassword
(
self
,
value
,
format
=
'default'
,
# pylint: disable=redefined-builtin
):
password
=
getattr
(
aq_base
(
self
),
'password'
,
None
)
if
password
is
None
or
isinstance
(
password
,
basestring
):
password
=
self
.
password
=
PersistentMapping
()
self
.
password
[
format
]
=
value
security
.
declarePublic
(
'setEncodedPassword'
)
def
setEncodedPassword
(
self
,
value
,
format
=
'default'
):
def
setEncodedPassword
(
self
,
value
,
format
=
'default'
,
# pylint: disable=redefined-builtin
):
"""
"""
self
.
checkUserCanChangePassword
()
...
...
@@ -121,14 +129,14 @@ class EncryptedPasswordMixin:
if
password
is
marker
:
password
=
default_password
else
:
format
=
kw
.
get
(
'format'
,
'default'
)
format
_
=
kw
.
get
(
'format'
,
'default'
)
# Backward compatibility: if it's not a PersistentMapping instance,
# assume it's a monovalued string, which corresponds to default
# password encoding.
if
isinstance
(
password
,
PersistentMapping
):
password
=
password
.
get
(
format
,
default_password
)
password
=
password
.
get
(
format
_
,
default_password
)
else
:
if
format
!=
'default'
:
if
format
_
!=
'default'
:
password
=
default_password
return
password
...
...
bt5/erp5_base/MixinTemplateItem/portal_components/mixin.erp5.EncryptedPasswordMixin.xml
View file @
ed5af4dd
...
...
@@ -6,6 +6,12 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
EncryptedPasswordMixin
</string>
</value>
...
...
@@ -14,6 +20,12 @@
<key>
<string>
default_source_reference
</string>
</key>
<value>
<string>
Products.ERP5.mixin.encrypted_password
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
mixin.erp5.EncryptedPasswordMixin
</string>
</value>
...
...
@@ -37,11 +49,7 @@
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple>
<string>
W: 79, 39: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W: 86, 38: Redefining built-in \'format\' (redefined-builtin)
</string>
<string>
W:123, 6: Redefining built-in \'format\' (redefined-builtin)
</string>
</tuple>
<tuple/>
</value>
</item>
<item>
...
...
@@ -51,13 +59,28 @@
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
I
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
...
...
@@ -70,7 +93,7 @@
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
M
=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAA
Q
=
</string>
</persistent>
</value>
</item>
</dictionary>
...
...
@@ -79,7 +102,7 @@
</dictionary>
</pickle>
</record>
<record
id=
"
3"
aka=
"AAAAAAAAAAM
="
>
<record
id=
"
4"
aka=
"AAAAAAAAAAQ
="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/BankAccount_validateIBAN.py
View file @
ed5af4dd
...
...
@@ -67,8 +67,8 @@ iban_code = ''.join([str(letter_code_dict.get(x, x))
for
x
in
bban
+
country_code
+
checksum
])
try
:
iban_int
=
int
(
iban_code
)
iban_int
=
int
(
iban_code
)
except
ValueError
:
return
False
return
False
return
iban_int
%
97
==
1
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_changeId.py
View file @
ed5af4dd
# this script has an `id` argument
# pylint: disable=redefined-builtin
from
Products.ERP5Type.Message
import
translateString
if
id
and
id
!=
context
.
getId
():
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_createMailMessageAsString.py
View file @
ed5af4dd
...
...
@@ -23,7 +23,7 @@ if content_type == 'text/html':
else
:
mail_template
=
context
.
Event_viewMimeMessage
attachment_list
=
attachment_list
[:]
attachment_list
=
list
(
attachment_list
)
for
embedded_file
in
embedded_file_list
:
mime_type
,
content
=
embedded_file
.
getMimeTypeAndContent
()
name
=
embedded_file
.
getFilename
()
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_createMailMessageAsString.xml
View file @
ed5af4dd
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
from_url, to_url, subject, body, content_type, attachment_list=
[], embedded_file_list=[]
, extra_header_dict=None
</string>
</value>
<value>
<string>
from_url, to_url, subject, body, content_type, attachment_list=
(), embedded_file_list=()
, extra_header_dict=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_generateDomain.py
View file @
ed5af4dd
# this script has an `id` argument
# pylint: disable=redefined-builtin
domain
=
parent
.
generateTempDomain
(
id
=
id
)
domain
.
edit
(
title
=
title
,
criterion_property_list
=
[
criterion_property
])
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_getDiffBetweenDateAndNow.py
View file @
ed5af4dd
...
...
@@ -3,7 +3,7 @@ if not date:
try
:
now
=
DateTime
()
date
=
DateTime
(
date
)
except
:
except
Exception
:
return
''
Base_translateString
=
context
.
Base_translateString
diff
=
now
-
date
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Base_postQuery.py
View file @
ed5af4dd
translateString
=
context
.
Base_translateString
request
=
context
.
REQUEST
ptype
=
context
.
getPortalType
()
if
not
description
:
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/CurrencyExchange_getExchangeRateList.py
View file @
ed5af4dd
...
...
@@ -6,14 +6,14 @@
# Assumes that 2 currencies with the same ID, they are the same currency
if
from_currency
is
not
None
and
to_currency
is
not
None
and
\
[
x
for
x
in
from_currency
.
split
(
'/'
)
if
x
.
strip
()][
-
1
]
==
[
x
for
x
in
to_currency
.
split
(
'/'
)
if
x
.
strip
()][
-
1
]:
return
[
1
]
return
[
1
]
def
sort_by_date
(
a
,
b
):
if
a
.
getStartDateRangeMin
()
>
b
.
getStartDateRangeMin
()
:
return
-
1
return
1
object
=
context
object
_
=
context
from
Products.ERP5Type.Cache
import
CachingMethod
...
...
@@ -37,15 +37,15 @@ if to_currency is not None:
if
currency_exchange_type
is
not
None
:
temp_kw
[
'category_list'
].
append
(
'currency_exchange_type/%s'
%
currency_exchange_type
)
temp_object
.
edit
(
**
temp_kw
)
object
=
temp_object
mapped_value
=
context
.
portal_domains
.
generateMappedValue
(
object
,
object
_
=
temp_object
mapped_value
=
context
.
portal_domains
.
generateMappedValue
(
object
_
,
has_cell_content
=
0
,
validation_state
=
'validated'
,
sort_method
=
sort_by_date
)
base_price
=
getattr
(
mapped_value
,
'base_price'
,
None
)
discount
=
getattr
(
mapped_value
,
'discount'
,
None
)
if
base_price
is
None
and
discount
is
None
:
mapped_value
=
context
.
portal_domains
.
generateMappedValue
(
object
,
mapped_value
=
context
.
portal_domains
.
generateMappedValue
(
object
_
,
has_cell_content
=
1
,
validation_state
=
'validated'
,
sort_method
=
sort_by_date
)
...
...
@@ -63,14 +63,14 @@ else:
if
start_date
is
None
:
if
getattr
(
context
,
'isDelivery'
,
None
):
start_date
=
context
.
getStartDate
()
mapped_value
=
context
.
portal_domains
.
generateMappedValue
(
object
,
mapped_value
=
context
.
portal_domains
.
generateMappedValue
(
object
_
,
has_cell_content
=
0
,
validation_state
=
'validated'
,
sort_method
=
sort_by_date
)
base_price
=
getattr
(
mapped_value
,
'base_price'
,
None
)
discount
=
getattr
(
mapped_value
,
'discount'
,
None
)
if
base_price
is
None
and
discount
is
None
:
mapped_value
=
context
.
portal_domains
.
generateMappedValue
(
object
,
mapped_value
=
context
.
portal_domains
.
generateMappedValue
(
object
_
,
has_cell_content
=
1
,
validation_state
=
'validated'
,
sort_method
=
sort_by_date
)
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getCellGroupDivergenceList.py
View file @
ed5af4dd
...
...
@@ -16,10 +16,10 @@ for divergence in divergence_list:
uid
=
'new_%s&%s'
%
(
simulation_movement_url
,
divergence
.
getProperty
(
'tested_property'
))
objec
t
=
portal_object
.
restrictedTraverse
(
object_relative_url
)
o
=
newTempBase
(
object
.
getParentValue
(),
objec
t
.
getId
(),
uid
=
uid
,
documen
t
=
portal_object
.
restrictedTraverse
(
object_relative_url
)
o
=
newTempBase
(
document
.
getParentValue
(),
documen
t
.
getId
(),
uid
=
uid
,
message
=
str
(
divergence
.
getTranslatedMessage
()),
object_title
=
objec
t
.
getTranslatedTitle
(),
object_title
=
documen
t
.
getTranslatedTitle
(),
prevision_title
=
prevision_title
,
decision_title
=
decision_title
,
candidate_list
=
[(
context
.
Base_translateString
(
'Do nothing'
),
'ignore'
),
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getDeliveryGroupDivergenceList.py
View file @
ed5af4dd
...
...
@@ -10,14 +10,14 @@ for divergence in divergence_list:
prop
=
divergence
.
getProperty
(
'tested_property'
)
if
prop
in
(
None
,
''
)
or
divergence
.
getCollectOrderGroup
()
!=
'delivery'
:
continue
message
,
candidate_list
,
value_list
,
decision_title_list
,
prevision_title_list
=
candidate_dict
.
get
(
prop
,
[
''
,
[],
[],
[],
[]])
_
,
candidate_list
,
value_list
,
decision_title_list
,
prevision_title_list
=
candidate_dict
.
get
(
prop
,
[
''
,
[],
[],
[],
[]])
decision_value
=
divergence
.
getProperty
(
'decision_value'
)
decision_title
=
divergence
.
getProperty
(
'decision_title'
,
decision_value
)
prevision_value
=
divergence
.
getProperty
(
'prevision_value'
)
prevision_title
=
divergence
.
getProperty
(
'prevision_title'
,
prevision_value
)
object_relative_url
=
divergence
.
getProperty
(
'object_relative_url'
)
simulation_movement_url
=
divergence
.
getProperty
(
'simulation_movement'
).
getRelativeUrl
()
objec
t
=
portal_object
.
restrictedTraverse
(
object_relative_url
)
documen
t
=
portal_object
.
restrictedTraverse
(
object_relative_url
)
if
decision_value
not
in
value_list
:
candidate_list
.
append
((
decision_title
,
object_relative_url
))
value_list
.
append
(
decision_value
)
...
...
@@ -32,11 +32,11 @@ for divergence in divergence_list:
for
prop
,
candidate_list
in
candidate_dict
.
items
():
uid
=
'new_%s'
%
prop
objec
t
=
context
documen
t
=
context
o
=
newTempBase
(
context
.
getParentValue
(),
context
.
getId
(),
uid
,
uid
=
uid
,
message
=
candidate_list
[
0
],
object_title
=
objec
t
.
getTranslatedTitle
(),
object_title
=
documen
t
.
getTranslatedTitle
(),
decision_title
=
', '
.
join
([
str
(
x
)
for
x
in
candidate_list
[
3
]]),
prevision_title
=
', '
.
join
([
str
(
x
)
for
x
in
candidate_list
[
4
]]),
candidate_list
=
[(
context
.
Base_translateString
(
'Do nothing'
),
'ignore'
)]
+
candidate_list
[
1
])
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getLineGroupDivergenceList.py
View file @
ed5af4dd
...
...
@@ -17,11 +17,11 @@ for divergence in divergence_list:
uid
=
'new_%s&%s'
%
(
simulation_movement_url
,
divergence
.
getProperty
(
'tested_property'
))
objec
t
=
portal_object
.
restrictedTraverse
(
object_relative_url
)
o
=
newTempBase
(
object
.
getParentValue
(),
objec
t
.
getId
(),
uid
=
uid
,
documen
t
=
portal_object
.
restrictedTraverse
(
object_relative_url
)
o
=
newTempBase
(
document
.
getParentValue
(),
documen
t
.
getId
(),
uid
=
uid
,
message
=
str
(
divergence
.
getTranslatedMessage
()),
object_portal_type
=
objec
t
.
getTranslatedPortalType
(),
object_title
=
objec
t
.
getTranslatedTitle
(),
object_portal_type
=
documen
t
.
getTranslatedPortalType
(),
object_title
=
documen
t
.
getTranslatedTitle
(),
prevision_title
=
prevision_title
,
decision_title
=
decision_title
,
candidate_list
=
[(
context
.
Base_translateString
(
'Do nothing'
),
'ignore'
),
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Delivery_getODTDataDict.py
View file @
ed5af4dd
# coding: utf-8
translateString
=
context
.
Base_translateString
request
=
context
.
REQUEST
...
...
@@ -94,7 +95,6 @@ def getTaxLineList(order):
return
tax_line_list
line_base_contribution_list
=
[]
number
=
0
tax_free_line_totalprice
=
0
line_list
=
[]
line_not_tax
=
[]
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Document_checkConversionFormatPermission.py
View file @
ed5af4dd
# this script has an `format` argument
# pylint: disable=redefined-builtin
"""
This script provides a facility to permit conversion by format.
"""
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Document_getStandardFileName.py
View file @
ed5af4dd
# this script has an `format` argument
# pylint: disable=redefined-builtin
"""Just an alias for real script
"""
from
Products.ERP5Type.Log
import
log
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Document_getStandardFilename.py
View file @
ed5af4dd
# this script has an `format` argument
# pylint: disable=redefined-builtin
"""
This script returns a standard file name, build from reference, version and
language (this is only the base part of the name, the extension should be appended
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Type_acquireSecurityFromCategory.py
View file @
ed5af4dd
"""
WARNING: this script requires proxy manager
This script tries to acquire category values from other
objec
ts
This script tries to acquire category values from other
documen
ts
base_category_list - list of category values we need to retrieve
obj
ect - objec
t which we want to assign roles to.
obj
- documen
t which we want to assign roles to.
"""
category_dict
=
{}
if
obj
ect
is
None
:
if
obj
is
None
:
return
[]
for
base_category
in
base_category_list
:
if
base_category
==
'parent'
:
o_list
=
[
obj
ect
.
getParentValue
()]
o_list
=
[
obj
.
getParentValue
()]
else
:
o_list
=
obj
ect
.
getValueList
(
base_category
)
o_list
=
obj
.
getValueList
(
base_category
)
for
o
in
o_list
:
for
user
,
role_list
in
o
.
get_local_roles
():
for
role
in
role_list
:
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/ERP5Type_acquireSecurityFromCategory.xml
View file @
ed5af4dd
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
base_category_list, user_name, obj
ect
, portal_type
</string>
</value>
<value>
<string>
base_category_list, user_name, obj, portal_type
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/MailMessage_send.py
View file @
ed5af4dd
...
...
@@ -64,13 +64,12 @@ if download or not use_activity:
if
not
from_url
:
raise
ValueError
(
'Preferred Event Sender Email not configured'
)
# Return-Path
# Return-Path
(TODO)
if
reply_url
is
None
:
reply_url
=
portal
.
portal_preferences
.
getPreferredEventSenderEmail
()
additional_headers
=
None
additional_headers
=
None
# pylint: disable=unused-variable
if
reply_url
:
additional_headers
=
{
'Return-Path'
:
reply_url
}
content_type
=
context
.
getContentType
()
mail_message
=
context
.
Base_createMailMessageAsString
(
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Organisation_init.py
View file @
ed5af4dd
# this script can be overridden as you wish.
pass
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getCareerStartDate.py
View file @
ed5af4dd
...
...
@@ -8,7 +8,7 @@ for career_step in all_career_step_list :
career_step
.
getSubordination
()
==
subordination_relative_url
)
and
\
career_step
.
getStartDate
()
and
\
career_step
.
getValidationState
()
not
in
(
'cancelled'
,
'deleted'
):
career_step_list
.
append
(
career_step
)
career_step_list
.
append
(
career_step
)
# sort them by start date
career_step_list
.
sort
(
key
=
lambda
x
:
x
.
getStartDate
())
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedContributionList.py
View file @
ed5af4dd
from
Products.PythonScripts.standard
import
Object
from
Products.ZSQLCatalog.SQLCatalog
import
Query
from
Products.ERP5Type.DateUtils
import
atTheEndOfPeriod
request
=
container
.
REQUEST
from_date
=
request
.
get
(
'from_date'
,
None
)
...
...
@@ -8,10 +7,10 @@ aggregation_level = request.get('aggregation_level', None)
portal
=
context
.
getPortalObject
()
module_list
=
[]
for
module_id
in
portal
.
objectIds
(
spec
=
(
'ERP5 Folder'
,)):
module
=
portal
.
restrictedTraverse
(
module_id
,
None
)
if
module
is
not
None
:
if
portal
.
portal_membership
.
checkPermission
(
'View'
,
module
):
module_list
.
append
(
module
)
module
=
portal
.
restrictedTraverse
(
module_id
,
None
)
if
module
is
not
None
:
if
portal
.
portal_membership
.
checkPermission
(
'View'
,
module
):
module_list
.
append
(
module
)
module_list
.
sort
(
key
=
lambda
x
:
x
.
getTitle
())
# build document portal type list
...
...
@@ -69,25 +68,25 @@ line_list = []
append
=
line_list
.
append
period_count_dict
=
{}
for
portal_type
in
portal_type_list
:
if
portal_type_count_dict
.
has_key
(
portal_type
):
period_count
=
portal_type_count_dict
[
portal_type
]
obj
=
Object
(
uid
=
"new_"
)
obj
[
"document_type"
]
=
context
.
Base_translateString
(
portal_type
)
else
:
continue
line_counter
=
0
for
period
in
period_list
:
if
period_count
.
has_key
(
period
):
obj
[
period
]
=
period_count
[
period
]
line_counter
+=
period_count
[
period
]
if
period_count_dict
.
has_key
(
period
):
period_count_dict
[
period
]
=
period_count_dict
[
period
]
+
period_count
[
period
]
else
:
period_count_dict
[
period
]
=
period_count
[
period
]
if
portal_type_count_dict
.
has_key
(
portal_type
):
period_count
=
portal_type_count_dict
[
portal_type
]
obj
=
Object
(
uid
=
"new_"
)
obj
[
"document_type"
]
=
context
.
Base_translateString
(
portal_type
)
else
:
continue
line_counter
=
0
for
period
in
period_list
:
if
period_count
.
has_key
(
period
):
obj
[
period
]
=
period_count
[
period
]
line_counter
+=
period_count
[
period
]
if
period_count_dict
.
has_key
(
period
):
period_count_dict
[
period
]
=
period_count_dict
[
period
]
+
period_count
[
period
]
else
:
obj
[
period
]
=
0
obj
[
'total'
]
=
line_counter
append
(
obj
)
period_count_dict
[
period
]
=
period_count
[
period
]
else
:
obj
[
period
]
=
0
obj
[
'total'
]
=
line_counter
append
(
obj
)
# sort lines
def
cmpType
(
a
,
b
):
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPersonDetailedEventList.py
View file @
ed5af4dd
from
Products.ZSQLCatalog.SQLCatalog
import
Query
from
Products.ERP5Type.DateUtils
import
atTheEndOfPeriod
request
=
container
.
REQUEST
portal
=
context
.
getPortalObject
()
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_getPrimaryGroup.py
View file @
ed5af4dd
...
...
@@ -28,7 +28,7 @@ for assignment in context.contentValues(portal_type='Assignment'):
and
assignment
.
getValidationState
()
==
'open'
\
and
(
assignment
.
getStartDate
()
is
None
or
assignment
.
getStartDate
()
<=
now
<=
assignment
.
getStopDate
()):
existing_group_set
[
assignment
.
getGroup
()]
=
1
existing_group_set
[
assignment
.
getGroup
()]
=
1
# If we have multiple groups defined on assignments, this scripts does not
# try to guess, and fallback to the default career's group
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_shiftDefaultCareer.py
View file @
ed5af4dd
...
...
@@ -2,7 +2,6 @@ from Products.CMFActivity.Errors import ActivityPendingError
Base_translateString
=
context
.
Base_translateString
person
=
context
career_list
=
[]
default_career
=
None
if
'default_career'
in
person
.
objectIds
():
...
...
bt5/erp5_base/SkinTemplateItem/portal_skins/erp5_base/Person_statPersonDetailedContributionList.py
View file @
ed5af4dd
request
=
container
.
REQUEST
RESPONSE
=
request
.
RESPONSE
stat_line
=
request
.
get
(
'stat_line'
,
None
)
return
stat_line
# XXX example of another way to get the stat line but this is slower
from
Products.ERP5Type.Log
import
log
from
Products.PythonScripts.standard
import
Object
from
Products.ZSQLCatalog.SQLCatalog
import
Query
request
=
container
.
REQUEST
from_date
=
request
.
get
(
'from_date'
,
None
)
to_date
=
request
.
get
(
'at_date'
,
None
)
aggregation_level
=
request
.
get
(
'aggregation_level'
,
None
)
log
(
"in stat method"
,
""
)
# build document portal type list
portal_type_list
=
[]
extend
=
portal_type_list
.
extend
for
title
,
path
in
context
.
ERP5Site_getModuleItemList
():
document_type_list
=
context
.
restrictedTraverse
(
path
).
allowedContentTypes
()
extend
([
x
.
id
for
x
in
document_type_list
])
# compute sql params, we group and order by date and portal type
if
aggregation_level
==
"year"
:
sql_format
=
"%Y"
elif
aggregation_level
==
"month"
:
sql_format
=
"%Y-%m"
elif
aggregation_level
==
"week"
:
sql_format
=
"%Y-%u"
elif
aggregation_level
==
"day"
:
sql_format
=
"%Y-%m-%d"
count_kw
=
{}
if
from_date
is
not
None
and
to_date
is
not
None
:
count_kw
[
'creation_date'
]
=
{
'range'
:
'minngt'
,
'query'
:
(
from_date
,
to_date
),
}
elif
from_date
is
not
None
:
count_kw
[
'creation_date'
]
=
{
'range'
:
'min'
,
'query'
:
from_date
,
}
elif
to_date
is
not
None
:
count_kw
[
'creation_date'
]
=
{
'range'
:
'ngt'
,
'query'
:
to_date
,
}
# count number of object created by the user for each type of document
result_list
=
context
.
portal_catalog
.
countResults
(
select_dict
=
{
'date'
:
'DATE_FORMAT(creation_date, "%s")'
%
sql_format
},
portal_type
=
portal_type_list
,
limit
=
None
,
owner
=
context
.
Person_getUserId
(),
group_by
=
[
'DATE_FORMAT(creation_date, "%s")'
%
sql_format
],
**
count_kw
)
# build result dict per portal_type then period
period_count_dict
=
{}
for
result
in
result_list
:
period_count_dict
[
result
[
1
]]
=
result
[
0
]
# build line
obj
=
Object
(
uid
=
"new_"
)
obj
[
"document_type"
]
=
'Total'
line_counter
=
0
for
period
in
period_list
:
if
period_count_dict
.
has_key
(
period
):
obj
[
period
]
=
period_count_dict
[
period
]
line_counter
+=
period_count_dict
[
period
]
else
:
obj
[
period
]
=
0
obj
[
'total'
]
=
line_counter
return
[
obj
,]
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/currency_exchange_line_interaction_workflow/scripts/CurrencyExchangeLine_updateMatrix.py
View file @
ed5af4dd
...
...
@@ -14,9 +14,8 @@ context.setMembershipCriterionCategoryList(membership_list)
context
.
setResourceValue
(
context
.
getParentValue
())
context
.
setMappedValuePropertyList
((
'base_price'
,
'discount'
))
if
cell_range_key_list
!=
[[
None
,
None
]]
:
i
=
0
for
k
in
cell_range_key_list
:
category_list
=
filter
(
lambda
k_item
:
k_item
is
not
None
,
k
)
category_list
=
[
k_item
for
k_item
in
k
if
k
is
not
None
]
c
=
context
.
newCell
(
*
k
,
**
kwd
)
c
.
edit
(
mapped_value_property_list
=
(
'base_price'
,
'discount'
),
force_update
=
1
,
...
...
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Delivery_callSolveDivergenceTransition.py
View file @
ed5af4dd
...
...
@@ -13,8 +13,7 @@ if listbox is not None:
for
k
,
v
in
listbox
.
items
():
object_url
=
v
[
'choice'
]
if
object_url
!=
'ignore'
:
object
=
delivery
.
restrictedTraverse
(
object_url
)
delivery_solve_property_dict
[
k
]
=
object
.
getPropertyList
(
k
)
delivery_solve_property_dict
[
k
]
=
delivery
.
restrictedTraverse
(
object_url
).
getPropertyList
(
k
)
divergence_to_accept_list
=
[]
divergence_to_adopt_list
=
[]
...
...
@@ -22,8 +21,7 @@ divergence_to_adopt_list = []
divergence_dict
=
{}
for
divergence
in
divergence_list
:
simulation_movement_url
=
divergence
.
getProperty
(
'simulation_movement'
).
getRelativeUrl
()
property
=
divergence
.
getProperty
(
'tested_property'
)
divergence_dict
[
'%s&%s'
%
(
simulation_movement_url
,
property
)]
=
divergence
divergence_dict
[
'%s&%s'
%
(
simulation_movement_url
,
divergence
.
getProperty
(
'tested_property'
))]
=
divergence
for
listbox
in
[
state_change
[
'kwargs'
].
get
(
'line_group_listbox'
),
state_change
[
'kwargs'
].
get
(
'cell_group_listbox'
)]:
...
...
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Delivery_callSplitAndDeferTransition.py
View file @
ed5af4dd
...
...
@@ -3,8 +3,6 @@ delivery = state_change['object']
stop_date
=
state_change
.
kwargs
[
'stop_date'
]
start_date
=
state_change
.
kwargs
[
'start_date'
]
tag
=
delivery
.
getPath
()
+
'_split'
split_and_defer
=
0
listbox
=
state_change
[
'kwargs'
].
get
(
'listbox'
)
split_movement_list
=
[]
if
listbox
is
not
None
:
...
...
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Delivery_splitAndDefer.py
View file @
ed5af4dd
...
...
@@ -19,10 +19,10 @@ delivery.activate(after_tag=tag).updateCausalityState()
# Create delivery
explanation_uid_list
=
[]
object
=
delivery
while
object
is
not
None
:
explanation_uid_list
.
append
(
object
.
getUid
())
object
=
object
.
getCausalityValue
()
object
_
=
delivery
while
object
_
is
not
None
:
explanation_uid_list
.
append
(
object
_
.
getUid
())
object
_
=
object_
.
getCausalityValue
()
previous_tag
=
None
for
delivery_builder
in
delivery
.
getBuilderList
():
...
...
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/delivery_causality_workflow/scripts/Workflow_solveDivergenceAutomatically.py
View file @
ed5af4dd
delivery
=
state_change
[
'object'
]
portal
=
delivery
.
getPortalObject
()
try
:
portal
.
portal_solvers
portal
.
portal_solver_processes
except
AttributeError
:
if
not
(
hasattr
(
portal
,
'portal_solvers'
)
and
hasattr
(
portal
,
'portal_solver_processes'
)):
delivery
.
diverge
()
else
:
solver_tag
=
'%s_solve'
%
delivery
.
getPath
()
...
...
bt5/erp5_base/WorkflowTemplateItem/portal_workflow/query_workflow/scripts/notifyOwner.py
View file @
ed5af4dd
...
...
@@ -7,12 +7,12 @@ catalog.
"""
from
Products.ERP5Type.Log
import
log
objec
t
=
sci
[
'object'
]
portal
=
objec
t
.
getPortalObject
()
documen
t
=
sci
[
'object'
]
portal
=
documen
t
.
getPortalObject
()
translateString
=
portal
.
Base_translateString
# Get the owner
owner
=
objec
t
.
getViewPermissionOwner
()
owner
=
documen
t
.
getViewPermissionOwner
()
owner_value
=
portal
.
Base_getUserValueByUserId
(
owner
)
# Get the authenticated user
...
...
@@ -43,11 +43,11 @@ Answer:
${answer}
"""
msg
=
translateString
(
msg
,
mapping
=
dict
(
id
=
objec
t
.
getId
(),
mapping
=
dict
(
id
=
documen
t
.
getId
(),
subject
=
subject
,
user
=
user_value
.
getTitle
(),
question
=
objec
t
.
getDescription
(),
answer
=
objec
t
.
getTextContent
())
question
=
documen
t
.
getDescription
(),
answer
=
documen
t
.
getTextContent
())
)
# We can now notify the owner through the notification tool
...
...
bt5/erp5_base/bt/skip_coding_style_test
deleted
100644 → 0
View file @
cdae0727
1
\ No newline at end of file
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