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
137
Merge Requests
137
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
15d6c4af
Commit
15d6c4af
authored
Jul 31, 2024
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code.
parent
03d7a2bc
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
150 additions
and
296 deletions
+150
-296
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testDateUtils.py
...TemplateItem/portal_components/test.erp5.testDateUtils.py
+2
-15
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
...tTemplateItem/portal_components/test.erp5.testERP5Type.py
+15
-60
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity_web/WebSite_setOpenGraphMeta.py
...s/erp5_corporate_identity_web/WebSite_setOpenGraphMeta.py
+0
-16
bt5/erp5_crm/TestTemplateItem/portal_components/test.erp5.testCrmReports.py
...emplateItem/portal_components/test.erp5.testCrmReports.py
+0
-31
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testDms.py
...s/TestTemplateItem/portal_components/test.erp5.testDms.py
+2
-6
bt5/erp5_forge/ExtensionTemplateItem/portal_components/extension.erp5.PythonScriptParserUtility.py
...al_components/extension.erp5.PythonScriptParserUtility.py
+4
-0
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.Git.py
...omponentTemplateItem/portal_components/module.erp5.Git.py
+0
-1
bt5/erp5_run_my_doc/ExtensionTemplateItem/portal_components/extension.erp5.ERP5RunMyDocs.py
...ateItem/portal_components/extension.erp5.ERP5RunMyDocs.py
+0
-23
bt5/erp5_syncml/MixinTemplateItem/portal_components/mixin.erp5.SyncMLEngineMixin.py
...ateItem/portal_components/mixin.erp5.SyncMLEngineMixin.py
+4
-5
bt5/erp5_syncml/ModuleComponentTemplateItem/portal_components/module.erp5.SyncMLMessage.py
...mplateItem/portal_components/module.erp5.SyncMLMessage.py
+88
-90
bt5/erp5_web/ModuleComponentTemplateItem/portal_components/module.erp5.TransformHtmlToPdf.py
...eItem/portal_components/module.erp5.TransformHtmlToPdf.py
+0
-2
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Order.py
...mentTemplateItem/portal_components/document.erp5.Order.py
+35
-37
product/ERP5OOo/FormPrintout.py
product/ERP5OOo/FormPrintout.py
+0
-8
product/ERP5OOo/tests/testFormPrintoutAsODG.py
product/ERP5OOo/tests/testFormPrintoutAsODG.py
+0
-2
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testDateUtils.py
View file @
15d6c4af
...
...
@@ -360,21 +360,8 @@ def test_suite():
testTimezoneNaiveHandling
=
unittest
.
expectedFailure
(
test_datetime
.
DateTimeTests
.
testTimezoneNaiveHandling
)
# This test is only in DateTime >= 3
if
hasattr
(
test_datetime
.
DateTimeTests
,
'test_intl_format_hyphen'
):
test_intl_format_hyphen
=
unittest
.
expectedFailure
(
test_datetime
.
DateTimeTests
.
test_intl_format_hyphen
)
# These 3 tests are only in DateTime 2
if
hasattr
(
test_datetime
.
DateTimeTests
,
'test_pickle_new_with_micros'
):
test_pickle_new_with_micros
=
unittest
.
expectedFailure
(
test_datetime
.
DateTimeTests
.
test_pickle_new_with_micros
)
if
hasattr
(
test_datetime
.
DateTimeTests
,
'test_pickle_new_with_tz'
):
test_pickle_new_with_tz
=
unittest
.
expectedFailure
(
test_datetime
.
DateTimeTests
.
test_pickle_new_with_tz
)
if
hasattr
(
test_datetime
.
DateTimeTests
,
'testLegacyTimezones'
):
testLegacyTimezones
=
unittest
.
expectedFailure
(
test_datetime
.
DateTimeTests
.
testLegacyTimezones
)
test_intl_format_hyphen
=
unittest
.
expectedFailure
(
test_datetime
.
DateTimeTests
.
test_intl_format_hyphen
)
suite
.
addTest
(
unittest
.
makeSuite
(
DateTimeTests
))
...
...
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Type.py
View file @
15d6c4af
...
...
@@ -48,7 +48,7 @@ from AccessControl import Unauthorized
from
AccessControl.ZopeGuards
import
guarded_getattr
,
guarded_hasattr
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
Products.ERP5Type.tests.utils
import
removeZODBPythonScript
from
Products.ERP5Type
import
IS_ZOPE2
,
Permissions
from
Products.ERP5Type
import
Permissions
from
DateTime
import
DateTime
class
PropertySheetTestCase
(
ERP5TypeTestCase
):
...
...
@@ -3310,39 +3310,9 @@ def test_suite():
add_tests
(
suite
,
ZPublisher
.
tests
.
testHTTPRangeSupport
)
import
ZPublisher.tests.testHTTPRequest
if
IS_ZOPE2
:
# BBB Zope2
# ERP5 processes requests as utf-8 by default, but we adjust this test assuming that
# default is iso-8859-15
def
forceISO885915DefaultRequestCharset
(
method
):
def
wrapped
(
self
):
from
ZPublisher
import
HTTPRequest
as
module
old_encoding
=
module
.
default_encoding
module
.
default_encoding
=
'iso-8859-15'
try
:
return
method
(
self
)
finally
:
module
.
default_encoding
=
old_encoding
return
wrapped
HTTPRequestTests
=
ZPublisher
.
tests
.
testHTTPRequest
.
HTTPRequestTests
for
e
in
dir
(
HTTPRequestTests
):
if
e
.
startswith
(
'test_'
):
setattr
(
HTTPRequestTests
,
e
,
forceISO885915DefaultRequestCharset
(
getattr
(
HTTPRequestTests
,
e
)))
add_tests
(
suite
,
ZPublisher
.
tests
.
testHTTPRequest
)
import
ZPublisher.tests.testHTTPResponse
if
IS_ZOPE2
:
# BBB Zope2
# ERP5 forces utf-8 responses by default, but we adjust these tests so that they run
# with iso-8859-15 as default response charset
def
forceISO885915DefaultResponseCharset
(
method
):
def
wrapped
(
self
):
# here we can use this utility method which clean up at teardown
self
.
_setDefaultEncoding
(
'iso-8859-15'
)
return
method
(
self
)
return
wrapped
HTTPResponseTests
=
ZPublisher
.
tests
.
testHTTPResponse
.
HTTPResponseTests
for
e
in
dir
(
HTTPResponseTests
):
if
e
.
startswith
(
'test_'
):
setattr
(
HTTPResponseTests
,
e
,
forceISO885915DefaultResponseCharset
(
getattr
(
HTTPResponseTests
,
e
)))
add_tests
(
suite
,
ZPublisher
.
tests
.
testHTTPResponse
)
import
ZPublisher.tests.testIterators
...
...
@@ -3351,42 +3321,27 @@ def test_suite():
import
ZPublisher.tests.testPostTraversal
add_tests
(
suite
,
ZPublisher
.
tests
.
testPostTraversal
)
if
IS_ZOPE2
:
# BBB Zope2
import
ZPublisher.tests.testPublish
# pylint:disable=no-name-in-module,import-error
add_tests
(
suite
,
ZPublisher
.
tests
.
testPublish
)
import
ZPublisher.tests.test_Converters
add_tests
(
suite
,
ZPublisher
.
tests
.
test_Converters
)
if
IS_ZOPE2
:
# BBB Zope2
# XXX don't run test_WSGIPublisher for now because too many failures
pass
else
:
import
ZPublisher.tests.test_WSGIPublisher
# TestLoadApp tests are confused because running as a live test interfere with
# transaction system. Aborting the transaction at beginning of test seems OK.
TestLoadApp_setUp
=
ZPublisher
.
tests
.
test_WSGIPublisher
.
TestLoadApp
.
setUp
def
setUp
(
self
):
TestLoadApp_setUp
(
self
)
transaction
.
abort
()
ZPublisher
.
tests
.
test_WSGIPublisher
.
TestLoadApp
.
setUp
=
setUp
add_tests
(
suite
,
ZPublisher
.
tests
.
test_WSGIPublisher
)
import
ZPublisher.tests.test_WSGIPublisher
# TestLoadApp tests are confused because running as a live test interfere with
# transaction system. Aborting the transaction at beginning of test seems OK.
TestLoadApp_setUp
=
ZPublisher
.
tests
.
test_WSGIPublisher
.
TestLoadApp
.
setUp
def
setUp
(
self
):
TestLoadApp_setUp
(
self
)
transaction
.
abort
()
ZPublisher
.
tests
.
test_WSGIPublisher
.
TestLoadApp
.
setUp
=
setUp
add_tests
(
suite
,
ZPublisher
.
tests
.
test_WSGIPublisher
)
import
ZPublisher.tests.test_mapply
add_tests
(
suite
,
ZPublisher
.
tests
.
test_mapply
)
if
IS_ZOPE2
:
# BBB Zope2
import
ZPublisher.tests.testpubevents
# pylint:disable=no-name-in-module,import-error
add_tests
(
suite
,
ZPublisher
.
tests
.
testpubevents
)
else
:
import
ZPublisher.tests.test_pubevents
add_tests
(
suite
,
ZPublisher
.
tests
.
test_pubevents
)
if
IS_ZOPE2
:
# BBB Zope2
pass
else
:
import
ZPublisher.tests.test_utils
add_tests
(
suite
,
ZPublisher
.
tests
.
test_utils
)
import
ZPublisher.tests.test_pubevents
add_tests
(
suite
,
ZPublisher
.
tests
.
test_pubevents
)
import
ZPublisher.tests.test_utils
add_tests
(
suite
,
ZPublisher
.
tests
.
test_utils
)
import
ZPublisher.tests.test_xmlrpc
add_tests
(
suite
,
ZPublisher
.
tests
.
test_xmlrpc
)
...
...
bt5/erp5_corporate_identity/SkinTemplateItem/portal_skins/erp5_corporate_identity_web/WebSite_setOpenGraphMeta.py
View file @
15d6c4af
...
...
@@ -71,24 +71,8 @@ if portal_type == 'Web Page':
if
portal_type
==
'Web Section'
:
websection
=
context
return
generateOpenGraphParamaters
(
websection
)
"""
default_document = websection.getDefaultDocumentValue()
if default_document is not None:
return generateOpenGraphParamaters(default_document, True)
else:
return generateOpenGraphParamaters(websection)
"""
if
portal_type
==
'Web Site'
:
return
generateOpenGraphParamaters
(
website
)
"""
default_document = website.getDefaultDocumentValue()
if default_document is not None:
return generateOpenGraphParamaters(default_document, True)
else:
return generateOpenGraphParamaters(website)
"""
return
''
bt5/erp5_crm/TestTemplateItem/portal_components/test.erp5.testCrmReports.py
View file @
15d6c4af
...
...
@@ -111,36 +111,17 @@ class CrmTestCase(ERP5ReportTestCase):
if
simulation_state
==
'assigned'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ticket=self.portal.restrictedTraverse(ev.getFollowUp())
self._doWorkflowAction(ev,'assign_action',
follow_up_ticket_type = ticket.getPortalType(),
follow_up_ticket_title = ticket.getTitle())
"""
elif
simulation_state
==
'planned'
:
ev
.
plan
()
elif
simulation_state
==
'posted'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.start()
"""
elif
simulation_state
==
'delivered'
:
ev
.
start
()
ev
.
deliver
()
elif
simulation_state
==
'new'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.receive()
"""
elif
simulation_state
==
'acknowledged'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ticket=self.portal.restrictedTraverse(ev.getFollowUp())
self._doWorkflowAction(ev,'assign_action',
follow_up_ticket_type = ticket.getPortalType(),
follow_up_ticket_title = ticket.getTitle())
self._doWorkflowAction(ev, 'acknowledge_action')
"""
elif
simulation_state
==
'cancelled'
:
ev
.
stop
()
ev
.
cancel
()
...
...
@@ -148,24 +129,12 @@ class CrmTestCase(ERP5ReportTestCase):
ev
.
delete
()
elif
simulation_state
==
'expired'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.receive()
ev.expire()
"""
elif
simulation_state
==
'responded'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.receive()
ev.respond()
"""
elif
simulation_state
==
'started'
:
ev
.
start
()
elif
simulation_state
==
'ordered'
:
raise
NotImplementedError
(
'%r state only exists in the old event workflow.'
%
simulation_state
)
"""
ev.plan()
ev.order()
"""
elif
simulation_state
==
'stopped'
:
ev
.
stop
()
# sanity check
...
...
bt5/erp5_dms/TestTemplateItem/portal_components/test.erp5.testDms.py
View file @
15d6c4af
...
...
@@ -653,12 +653,8 @@ class TestDocument(TestDocumentMixin):
self
.
assertEqual
(
'attachment; filename="import.file.with.dot.in.filename.pdf"'
,
response
.
getHeader
(
'content-disposition'
))
response_body
=
response
.
getBody
()
conversion
=
str
(
doc
.
convert
(
'pdf'
)[
1
])
diff
=
'
\
n
'
+
'
\
n
'
.
join
(
difflib
.
unified_diff
(
response_body
.
splitlines
(),
conversion
.
splitlines
(),
fromfile
=
'first_call.pdf'
,
tofile
=
'second_call.pdf'
))
self
.
assertEqual
(
response_body
,
conversion
,
diff
)
conversion
=
doc
.
convert
(
'pdf'
)[
1
]
self
.
assertEqual
(
response_body
,
conversion
)
# test Print icon works on OOoDocument
response
=
self
.
publish
(
'%s/OOoDocument_print'
%
doc
.
getPath
())
...
...
bt5/erp5_forge/ExtensionTemplateItem/portal_components/extension.erp5.PythonScriptParserUtility.py
View file @
15d6c4af
# TODO: this module is not tested and has not been ported to python3, it's not
# clear if this is still useful so disable pylint errors:
#
# pylint:disable=import-error
import
compiler
import
compiler.ast
import
compiler.visitor
...
...
bt5/erp5_forge/ModuleComponentTemplateItem/portal_components/module.erp5.Git.py
View file @
15d6c4af
...
...
@@ -362,7 +362,6 @@ class Git(WorkingCopy):
raise
# try to update our working copy
# TODO: find a solution if there are other local changes
# TODO: solve conflicts on */bt/revision automatically
try:
self.git(merge, '
@
{
u
}
', env=env)
except GitError as e:
...
...
bt5/erp5_run_my_doc/ExtensionTemplateItem/portal_components/extension.erp5.ERP5RunMyDocs.py
View file @
15d6c4af
...
...
@@ -29,29 +29,6 @@ def parseTestReport(text):
row_report
[
"cell_list"
].
append
(
column
.
text
)
i
+=
1
return
report
"""
title = table.xpath('//td')[0].text
html[0][1].text = title
# Insert completly the first table
html[1].append(table)
# Insert only the content of tbody
for table in table_list[1:]:
for row in table[-1]:
html[1][-1].append(row)
stack = [html[1]]
# Let's display everything in the test by removing the style attributes (they're not supposed to have any style attributes at all during the tests)
while stack:
element = stack.pop()
if element.attrib.has_key('style'):
del element.attrib['style']
for child in element:
stack.append(child)
return dict(title = title, text = lxml.html.tostring(html))
"""
"""
Return the content of a web page
...
...
bt5/erp5_syncml/MixinTemplateItem/portal_components/mixin.erp5.SyncMLEngineMixin.py
View file @
15d6c4af
...
...
@@ -76,11 +76,10 @@ class SyncMLEngineMixin(object):
status
[
'authentication_type'
]))
# XXX Not working To Review !
raise
NotImplementedError
(
"Adding credentials"
)
"""
syncml_response = domain.generateBaseResponse()
syncml_response.addCredentialMessage(domain)
return syncml_response
"""
# syncml_response = domain.generateBaseResponse()
# syncml_response.addCredentialMessage(domain)
# return syncml_response
elif
status
[
'status_code'
]
==
\
resolveSyncmlStatusCode
(
'invalid_credentials'
):
syncml_logger
.
error
(
"
\
t
Client authentication refused"
)
...
...
bt5/erp5_syncml/ModuleComponentTemplateItem/portal_components/module.erp5.SyncMLMessage.py
View file @
15d6c4af
...
...
@@ -225,41 +225,41 @@ class SyncMLResponse(object):
receiving a challenge message
"""
raise
NotImplementedError
(
"To review"
)
"""
# create element 'SyncML' with a default namespace
xml = E.SyncML()
# syncml header
xml.append(self.buildHeader(
session_id=subscription.incrementSessionId(),
msg_id=subscription.incrementMessageId(),
target=subscription.getUrlString(),
source=subscription.getSubscriptionUrlString(),
user_id=subscription.getUserId(),
password=subscription.getPassword(),
authentication_format=subscription.getAuthenticationFormat(),
authentication_type=subscription.getAuthenticationType()))
# Build the message body
sync_body = E.SyncBody()
# alert message
sync_body.append(self.buildAlertMessage(
command_id=self._getNextCommandId(),
alert_code=subscription.getSyncmlAlertCode(),
target=subscription.getDestinationReference(),
source=subscription.getSourceReference(),
last_anchor=subscription.getLastAnchor(),
next_anchor=subscription.getNextAnchor()))
syncml_put = self.buildPutMessage(subscription)
if syncml_put is not None:
sync_body.append(syncml_put)
sync_body.append(E.Final())
xml.append(sync_body)
xml_string = etree.tostring(xml, encoding='utf-8', xml_declaration=True,
pretty_print=True)
self.data_append(xml_string)
"""
#
# create element 'SyncML' with a default namespace
#
xml = E.SyncML()
#
# syncml header
#
xml.append(self.buildHeader(
#
session_id=subscription.incrementSessionId(),
#
msg_id=subscription.incrementMessageId(),
#
target=subscription.getUrlString(),
#
source=subscription.getSubscriptionUrlString(),
#
user_id=subscription.getUserId(),
#
password=subscription.getPassword(),
#
authentication_format=subscription.getAuthenticationFormat(),
#
authentication_type=subscription.getAuthenticationType()))
#
#
# Build the message body
#
sync_body = E.SyncBody()
#
#
# alert message
#
sync_body.append(self.buildAlertMessage(
#
command_id=self._getNextCommandId(),
#
alert_code=subscription.getSyncmlAlertCode(),
#
target=subscription.getDestinationReference(),
#
source=subscription.getSourceReference(),
#
last_anchor=subscription.getLastAnchor(),
#
next_anchor=subscription.getNextAnchor()))
#
syncml_put = self.buildPutMessage(subscription)
#
if syncml_put is not None:
#
sync_body.append(syncml_put)
#
sync_body.append(E.Final())
#
#
xml.append(sync_body)
#
xml_string = etree.tostring(xml, encoding='utf-8', xml_declaration=True,
#
pretty_print=True)
#
self.data_append(xml_string)
def
addPutMessage
(
self
,
subscription
,
markup
=
'Put'
,
cmd_ref
=
None
,
message_id
=
None
):
...
...
@@ -280,61 +280,59 @@ class SyncMLResponse(object):
Both must be able to handle and process these informations
"""
return
"""
# XXX-Aurel : must be reviewed according to specification
# This part can be skipped for now
conduit = subscription.getConduit()
xml = None
# The conduit defined what capabilities the service offers
if getattr(conduit, 'getCapabilitiesCTTypeList', None) and
\
getattr(conduit, 'getCapabilitiesVerCTList', None) and
\
getattr(conduit, 'getPreferedCapabilitieVerCT', None):
xml = Element('{%s}%s' % (SYNCML_NAMESPACE, markup))
xml.append(E.CmdID(self._getNextCommandId()))
if message_id:
xml.append(E.MsgRef('%s' % message_id))
if cmd_ref:
xml.append(E.CmdRef('%s' % cmd_ref))
xml.extend((E.Meta(E.Type('application/vnd.syncml-devinf+xml')),
E.Item(E.Source(E.LocURI('./devinf12')),
E.Data(E.DevInf(E.VerDTD('1.2'),
E.Man('Nexedi'),
E.Mod('ERP5SyncML'),
E.OEM('Open Source'),
E.SwV('0.1'),
E.DevID(subscription.getSubscriptionUrlString()),
E.DevTyp('workstation'),
E.UTC(),
E.DataStore(E.SourceRef(subscription.getSourceReference()))
)
)
)))
data_store = xml.find('{%(ns)s}Item/{%(ns)s}Data/{%(ns)s}DevInf/{%(ns)s}DataStore' % {'ns': SYNCML_NAMESPACE})
tx_element_list = []
rx_element_list = []
for cttype in conduit.getCapabilitiesCTTypeList():
if cttype != 'text/xml':
for x_version in conduit.getCapabilitiesVerCTList(cttype):
rx_element_list.append(E.Rx(E.CTType(cttype), E.VerCT(x_version)))
tx_element_list.append(E.Tx(E.CTType(cttype), E.VerCT(x_version)))
rx_pref = Element('{%s}Rx-Pref' % SYNCML_NAMESPACE)
rx_pref.extend((E.CTType(conduit.getPreferedCapabilitieCTType()),
E.VerCT(conduit.getPreferedCapabilitieVerCT())))
data_store.append(rx_pref)
data_store.extend(rx_element_list)
tx_pref = Element('{%s}Tx-Pref' % SYNCML_NAMESPACE)
tx_pref.extend((E.CTType(conduit.getPreferedCapabilitieCTType()),
E.VerCT(conduit.getPreferedCapabilitieVerCT())))
data_store.append(tx_pref)
data_store.extend(tx_element_list)
data_store.append(E.SyncCap(
E.SyncType('2'),
E.SyncType('1'),
E.SyncType('4'),
E.SyncType('6')
))
self.data_append(xml)
"""
# # XXX-Aurel : must be reviewed according to specification
# # This part can be skipped for now
# conduit = subscription.getConduit()
# xml = None
# # The conduit defined what capabilities the service offers
# if getattr(conduit, 'getCapabilitiesCTTypeList', None) and \
# getattr(conduit, 'getCapabilitiesVerCTList', None) and \
# getattr(conduit, 'getPreferedCapabilitieVerCT', None):
# xml = Element('{%s}%s' % (SYNCML_NAMESPACE, markup))
# xml.append(E.CmdID(self._getNextCommandId()))
# if message_id:
# xml.append(E.MsgRef('%s' % message_id))
# if cmd_ref:
# xml.append(E.CmdRef('%s' % cmd_ref))
# xml.extend((E.Meta(E.Type('application/vnd.syncml-devinf+xml')),
# E.Item(E.Source(E.LocURI('./devinf12')),
# E.Data(E.DevInf(E.VerDTD('1.2'),
# E.Man('Nexedi'),
# E.Mod('ERP5SyncML'),
# E.OEM('Open Source'),
# E.SwV('0.1'),
# E.DevID(subscription.getSubscriptionUrlString()),
# E.DevTyp('workstation'),
# E.UTC(),
# E.DataStore(E.SourceRef(subscription.getSourceReference()))
# )
# )
# )))
# data_store = xml.find('{%(ns)s}Item/{%(ns)s}Data/{%(ns)s}DevInf/{%(ns)s}DataStore' % {'ns': SYNCML_NAMESPACE})
# tx_element_list = []
# rx_element_list = []
# for cttype in conduit.getCapabilitiesCTTypeList():
# if cttype != 'text/xml':
# for x_version in conduit.getCapabilitiesVerCTList(cttype):
# rx_element_list.append(E.Rx(E.CTType(cttype), E.VerCT(x_version)))
# tx_element_list.append(E.Tx(E.CTType(cttype), E.VerCT(x_version)))
# rx_pref = Element('{%s}Rx-Pref' % SYNCML_NAMESPACE)
# rx_pref.extend((E.CTType(conduit.getPreferedCapabilitieCTType()),
# E.VerCT(conduit.getPreferedCapabilitieVerCT())))
# data_store.append(rx_pref)
# data_store.extend(rx_element_list)
# tx_pref = Element('{%s}Tx-Pref' % SYNCML_NAMESPACE)
# tx_pref.extend((E.CTType(conduit.getPreferedCapabilitieCTType()),
# E.VerCT(conduit.getPreferedCapabilitieVerCT())))
# data_store.append(tx_pref)
# data_store.extend(tx_element_list)
# data_store.append(E.SyncCap(
# E.SyncType('2'),
# E.SyncType('1'),
# E.SyncType('4'),
# E.SyncType('6')
# ))
# self.data_append(xml)
def
addSyncCommand
(
self
,
sync_command
,
gid
,
data
,
media_type
,
more_data
):
...
...
bt5/erp5_web/ModuleComponentTemplateItem/portal_components/module.erp5.TransformHtmlToPdf.py
View file @
15d6c4af
...
...
@@ -23,8 +23,6 @@ class TransformHtmlToPdf(DocumentConversionServerTransform):
# wkhtmltopdf handler currently requires conversion_kw (hack in convertFile())...
if
'conversion_kw'
not
in
kwargs
:
kwargs
[
'conversion_kw'
]
=
{
'encoding'
:
'utf-8'
}
# raise RuntimeError
return
DocumentConversionServerTransform
.
convert
(
self
,
*
args
,
**
kwargs
)
def
register
():
...
...
product/ERP5/bootstrap/erp5_core/DocumentTemplateItem/portal_components/document.erp5.Order.py
View file @
15d6c4af
...
...
@@ -80,43 +80,41 @@ class Order(Delivery):
# Call getAggregatedAmountList and sum all the amounts which
# base_contribution category is matched with.
raise
NotImplementedError
"""
rounding = kw.get('rounding')
from Products.ERP5.PropertySheet.TradeModelLine import TARGET_LEVEL_MOVEMENT
trade_condition = self.getSpecialiseValue()
if trade_condition is None:
# We cannot find any amount so that the result is 0.
return 0
base_contribution = kw.get('base_contribution')
if isinstance(base_contribution, (tuple, list)):
base_contribution_list = base_contribution
else:
base_contribution_list = (base_contribution,)
base_contribution_value_list = []
portal_categories = self.portal_categories
for relative_url in base_contribution_list:
base_contribution_value = portal_categories.getCategoryValue(relative_url)
if base_contribution_value is not None:
base_contribution_value_list.append(base_contribution_value)
if not base_contribution_value_list:
# We cannot find any amount so that the result is 0.
return 0
current_aggregated_amount_list = trade_condition.getAggregatedAmountList(self, rounding=rounding, force_create_line=True)
trade_model_line = self.newContent(temp_object=True,
portal_type='Trade Model Line',
id='_temp_' + self.getId(), notify_workflow=False)
# prevent invoking interaction workflows.
trade_model_line.portal_type = ''
trade_model_line.edit(target_level=TARGET_LEVEL_MOVEMENT, price=1,
efficiency=1, quantity=None,
base_application_value_list=base_contribution_value_list)
aggregated_amount_list = trade_model_line._getAggregatedAmountList(
self,
movement_list=self.getMovementList(),
current_aggregated_amount_list=current_aggregated_amount_list,
rounding=rounding)
return aggregated_amount_list.getTotalPrice()
"""
# rounding = kw.get('rounding')
# from Products.ERP5.PropertySheet.TradeModelLine import TARGET_LEVEL_MOVEMENT
# trade_condition = self.getSpecialiseValue()
# if trade_condition is None:
# # We cannot find any amount so that the result is 0.
# return 0
# base_contribution = kw.get('base_contribution')
# if isinstance(base_contribution, (tuple, list)):
# base_contribution_list = base_contribution
# else:
# base_contribution_list = (base_contribution,)
# base_contribution_value_list = []
# portal_categories = self.portal_categories
# for relative_url in base_contribution_list:
# base_contribution_value = portal_categories.getCategoryValue(relative_url)
# if base_contribution_value is not None:
# base_contribution_value_list.append(base_contribution_value)
# if not base_contribution_value_list:
# # We cannot find any amount so that the result is 0.
# return 0
# current_aggregated_amount_list = trade_condition.getAggregatedAmountList(self, rounding=rounding, force_create_line=True)
# trade_model_line = self.newContent(temp_object=True,
# portal_type='Trade Model Line',
# id='_temp_' + self.getId(), notify_workflow=False)
# # prevent invoking interaction workflows.
# trade_model_line.portal_type = ''
# trade_model_line.edit(target_level=TARGET_LEVEL_MOVEMENT, price=1,
# efficiency=1, quantity=None,
# base_application_value_list=base_contribution_value_list)
# aggregated_amount_list = trade_model_line._getAggregatedAmountList(
# self,
# movement_list=self.getMovementList(),
# current_aggregated_amount_list=current_aggregated_amount_list,
# rounding=rounding)
# return aggregated_amount_list.getTotalPrice()
def
getTotalQuantity
(
self
,
**
kw
)
:
"""Returns the total quantity for this Order. """
...
...
product/ERP5OOo/FormPrintout.py
View file @
15d6c4af
...
...
@@ -891,14 +891,6 @@ class ODFStrategy(Implicit):
column_span_list.append(column_span)
return column_span_list
def _toUnicodeString(self, field_value = None):
value = ''
if isinstance(field_value, six.text_type):
value = field_value
elif field_value is not None:
value = unicode(str(field_value), 'utf-8')
return value
class ODTStrategy(ODFStrategy):
"""ODTStrategy create a ODT Document from a form and a ODT template"""
...
...
product/ERP5OOo/tests/testFormPrintoutAsODG.py
View file @
15d6c4af
...
...
@@ -161,7 +161,6 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
# 2. Normal case: change the field value and check again the ODF document
test1
.
setTitle
(
"Changed Title!"
)
#foo_form.my_title.set_value('default', "Changed Title!")
odf_document
=
foo_printout
.
index_html
(
request
)
self
.
assertTrue
(
odf_document
is
not
None
)
builder
=
OOoBuilder
(
odf_document
)
...
...
@@ -412,7 +411,6 @@ class TestFormPrintoutAsODG(TestFormPrintoutMixin):
# 2. Normal case: change the field value and check again the ODF document
test1
.
setTitle
(
"Changed Title!"
)
#foo_form.my_title.set_value('default', "Changed Title!")
odf_document
=
foo_printout
.
index_html
(
request
)
self
.
assertTrue
(
odf_document
is
not
None
)
builder
=
OOoBuilder
(
odf_document
)
...
...
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