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
Nikola Balog
erp5
Commits
7e76a151
Commit
7e76a151
authored
May 07, 2011
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style: remove tabs in product/*.py
parent
d452eb6e
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
158 additions
and
159 deletions
+158
-159
product/ERP5/Document/AttributeUnicityConstraint.py
product/ERP5/Document/AttributeUnicityConstraint.py
+1
-1
product/ERP5/Document/CategoryRelatedMembershipStateConstraint.py
...ERP5/Document/CategoryRelatedMembershipStateConstraint.py
+1
-1
product/ERP5/Extensions/Inspect.py
product/ERP5/Extensions/Inspect.py
+1
-1
product/ERP5/TargetSolver/CopyToTarget.py
product/ERP5/TargetSolver/CopyToTarget.py
+1
-1
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+2
-2
product/ERP5/tests/erp5_url_checker.py
product/ERP5/tests/erp5_url_checker.py
+2
-2
product/ERP5/tests/testBug.py
product/ERP5/tests/testBug.py
+7
-7
product/ERP5/tests/testBusinessTemplate.py
product/ERP5/tests/testBusinessTemplate.py
+22
-22
product/ERP5/tests/testERP5eGov.py
product/ERP5/tests/testERP5eGov.py
+3
-4
product/ERP5/tests/testItem.py
product/ERP5/tests/testItem.py
+1
-1
product/ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py
...ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py
+11
-11
product/ERP5Banking/tests/testERP5BankingCashExchange.py
product/ERP5Banking/tests/testERP5BankingCashExchange.py
+10
-10
product/ERP5Banking/tests/testERP5BankingForeignCashReception.py
.../ERP5Banking/tests/testERP5BankingForeignCashReception.py
+2
-2
product/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py
...t/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py
+7
-7
product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py
product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py
+1
-1
product/ERP5Form/Tool/SelectionTool.py
product/ERP5Form/Tool/SelectionTool.py
+3
-3
product/ERP5Legacy/tests/testLegacyConversionInSimulation.py
product/ERP5Legacy/tests/testLegacyConversionInSimulation.py
+47
-47
product/ERP5Type/DocumentationHelper/DCWorkflowTransitionDocumentationHelper.py
...entationHelper/DCWorkflowTransitionDocumentationHelper.py
+1
-1
product/ERP5Type/tests/testSessionTool.py
product/ERP5Type/tests/testSessionTool.py
+2
-2
product/Formulator/Validator.py
product/Formulator/Validator.py
+1
-1
product/TimerService/timerserver/timerserver/__init__.py
product/TimerService/timerserver/timerserver/__init__.py
+1
-1
product/ZLDAPConnection/Entry.py
product/ZLDAPConnection/Entry.py
+24
-24
product/ZMySQLDA/DA.py
product/ZMySQLDA/DA.py
+2
-2
product/ZMySQLDA/db.py
product/ZMySQLDA/db.py
+5
-5
No files found.
product/ERP5/Document/AttributeUnicityConstraint.py
View file @
7e76a151
...
...
@@ -35,7 +35,7 @@ from Products.CMFCore.Expression import Expression
from
Products.ERP5Type
import
PropertySheet
from
Products.ERP5Type.Utils
import
createExpressionContext
from
Products.ERP5Type.Core.PropertyExistenceConstraint
import
\
PropertyExistenceConstraint
PropertyExistenceConstraint
from
Products.ZSQLCatalog.SQLCatalog
import
Query
,
NegatedQuery
class
AttributeUnicityConstraint
(
PropertyExistenceConstraint
):
...
...
product/ERP5/Document/CategoryRelatedMembershipStateConstraint.py
View file @
7e76a151
...
...
@@ -48,4 +48,4 @@ class CategoryRelatedMembershipStateConstraint(CategoryMembershipStateConstraint
class to simply surcharge it.
"""
return
obj
.
_getRelatedValueList
(
base_category
,
portal_type
=
portal_type_list
)
portal_type
=
portal_type_list
)
product/ERP5/Extensions/Inspect.py
View file @
7e76a151
# Simple Object Inspector
def
inspect
(
self
):
return
str
(
self
.
__dict__
)
return
str
(
self
.
__dict__
)
#return "type: %s dict:%s" % (type(o), o.__dict__)
result
=
''
return
self
.
getPhysicalPath
()
product/ERP5/TargetSolver/CopyToTarget.py
View file @
7e76a151
...
...
@@ -153,7 +153,7 @@ class CopyToTarget(TargetSolver):
simulation_movement
.
setSource
(
delivery
.
getSource
())
simulation_movement
.
setDestinationSection
(
delivery
.
getDestinationSection
())
simulation_movement
.
setSourceSection
(
delivery
.
getSourceSection
())
simulation_movement
.
edit
(
**
value_dict
)
if
parent_movement
is
not
None
and
not
parent_movement
.
isFrozen
():
...
...
product/ERP5/Tool/SimulationTool.py
View file @
7e76a151
...
...
@@ -973,7 +973,7 @@ class SimulationTool(BaseTool):
mirror_section_category - only take rows in stock table which
mirror_section_uid is member of
mirror_section_category
mirror_section_category
node_filter - only take rows in stock table which node_uid
matches node_filter
...
...
@@ -1851,7 +1851,7 @@ class SimulationTool(BaseTool):
TODO:
- make sure getInventoryHistoryList can return
cumulative values calculated by SQL (JPS)
cumulative values calculated by SQL (JPS)
"""
sql_kw
=
self
.
_generateSQLKeywordDict
(
**
kw
)
return
self
.
Resource_getInventoryHistoryList
(
...
...
product/ERP5/tests/erp5_url_checker.py
View file @
7e76a151
...
...
@@ -137,9 +137,9 @@ class URLOpener(FancyURLopener):
class
Checker
(
URLOpener
):
# This seems necessary for exceptions
# This seems necessary for exceptions
type
=
'http'
def
CheckUrl
(
self
,
url
=
None
):
try
:
thread
=
Thread
(
target
=
self
.
SearchUrl
,
args
=
(
url
,))
...
...
product/ERP5/tests/testBug.py
View file @
7e76a151
...
...
@@ -568,16 +568,16 @@ class TestBug(ERP5TypeTestCase):
if
not
run
:
return
sequence_list
=
SequenceList
()
step_list
=
[
'stepCreateBug'
,
'stepCheckBugInit'
,
'stepOpenBug'
,
'stepCheckBugInit'
,
'stepOpenBug'
,
'stepTic'
,
'stepAssignBug'
,
'stepTic'
,
'stepResolveBug'
,
'stepTic'
,
'stepAssignBug'
,
'stepTic'
,
'stepResolveBug'
,
'stepTic'
,
'stepOpenBug'
,
'stepTic'
]
]
sequence_string
=
' '
.
join
(
step_list
)
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
,
quiet
=
quiet
)
...
...
product/ERP5/tests/testBusinessTemplate.py
View file @
7e76a151
...
...
@@ -4258,9 +4258,9 @@ class TestBusinessTemplate(BusinessTemplateMixin):
CheckNotInstalledInstallationState
\
CheckPreinstallReturnSomething
\
CheckCatalogPreinstallReturnCatalogMethod
\
Tic
\
Tic
\
InstallWithoutForceBusinessTemplate
\
CheckFolderReindexActivityPresence
\
CheckFolderReindexActivityPresence
\
Tic
\
CheckInstalledInstallationState
\
CheckBuiltBuildingState
\
...
...
@@ -5039,17 +5039,17 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test is revision number is incremented with the bt is built"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
CheckInitialRevision
\
UseExportBusinessTemplate
\
CheckInitialRevision
\
BuildBusinessTemplate
\
CheckBuiltBuildingState
\
stepCheckFirstRevision
\
BuildBusinessTemplate
\
stepCheckSecondRevision
\
stepCheckFirstRevision
\
BuildBusinessTemplate
\
stepCheckSecondRevision
\
RemoveBusinessTemplate
\
RemovePortalType
\
RemovePortalType
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
...
...
@@ -5058,12 +5058,12 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if a new Business Template has no dependencies"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
UseExportBusinessTemplate
\
CheckNoMissingDependencies
\
RemoveBusinessTemplate
\
RemovePortalType
\
RemovePortalType
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
...
...
@@ -5072,13 +5072,13 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if a exception is raised when a dependency is missing"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
UseExportBusinessTemplate
\
AddDependency
\
CheckMissingDependencies
\
RemoveBusinessTemplate
\
RemovePortalType
\
RemovePortalType
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
...
...
@@ -5087,9 +5087,9 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if the dependency problem is fixed when the dependency is installed"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
UseExportBusinessTemplate
\
AddDependency
\
CheckMissingDependencies
\
CreateDependencyBusinessTemplate
\
...
...
@@ -5162,7 +5162,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if backup works during installation of a bt with subfolder in skin folder"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateSkinFolder
\
CheckSkinFolderExists
\
CreateSkinSubFolder
\
...
...
@@ -5188,7 +5188,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
"""Test if build fails when one of the paths does not exist"""
sequence_list
=
SequenceList
()
sequence_string
=
'
\
CreatePortalType
\
CreatePortalType
\
CreateNewBusinessTemplate
\
UseExportBusinessTemplate
\
AddPathToBusinessTemplate
\
...
...
@@ -5373,7 +5373,7 @@ class TestBusinessTemplate(BusinessTemplateMixin):
ImportBusinessTemplate
\
UseImportBusinessTemplate
\
InstallWithoutForceBusinessTemplate
\
CheckFolderReindexActivityPresence
\
CheckFolderReindexActivityPresence
\
Tic
\
\
CheckFormGroups
\
...
...
@@ -5387,9 +5387,9 @@ class TestBusinessTemplate(BusinessTemplateMixin):
\
ImportBusinessTemplate
\
UseImportBusinessTemplate
\
Tic
\
Tic
\
InstallWithoutForceBusinessTemplate
\
CheckFolderReindexActivityPresence
\
CheckFolderReindexActivityPresence
\
Tic
\
\
CheckFormGroups
\
...
...
product/ERP5/tests/testERP5eGov.py
View file @
7e76a151
...
...
@@ -159,8 +159,8 @@ class TestEgov(ERP5TypeTestCase):
"""
transaction
.
abort
()
for
module
in
[
self
.
getPersonModule
(),
self
.
getOrganisationModule
(),
]:
self
.
getOrganisationModule
(),
]:
module
.
manage_delObjects
(
list
(
module
.
objectIds
()))
vat_portal_type
=
self
.
portal
.
portal_types
.
getTypeInfo
(
'Vat Declaration'
)
...
...
@@ -327,8 +327,7 @@ class TestEgov(ERP5TypeTestCase):
type_allowed_content_type_list
.
append
(
'PDF'
)
vat_declaration
.
getTypeInfo
().
setTypeAllowedContentTypeList
(
type_allowed_content_type_list
)
vat_declaration
.
getTypeInfo
().
setTypeHiddenContentTypeList
(
type_allowed_content_type_list
)
vat_declaration
.
newContent
(
portal_type
=
'PDF'
,
title
=
'Justificatif numero 1'
)
vat_declaration
.
newContent
(
portal_type
=
'PDF'
,
title
=
'Justificatif numero 1'
)
self
.
tic
()
transaction
.
commit
()
missing_file
=
vat_declaration
.
PDFDocument_getRequirementCount
()
...
...
product/ERP5/tests/testItem.py
View file @
7e76a151
...
...
@@ -631,7 +631,7 @@ class TestItem(TestItemMixin, ERP5TypeTestCase):
packing_list_line
=
self
.
createPackingListLine
(
packing_list
=
packing_list
,
resource
=
resource
)
transaction
.
commit
()
self
.
tic
()
self
.
tic
()
packing_list_line
.
DeliveryLine_viewItemCreationDialog
()
# create a listbox
listbox
=
({
'listbox_key'
:
'000'
,
...
...
product/ERP5Banking/tests/testERP5BankingCashBalanceRegulation.py
View file @
7e76a151
...
...
@@ -42,21 +42,21 @@ class TestERP5BankingCashBalanceRegulation(TestERP5BankingMixin):
"""
Unit test for the cash balance regulation module
Source = destination
Initial cash detail :
5 banknotes of 10000
12 coin of 200
24 banknotes of 5000
0 coin of 100
Initial cash detail :
5 banknotes of 10000
12 coin of 200
24 banknotes of 5000
0 coin of 100
Ordered by Assignor
Confirmed by Assignee
Delivered by DestinationAssignee
Final cash detail :
0 banknotes of 10000
0 coin of 200
34 banknotes of 5000
24 coin of 100
Final cash detail :
0 banknotes of 10000
0 coin of 200
34 banknotes of 5000
24 coin of 100
"""
...
...
product/ERP5Banking/tests/testERP5BankingCashExchange.py
View file @
7e76a151
...
...
@@ -44,19 +44,19 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin):
Unit test for the cash exchange module
Source = destination
Initial cash detail :
5 banknotes of 10000
12 coin of 200
24 banknotes of 5000
0 coin of 100
5 banknotes of 10000
12 coin of 200
24 banknotes of 5000
0 coin of 100
Ordered by Assignor
Confirmed by Assignee
Delivered by DestinationAssignee
Final cash detail :
0 banknotes of 10000
0 coin of 200
34 banknotes of 5000
24 coin of 100
0 banknotes of 10000
0 coin of 200
34 banknotes of 5000
24 coin of 100
"""
...
...
@@ -503,7 +503,7 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin):
# define the sequence
sequence_string
=
'Tic CheckObjects Tic CheckInitialInventoryGuichet_1 '
\
+
'CheckInitialInventoryGuichet_2 '
\
+
'CreateCashExchange '
\
+
'CreateCashExchange '
\
+
'CreateValidIncomingLine CheckSubTotal '
\
+
'CreateValidOutgoingLine '
\
+
'Tic CheckTotal '
\
...
...
@@ -512,7 +512,7 @@ class TestERP5BankingCashExchange(TestERP5BankingMixin):
+
'DeliverFails Tic '
\
+
'DeleteResetInventory Tic '
\
+
'DeliverCashExchange Tic '
\
+
'CheckFinalInventoryGuichet_1 '
\
+
'CheckFinalInventoryGuichet_1 '
\
+
'CheckFinalInventoryGuichet_2'
sequence_list
.
addSequenceString
(
sequence_string
)
# play the sequence
...
...
product/ERP5Banking/tests/testERP5BankingForeignCashReception.py
View file @
7e76a151
...
...
@@ -127,11 +127,11 @@ class TestERP5BankingForeignCashReception(TestERP5BankingMixin):
#and a price cooreponding to the sum of banknote of 50 and 20
#( (3) * 50 + (5) * 20 ) = 250
self
.
foreign_cash_reception
=
self
.
foreign_cash_reception_module
.
newContent
(
id
=
'foreign_cash_reception'
,
portal_type
=
'Foreign Cash Reception'
,
id
=
'foreign_cash_reception'
,
portal_type
=
'Foreign Cash Reception'
,
source_value
=
None
,
destination_value
=
self
.
reception
,
resource_value
=
self
.
currency_1
,
description
=
'test'
,
source_total_asset_price
=
250
)
source_total_asset_price
=
250
)
# set source reference
self
.
setDocumentSourceReference
(
self
.
foreign_cash_reception
)
# execute tic
...
...
product/ERP5Banking/tests/testERP5BankingMonetaryDestruction.py
View file @
7e76a151
...
...
@@ -136,7 +136,7 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
'variation_id'
:
(
'emission_letter'
,
'cash_status'
,
'variation'
),
'variation_value'
:
(
'emission_letter/s'
,
'cash_status/cancelled'
)
+
self
.
variation_list
,
'quantity'
:
self
.
quantity_5000
}
inventory_dict_line_for_auxiliaire_1
=
{
'id'
:
'inventory_line_1'
,
'resource'
:
self
.
billet_10000
,
'variation_id'
:
(
'emission_letter'
,
'cash_status'
,
'variation'
),
...
...
@@ -148,7 +148,7 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
'variation_id'
:
(
'emission_letter'
,
'cash_status'
,
'variation'
),
'variation_value'
:
(
'emission_letter/p'
,
'cash_status/retired'
)
+
self
.
variation_list
,
'quantity'
:
self
.
quantity_5000
}
inventory_dict_line_for_dematerialization
=
{
'id'
:
'inventory_line_3'
,
'resource'
:
self
.
piece_200
,
'variation_id'
:
(
'emission_letter'
,
'cash_status'
,
'variation'
),
...
...
@@ -1021,7 +1021,7 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
+
'StopMonetaryDestruction Tic '
\
+
'CheckSourceDebitAvailableForAuxiliaire '
\
+
'StoppedToDeliverMonetaryDestruction Tic '
\
+
'CheckSourceDebitForAuxiliaire '
\
+
'CheckSourceDebitForAuxiliaire '
\
+
'DelMonetaryDestruction Tic '
sequence_list
.
addSequenceString
(
sequence_string_auxiliare
)
...
...
@@ -1062,9 +1062,9 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
+
'StopMonetaryDestruction Tic '
\
+
'CheckSourceDebitAvailableForExterne '
\
+
'StoppedToDeliverMonetaryDestruction Tic '
\
+
'CheckSourceDebitForExterne '
\
+
'CheckSourceDebitForExterne '
\
+
'DelMonetaryDestruction Tic '
sequence_list
.
addSequenceString
(
another_sequence_string
)
# We will now do a dematerialization
...
...
@@ -1078,8 +1078,8 @@ class TestERP5BankingMonetaryDestruction(TestERP5BankingMixin):
+
'SetMonetaryDestructionSourceTotalAssetPriceForDematerialization '
\
+
'PlanMonetaryDestruction '
\
+
'ValidateMonetaryDestruction '
\
+
'CheckFinalInventoryForDematerialization '
+
'CheckFinalInventoryForDematerialization '
sequence_list
.
addSequenceString
(
another_sequence_string
)
...
...
product/ERP5Banking/tests/testERP5BankingMoneyDeposit.py
View file @
7e76a151
...
...
@@ -186,7 +186,7 @@ class TestERP5BankingMoneyDepositMixin(TestERP5BankingMixin):
self
.
money_deposit
=
self
.
money_deposit_module
.
newContent
(
id
=
'money_deposit'
,
portal_type
=
'Money Deposit'
,
destination_payment_value
=
self
.
bank_account_1
,
destination_payment_value
=
self
.
bank_account_1
,
resource_value
=
self
.
currency_1
,
description
=
'test'
,
source_total_asset_price
=
20000.0
)
...
...
product/ERP5Form/Tool/SelectionTool.py
View file @
7e76a151
...
...
@@ -1714,9 +1714,9 @@ def makeTreeList(here, form, root_dict, report_path, base_category,
tree_list
+=
[
TreeListLine
(
o
,
0
,
depth
,
0
,
selection_domain
,
exception_uid_list
)]
tree_list
+=
makeTreeList
(
here
,
form
,
new_root_dict
,
report_path
,
base_category
,
depth
+
1
,
unfolded_list
,
form_id
,
selection_name
,
report_depth
,
is_report_opened
=
is_report_opened
,
sort_on
=
sort_on
)
base_category
,
depth
+
1
,
unfolded_list
,
form_id
,
selection_name
,
report_depth
,
is_report_opened
=
is_report_opened
,
sort_on
=
sort_on
)
else
:
tree_list
+=
[
TreeListLine
(
o
,
1
,
depth
,
0
,
selection_domain
,
())]
# Summary (closed)
else
:
...
...
product/ERP5Legacy/tests/testLegacyConversionInSimulation.py
View file @
7e76a151
...
...
@@ -104,8 +104,8 @@ class TestConversionInSimulation(AccountingTestCase):
'gap/%s'
%
self
.
vat_gap
,
'gap/%s'
%
self
.
sale_gap
,
'gap/%s'
%
self
.
customer_gap
,
'delivery_mode/%s'
%
self
.
mail_delivery_mode
,
'incoterm/%s'
%
self
.
cpt_incoterm
,
'delivery_mode/%s'
%
self
.
mail_delivery_mode
,
'incoterm/%s'
%
self
.
cpt_incoterm
,
'quantity_unit/%s'
%
self
.
unit_piece_quantity_unit
,
'quantity_unit/%s'
%
self
.
mass_quantity_unit
,
'product_line/apparel'
,
...
...
@@ -243,7 +243,7 @@ class TestConversionInSimulation(AccountingTestCase):
resource
=
self
.
portal
.
product_module
.
newContent
(
portal_type
=
'Product'
,
title
=
'Resource'
,
product_line
=
'apparel'
)
product_line
=
'apparel'
)
currency
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
'Currency'
,
title
=
'euro'
)
...
...
@@ -256,8 +256,8 @@ class TestConversionInSimulation(AccountingTestCase):
transaction
.
commit
()
self
.
tic
()
#execute transaction
x_curr_ex_line
=
currency
.
newContent
(
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
x_curr_ex_line
.
setTitle
(
'Euro to Francs CFA'
)
x_curr_ex_line
.
setBasePrice
(
655.957
)
x_curr_ex_line
.
setStartDate
(
DateTime
(
2008
,
10
,
21
))
...
...
@@ -269,7 +269,7 @@ class TestConversionInSimulation(AccountingTestCase):
client
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
'Client'
,
price_currency
=
new_currency
.
getRelativeUrl
(),
price_currency
=
new_currency
.
getRelativeUrl
(),
default_address_region
=
self
.
default_region
)
vendor
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
...
...
@@ -309,10 +309,10 @@ class TestConversionInSimulation(AccountingTestCase):
delivery_movement
.
getPriceCurrencyValue
())
self
.
assertEquals
\
(
invoice_transaction_movement_1
.
getDestinationTotalAssetPrice
(),
round
(
655.957
*
delivery_movement
.
getTotalPrice
()))
round
(
655.957
*
delivery_movement
.
getTotalPrice
()))
self
.
assertEquals
\
(
invoice_transaction_movement_1
.
getSourceTotalAssetPrice
(),
None
)
None
)
invoice_transaction_movement_2
=
\
invoice_transaction_applied_rule
.
contentValues
()[
1
]
self
.
assertEquals
(
currency
,
...
...
@@ -321,8 +321,8 @@ class TestConversionInSimulation(AccountingTestCase):
delivery_movement
.
getPriceCurrencyValue
())
self
.
assertEquals
\
(
invoice_transaction_movement_2
.
getDestinationTotalAssetPrice
(),
round
(
655.957
*
delivery_movement
.
getTotalPrice
()))
round
(
655.957
*
delivery_movement
.
getTotalPrice
()))
def
test_01_simulation_movement_source_asset_price
(
self
,
quiet
=
0
,
run
=
run_all_test
):
"""
...
...
@@ -336,7 +336,7 @@ class TestConversionInSimulation(AccountingTestCase):
resource
=
self
.
portal
.
product_module
.
newContent
(
portal_type
=
'Product'
,
title
=
'Resource'
,
product_line
=
'apparel'
)
product_line
=
'apparel'
)
currency
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
'Currency'
,
title
=
'euro'
)
...
...
@@ -349,8 +349,8 @@ class TestConversionInSimulation(AccountingTestCase):
transaction
.
commit
()
self
.
tic
()
#execute transaction
x_curr_ex_line
=
currency
.
newContent
(
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
x_curr_ex_line
.
setTitle
(
'Euro to Francs CFA'
)
x_curr_ex_line
.
setBasePrice
(
655.957
)
x_curr_ex_line
.
setStartDate
(
DateTime
(
2008
,
10
,
21
))
...
...
@@ -366,7 +366,7 @@ class TestConversionInSimulation(AccountingTestCase):
vendor
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
'Vendor'
,
price_currency
=
new_currency
.
getRelativeUrl
(),
price_currency
=
new_currency
.
getRelativeUrl
(),
default_address_region
=
self
.
default_region
)
order
=
self
.
portal
.
sale_order_module
.
newContent
(
portal_type
=
'Sale Order'
,
...
...
@@ -402,12 +402,12 @@ class TestConversionInSimulation(AccountingTestCase):
delivery_movement
.
getPriceCurrencyValue
())
self
.
assertEquals
\
(
invoice_transaction_movement
.
getSourceTotalAssetPrice
(),
round
(
655.957
*
delivery_movement
.
getTotalPrice
()))
round
(
655.957
*
delivery_movement
.
getTotalPrice
()))
self
.
assertEquals
\
(
invoice_transaction_movement
.
getDestinationTotalAssetPrice
(),
None
)
None
)
def
test_01_destination_total_asset_price_on_accounting_lines
(
self
,
quiet
=
0
,
run
=
run_all_test
):
"""
...
...
@@ -418,11 +418,11 @@ class TestConversionInSimulation(AccountingTestCase):
if
not
quiet
:
printAndLog
(
'test_01_destination_total_asset_price_on_accounting_lines'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
portal_type
=
'Product'
,
title
=
'Resource'
,
product_line
=
'apparel'
)
product_line
=
'apparel'
)
currency
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
'Currency'
,
title
=
'euro'
)
...
...
@@ -435,8 +435,8 @@ class TestConversionInSimulation(AccountingTestCase):
transaction
.
commit
()
self
.
tic
()
#execute transaction
x_curr_ex_line
=
currency
.
newContent
(
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
x_curr_ex_line
.
setTitle
(
'Euro to Francs CFA'
)
x_curr_ex_line
.
setBasePrice
(
655.957
)
x_curr_ex_line
.
setStartDate
(
DateTime
(
2008
,
10
,
21
))
...
...
@@ -448,7 +448,7 @@ class TestConversionInSimulation(AccountingTestCase):
client
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
'Client'
,
price_currency
=
new_currency
.
getRelativeUrl
(),
price_currency
=
new_currency
.
getRelativeUrl
(),
default_address_region
=
self
.
default_region
)
vendor
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
...
...
@@ -495,10 +495,10 @@ class TestConversionInSimulation(AccountingTestCase):
self
.
assertEquals
(
line
.
getDestinationTotalAssetPrice
(),
round
(
655.957
*
delivery_movement
.
getTotalPrice
()))
def
test_01_diverged_sale_packing_list_destination_total_asset_price
(
self
,
quiet
=
0
,
run
=
run_all_test
):
self
,
quiet
=
0
,
run
=
run_all_test
):
"""
tests that when the sale packing list is divergent on the quantity and
that the resource on simulation movements is different
...
...
@@ -510,11 +510,11 @@ class TestConversionInSimulation(AccountingTestCase):
if
not
quiet
:
printAndLog
(
'test_01_diverged_sale_packing_list_destination_total_asset_price'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
portal_type
=
'Product'
,
title
=
'Resource'
,
product_line
=
'apparel'
)
product_line
=
'apparel'
)
currency
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
'Currency'
,
title
=
'euro'
)
...
...
@@ -527,8 +527,8 @@ class TestConversionInSimulation(AccountingTestCase):
transaction
.
commit
()
self
.
tic
()
#execute transaction
x_curr_ex_line
=
currency
.
newContent
(
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
x_curr_ex_line
.
setTitle
(
'Euro to Francs CFA'
)
x_curr_ex_line
.
setBasePrice
(
655.957
)
x_curr_ex_line
.
setStartDate
(
DateTime
(
2008
,
10
,
21
))
...
...
@@ -540,7 +540,7 @@ class TestConversionInSimulation(AccountingTestCase):
client
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
'Client'
,
price_currency
=
new_currency
.
getRelativeUrl
(),
price_currency
=
new_currency
.
getRelativeUrl
(),
default_address_region
=
self
.
default_region
)
vendor
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
...
...
@@ -585,7 +585,7 @@ class TestConversionInSimulation(AccountingTestCase):
self
.
tic
()
related_applied_rule
=
order
.
getCausalityRelatedValue
(
portal_type
=
'Applied Rule'
)
portal_type
=
'Applied Rule'
)
order_movement
=
related_applied_rule
.
contentValues
()[
0
]
delivery_applied_rule
=
order_movement
.
contentValues
()[
0
]
delivery_movement
=
delivery_applied_rule
.
contentValues
()[
0
]
...
...
@@ -600,7 +600,7 @@ class TestConversionInSimulation(AccountingTestCase):
def
test_01_diverged_purchase_packing_list_source_total_asset_price
(
self
,
quiet
=
0
,
run
=
run_all_test
):
self
,
quiet
=
0
,
run
=
run_all_test
):
"""
tests that when the purchase packing list is divergent on the quantity
and that the resource on simulation movements is different
...
...
@@ -612,11 +612,11 @@ class TestConversionInSimulation(AccountingTestCase):
if
not
quiet
:
printAndLog
(
'test_01_diverged_purchase_packing_list_source_total_asset_price'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
portal_type
=
'Product'
,
title
=
'Resource'
,
product_line
=
'apparel'
)
product_line
=
'apparel'
)
currency
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
'Currency'
,
title
=
'euro'
)
...
...
@@ -629,8 +629,8 @@ class TestConversionInSimulation(AccountingTestCase):
transaction
.
commit
()
self
.
tic
()
#execute transaction
x_curr_ex_line
=
currency
.
newContent
(
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
x_curr_ex_line
.
setTitle
(
'Euro to Francs CFA'
)
x_curr_ex_line
.
setBasePrice
(
655.957
)
x_curr_ex_line
.
setStartDate
(
DateTime
(
2008
,
10
,
21
))
...
...
@@ -646,7 +646,7 @@ class TestConversionInSimulation(AccountingTestCase):
vendor
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
'Vendor'
,
price_currency
=
new_currency
.
getRelativeUrl
(),
price_currency
=
new_currency
.
getRelativeUrl
(),
default_address_region
=
self
.
default_region
)
order
=
self
.
portal
.
purchase_order_module
.
newContent
(
portal_type
=
'Purchase Order'
,
...
...
@@ -700,9 +700,9 @@ class TestConversionInSimulation(AccountingTestCase):
self
.
assertEquals
(
invoice_transaction_movement
.
\
getSourceTotalAssetPrice
(),
old_source_asset_price
*
(
3.0
/
5.0
))
def
test_01_delivery_mode_on_sale_packing_list_and_invoice
(
self
,
quiet
=
0
,
run
=
run_all_test
):
self
,
quiet
=
0
,
run
=
run_all_test
):
"""
tests that when the sale packing list is divergent on the quantity and
that the resource on simulation movements is different
...
...
@@ -714,11 +714,11 @@ class TestConversionInSimulation(AccountingTestCase):
if
not
quiet
:
printAndLog
(
'test_01_delivery_mode_on_sale_packing_list_and_invoice'
)
resource
=
self
.
portal
.
product_module
.
newContent
(
portal_type
=
'Product'
,
title
=
'Resource'
,
product_line
=
'apparel'
)
product_line
=
'apparel'
)
currency
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
'Currency'
,
title
=
'euro'
)
...
...
@@ -731,8 +731,8 @@ class TestConversionInSimulation(AccountingTestCase):
transaction
.
commit
()
self
.
tic
()
#execute transaction
x_curr_ex_line
=
currency
.
newContent
(
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
portal_type
=
'Currency Exchange Line'
,
price_currency
=
new_currency
.
getRelativeUrl
())
x_curr_ex_line
.
setTitle
(
'Euro to Francs CFA'
)
x_curr_ex_line
.
setBasePrice
(
655.957
)
x_curr_ex_line
.
setStartDate
(
DateTime
(
2008
,
10
,
21
))
...
...
@@ -744,7 +744,7 @@ class TestConversionInSimulation(AccountingTestCase):
client
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
title
=
'Client'
,
price_currency
=
new_currency
.
getRelativeUrl
(),
price_currency
=
new_currency
.
getRelativeUrl
(),
default_address_region
=
self
.
default_region
)
vendor
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
,
...
...
@@ -758,8 +758,8 @@ class TestConversionInSimulation(AccountingTestCase):
destination_section_value
=
client
,
start_date
=
DateTime
(
2008
,
10
,
21
),
price_currency_value
=
currency
,
delivery_mode
=
self
.
mail_delivery_mode
,
incoterm
=
self
.
cpt_incoterm
,
delivery_mode
=
self
.
mail_delivery_mode
,
incoterm
=
self
.
cpt_incoterm
,
title
=
'Order'
)
order_line
=
order
.
newContent
(
portal_type
=
'Sale Order Line'
,
resource_value
=
resource
,
...
...
product/ERP5Type/DocumentationHelper/DCWorkflowTransitionDocumentationHelper.py
View file @
7e76a151
...
...
@@ -60,7 +60,7 @@ class DCWorkflowTransitionDocumentationHelper(DocumentationHelper):
if
new_state_id
:
uri
=
'%s/states/%s'
%
(
self
.
uri
.
rsplit
(
'/'
,
2
)[
0
],
new_state_id
)
return
self
.
getDocumentationHelper
(
'DCWorkflowStateDocumentationHelper'
,
uri
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'getTriggerType'
)
def
getTriggerType
(
self
):
...
...
product/ERP5Type/tests/testSessionTool.py
View file @
7e76a151
...
...
@@ -86,8 +86,8 @@ class TestSessionTool(ERP5TypeTestCase):
session_cache_factory
=
getattr
(
portal_caches
,
SESSION_CACHE_FACTORY
)
# remove current cache plugin
session_cache_factory
.
manage_delObjects
(
list
(
session_cache_factory
.
objectIds
()))
cache_plugin
=
session_cache_factory
.
newContent
(
portal_type
=
portal_type
)
cache_plugin
.
setCacheDuration
(
storage_duration
)
cache_plugin
=
session_cache_factory
.
newContent
(
portal_type
=
portal_type
)
cache_plugin
.
setCacheDuration
(
storage_duration
)
cache_plugin
.
setIntIndex
(
0
)
if
portal_type
==
'Distributed Ram Cache'
:
cache_plugin
.
edit
(
specialise
=
'portal_memcached/default_memcached_plugin'
)
...
...
product/Formulator/Validator.py
View file @
7e76a151
...
...
@@ -567,7 +567,7 @@ class FileValidator(Validator):
def
validate
(
self
,
field
,
key
,
REQUEST
):
value
=
REQUEST
.
get
(
key
,
None
)
if
field
.
get_value
(
'required'
)
and
value
in
(
None
,
''
):
self
.
raise_error
(
'required_not_found'
,
field
)
self
.
raise_error
(
'required_not_found'
,
field
)
return
value
FileValidatorInstance
=
FileValidator
()
...
...
product/TimerService/timerserver/timerserver/__init__.py
View file @
7e76a151
...
...
@@ -7,4 +7,4 @@ class TimerServerFactory(ServerFactory):
def
create
(
self
):
from
timerserver.TimerServer
import
TimerServer
return
TimerServer
(
self
.
module
,
self
.
interval
)
return
TimerServer
(
self
.
module
,
self
.
interval
)
product/ZLDAPConnection/Entry.py
View file @
7e76a151
...
...
@@ -154,14 +154,14 @@ class GenericEntry(Acquisition.Implicit):
### a .set calls this directly, while in the TransactionalModel this
### gets called by the Transaction system at commit time.
def
_modify
(
self
):
modlist
=
[]
modlist
=
[]
for
attribute
,
values
in
self
.
_data
.
items
():
modlist
.
append
((
ldap
.
MOD_REPLACE
,
attribute
,
values
))
for
attribute
,
values
in
self
.
_data
.
items
():
modlist
.
append
((
ldap
.
MOD_REPLACE
,
attribute
,
values
))
for
attribute
in
self
.
_mod_delete
:
modlist
.
append
((
ldap
.
MOD_DELETE
,
attribute
,
None
))
self
.
_connection
().
_modifyEntry
(
self
.
dn
,
modlist
)
self
.
_connection
().
_modifyEntry
(
self
.
dn
,
modlist
)
self
.
_mod_delete
=
[]
self
.
__subentries
=
{}
...
...
@@ -422,8 +422,8 @@ class ZopeEntry(OFS.SimpleItem.Item):
#### Initialazation Routines ##############
manage_options
=
(
{
'label'
:
'Attributes'
,
'action'
:
'manage_attributes'
},
)
{
'label'
:
'Attributes'
,
'action'
:
'manage_attributes'
},
)
__ac_permissions__
=
(
(
'Access contents information'
,
(
'manage_attributes'
,),
...
...
@@ -445,7 +445,7 @@ class ZopeEntry(OFS.SimpleItem.Item):
#### Entry & Attribute Access Machinery #####################
def
attributesMap
(
self
):
return
self
.
_data
.
items
()
return
self
.
_data
.
items
()
def
__bobo_traverse__
(
self
,
REQUEST
,
key
):
' allow traversal to subentries '
...
...
@@ -456,14 +456,14 @@ class ZopeEntry(OFS.SimpleItem.Item):
###### Tree Machinery ######
def
tpValues
(
self
):
return
self
.
_subentries
().
values
()
return
self
.
_subentries
().
values
()
def
tpId
(
self
):
return
self
.
id
return
self
.
id
def
tpURL
(
self
):
"""Return string to be used as URL relative to parent."""
return
urllib
.
quote
(
self
.
id
)
"""Return string to be used as URL relative to parent."""
return
urllib
.
quote
(
self
.
id
)
### Object Manager-ish Machinery
def
objectValues
(
self
):
...
...
@@ -478,22 +478,22 @@ class ZopeEntry(OFS.SimpleItem.Item):
### Zope management stuff
def
manage_deleteEntry
(
self
,
ids
,
REQUEST
=
None
):
'''Delete marked Entries and all their sub-entries.'''
'''Delete marked Entries and all their sub-entries.'''
for
rdn
in
ids
:
for
rdn
in
ids
:
self
.
_delete_dn
(
rdn
)
if
REQUEST
is
not
None
:
return
self
.
manage_contents
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_contents
(
self
,
REQUEST
)
def
manage_newEntry
(
self
,
rdn
,
REQUEST
=
None
):
'''Add a new entry'''
'''Add a new entry'''
e
=
self
.
addSubentry
(
rdn
)
if
REQUEST
is
not
None
:
return
self
.
manage_contents
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_contents
(
self
,
REQUEST
)
else
:
return
e
...
...
@@ -504,19 +504,19 @@ class ZopeEntry(OFS.SimpleItem.Item):
return
e
# return the new entry
def
manage_addAttribute
(
self
,
id
,
values
,
REQUEST
=
None
):
'''Add an attribute to an LDAP entry'''
'''Add an attribute to an LDAP entry'''
self
.
set
(
id
,
values
)
if
REQUEST
is
not
None
:
return
self
.
manage_attributes
(
self
,
REQUEST
)
if
REQUEST
is
not
None
:
return
self
.
manage_attributes
(
self
,
REQUEST
)
def
manage_editAttributes
(
self
,
REQUEST
):
"""Edit entry's attributes via the web."""
for
attribute
in
self
.
_data
.
keys
():
values
=
REQUEST
.
get
(
attribute
,
[])
values
=
REQUEST
.
get
(
attribute
,
[])
values
=
filter
(
isNotBlank
,
values
)
#strip out blanks
self
.
set
(
attribute
,
values
)
...
...
product/ZMySQLDA/DA.py
View file @
7e76a151
...
...
@@ -193,6 +193,6 @@ misc_={'conn': ImageFile(
os
.
path
.
join
(
SHARED_DC_ZRDB_LOCATION
,
'www'
,
'DBAdapterFolder_icon.gif'
))}
for
icon
in
(
'table'
,
'view'
,
'stable'
,
'what'
,
'field'
,
'text'
,
'bin'
,
'int'
,
'float'
,
'date'
,
'time'
,
'datetime'
):
'field'
,
'text'
,
'bin'
,
'int'
,
'float'
,
'date'
,
'time'
,
'datetime'
):
misc_
[
icon
]
=
ImageFile
(
os
.
path
.
join
(
'icons'
,
'%s.gif'
)
%
icon
,
globals
())
product/ZMySQLDA/db.py
View file @
7e76a151
...
...
@@ -94,8 +94,8 @@ MySQLdb_version_required = (0,9,2)
_v
=
getattr
(
_mysql
,
'version_info'
,
(
0
,
0
,
0
))
if
_v
<
MySQLdb_version_required
:
raise
NotSupportedError
,
\
"ZMySQLDA requires at least MySQLdb %s, %s found"
%
\
(
MySQLdb_version_required
,
_v
)
"ZMySQLDA requires at least MySQLdb %s, %s found"
%
\
(
MySQLdb_version_required
,
_v
)
from
MySQLdb.converters
import
conversions
from
MySQLdb.constants
import
FIELD_TYPE
,
CR
,
ER
,
CLIENT
...
...
@@ -152,11 +152,11 @@ type_xlate = {
}
def
_mysql_timestamp_converter
(
s
):
if
len
(
s
)
<
14
:
s
=
s
+
"0"
*
(
14
-
len
(
s
))
if
len
(
s
)
<
14
:
s
=
s
+
"0"
*
(
14
-
len
(
s
))
parts
=
map
(
int
,
(
s
[:
4
],
s
[
4
:
6
],
s
[
6
:
8
],
s
[
8
:
10
],
s
[
10
:
12
],
s
[
12
:
14
]))
return
DateTime
(
"%04d-%02d-%02d %02d:%02d:%02d"
%
tuple
(
parts
))
return
DateTime
(
"%04d-%02d-%02d %02d:%02d:%02d"
%
tuple
(
parts
))
def
DateTime_or_None
(
s
):
try
:
return
DateTime
(
'%s UTC'
%
s
)
...
...
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