Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Lu Xu
slapos.core
Commits
74c50af2
Commit
74c50af2
authored
Nov 29, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate most basic constraints.
parent
3af13229
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
210 additions
and
5 deletions
+210
-5
master/bt5/slapos_accounting/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+3
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint.xml
...erty_sheets/SlapOSAccountingSalePackingListConstraint.xml
+66
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint/destination_constraint.xml
...ntingSalePackingListConstraint/destination_constraint.xml
+0
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint/destination_decision_constraint.xml
...PackingListConstraint/destination_decision_constraint.xml
+0
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint/destination_section_constraint.xml
...ePackingListConstraint/destination_section_constraint.xml
+0
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint/lines_constraint.xml
...SAccountingSalePackingListConstraint/lines_constraint.xml
+0
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint/price_currency_constraint.xml
...ngSalePackingListConstraint/price_currency_constraint.xml
+16
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint/reference_not_empty_constraint.xml
...ePackingListConstraint/reference_not_empty_constraint.xml
+0
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint/source_constraint.xml
...AccountingSalePackingListConstraint/source_constraint.xml
+0
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint/source_section_constraint.xml
...ngSalePackingListConstraint/source_section_constraint.xml
+0
-0
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint/start_date_existence_constraint.xml
...PackingListConstraint/start_date_existence_constraint.xml
+0
-0
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingConstraint.py
...unting/TestTemplateItem/testSlapOSAccountingConstraint.py
+119
-0
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
master/bt5/slapos_accounting/bt/template_portal_type_property_sheet_list
...os_accounting/bt/template_portal_type_property_sheet_list
+1
-0
master/bt5/slapos_accounting/bt/template_property_sheet_id_list
.../bt5/slapos_accounting/bt/template_property_sheet_id_list
+3
-2
master/bt5/vifib_erp5/bt/dependency_list
master/bt5/vifib_erp5/bt/dependency_list
+0
-1
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
No files found.
master/bt5/slapos_accounting/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
74c50af2
...
@@ -5,6 +5,9 @@
...
@@ -5,6 +5,9 @@
<portal_type
id=
"Sale Invoice Transaction"
>
<portal_type
id=
"Sale Invoice Transaction"
>
<item>
SlapOSAccountingSaleInvoiceTransactionConstraint
</item>
<item>
SlapOSAccountingSaleInvoiceTransactionConstraint
</item>
</portal_type>
</portal_type>
<portal_type
id=
"Sale Packing List"
>
<item>
SlapOSAccountingSalePackingListConstraint
</item>
</portal_type>
<portal_type
id=
"Slave Instance"
>
<portal_type
id=
"Slave Instance"
>
<item>
InstanceAccountingSynchronisation
</item>
<item>
InstanceAccountingSynchronisation
</item>
</portal_type>
</portal_type>
...
...
master/bt5/slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccountingSalePackingListConstraint.xml
0 → 100644
View file @
74c50af2
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SlapOSAccountingSalePackingListConstraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
SalePackingListConstraint/destination_constraint.xml
→
master/bt5/
slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccounting
SalePackingListConstraint/destination_constraint.xml
View file @
74c50af2
File moved
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
SalePackingListConstraint/destination_decision_constraint.xml
→
master/bt5/
slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccounting
SalePackingListConstraint/destination_decision_constraint.xml
View file @
74c50af2
File moved
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
SalePackingListConstraint/destination_section_constraint.xml
→
master/bt5/
slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccounting
SalePackingListConstraint/destination_section_constraint.xml
View file @
74c50af2
File moved
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
SalePackingListConstraint/lines_constraint.xml
→
master/bt5/
slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccounting
SalePackingListConstraint/lines_constraint.xml
View file @
74c50af2
File moved
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
SalePackingListConstraint/price_currency_constraint.xml
→
master/bt5/
slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccounting
SalePackingListConstraint/price_currency_constraint.xml
View file @
74c50af2
...
@@ -44,6 +44,22 @@
...
@@ -44,6 +44,22 @@
<key>
<string>
max_arity
</string>
</key>
<key>
<string>
max_arity
</string>
</key>
<value>
<int>
1
</int>
</value>
<value>
<int>
1
</int>
</value>
</item>
</item>
<item>
<key>
<string>
message_arity_not_in_range
</string>
</key>
<value>
<string>
Exactly one Currency shall be selected
</string>
</value>
</item>
<item>
<key>
<string>
message_arity_too_small
</string>
</key>
<value>
<string>
Exactly one Currency shall be selected
</string>
</value>
</item>
<item>
<key>
<string>
message_arity_with_portal_type_not_in_range
</string>
</key>
<value>
<string>
Exactly one Currency shall be selected
</string>
</value>
</item>
<item>
<key>
<string>
message_arity_with_portal_type_too_small
</string>
</key>
<value>
<string>
Exactly one Currency shall be selected
</string>
</value>
</item>
<item>
<item>
<key>
<string>
min_arity
</string>
</key>
<key>
<string>
min_arity
</string>
</key>
<value>
<int>
1
</int>
</value>
<value>
<int>
1
</int>
</value>
...
...
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
SalePackingListConstraint/reference_not_empty_constraint.xml
→
master/bt5/
slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccounting
SalePackingListConstraint/reference_not_empty_constraint.xml
View file @
74c50af2
File moved
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
SalePackingListConstraint/source_constraint.xml
→
master/bt5/
slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccounting
SalePackingListConstraint/source_constraint.xml
View file @
74c50af2
File moved
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
SalePackingListConstraint/source_section_constraint.xml
→
master/bt5/
slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccounting
SalePackingListConstraint/source_section_constraint.xml
View file @
74c50af2
File moved
master/bt5/
vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/Vifib
SalePackingListConstraint/start_date_existence_constraint.xml
→
master/bt5/
slapos_accounting/PropertySheetTemplateItem/portal_property_sheets/SlapOSAccounting
SalePackingListConstraint/start_date_existence_constraint.xml
View file @
74c50af2
File moved
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingConstraint.py
View file @
74c50af2
...
@@ -219,3 +219,122 @@ class TestSaleInvoiceTransaction(TestSlapOSConstraintMixin):
...
@@ -219,3 +219,122 @@ class TestSaleInvoiceTransaction(TestSlapOSConstraintMixin):
invoice
.
newContent
(
portal_type
=
'Invoice Line'
,
quantity
=
2.
,
invoice
.
newContent
(
portal_type
=
'Invoice Line'
,
quantity
=
2.
,
price
=
1.
)
price
=
1.
)
self
.
assertFalse
(
message
in
self
.
getMessageList
(
invoice
))
self
.
assertFalse
(
message
in
self
.
getMessageList
(
invoice
))
class
TestSalePackingList
(
TestSlapOSConstraintMixin
):
@
withAbort
def
test_lines
(
self
):
message
=
'Sale Packing List Line is not defined'
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
delivery
.
newContent
(
portal_type
=
'Sale Packing List Line'
)
self
.
assertFalse
(
message
in
self
.
getMessageList
(
delivery
))
@
withAbort
def
test_reference_not_empty
(
self
):
message
=
'Reference must be defined'
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
self
.
assertFalse
(
message
in
self
.
getMessageList
(
delivery
))
delivery
.
setReference
(
None
)
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
@
withAbort
def
test_price_currency
(
self
):
message
=
'Exactly one Currency shall be selected'
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
resource
=
self
.
portal
.
service_module
.
newContent
(
portal_type
=
'Service'
)
delivery
.
setPriceCurrency
(
resource
.
getRelativeUrl
())
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
currency_1
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
'Currency'
)
currency_2
=
self
.
portal
.
currency_module
.
newContent
(
portal_type
=
'Currency'
)
delivery
.
setPriceCurrencyList
([
currency_1
.
getRelativeUrl
(),
currency_2
.
getRelativeUrl
()])
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
delivery
.
setPriceCurrency
(
currency_1
.
getRelativeUrl
())
self
.
assertFalse
(
message
in
self
.
getMessageList
(
delivery
))
@
withAbort
def
_test_category_arrow
(
self
,
category
):
message
=
"Arity Error for Relation ['%s'], arity is equal to "
\
"0 but should be between 1 and 1"
%
category
message_2
=
"Arity Error for Relation ['%s'], arity is equal to "
\
"2 but should be between 1 and 1"
%
category
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
resource
=
self
.
portal
.
service_module
.
newContent
(
portal_type
=
'Service'
).
getRelativeUrl
()
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
).
getRelativeUrl
()
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
).
getRelativeUrl
()
key
=
'%s_list'
%
category
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
delivery
.
edit
(
**
{
key
:
[
resource
]})
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
delivery
.
edit
(
**
{
key
:
[
person
,
organisation
]})
self
.
assertTrue
(
message_2
in
self
.
getMessageList
(
delivery
))
delivery
.
edit
(
**
{
key
:
[
person
]})
self
.
assertFalse
(
message
in
self
.
getMessageList
(
delivery
))
self
.
assertFalse
(
message_2
in
self
.
getMessageList
(
delivery
))
delivery
.
edit
(
**
{
key
:
[
organisation
]})
self
.
assertFalse
(
message
in
self
.
getMessageList
(
delivery
))
self
.
assertFalse
(
message_2
in
self
.
getMessageList
(
delivery
))
def
test_destination
(
self
):
self
.
_test_category_arrow
(
'destination'
)
def
test_destination_section
(
self
):
self
.
_test_category_arrow
(
'destination_section'
)
def
test_destination_decision
(
self
):
self
.
_test_category_arrow
(
'destination_decision'
)
def
test_source
(
self
):
self
.
_test_category_arrow
(
'source'
)
def
test_source_section
(
self
):
self
.
_test_category_arrow
(
'source_section'
)
@
withAbort
def
test_specialise
(
self
):
category
=
'specialise'
message
=
"Arity Error for Relation ['%s'], arity is equal to "
\
"0 but should be between 1 and 1"
%
category
message_2
=
"Arity Error for Relation ['%s'], arity is equal to "
\
"2 but should be between 1 and 1"
%
category
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
resource
=
self
.
portal
.
service_module
.
newContent
(
portal_type
=
'Service'
).
getRelativeUrl
()
stc_1
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
'Sale Trade Condition'
).
getRelativeUrl
()
stc_2
=
self
.
portal
.
sale_trade_condition_module
.
newContent
(
portal_type
=
'Sale Trade Condition'
).
getRelativeUrl
()
key
=
'%s_list'
%
category
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
delivery
.
edit
(
**
{
key
:
[
resource
]})
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
delivery
.
edit
(
**
{
key
:
[
stc_1
,
stc_2
]})
self
.
assertTrue
(
message_2
in
self
.
getMessageList
(
delivery
))
delivery
.
edit
(
**
{
key
:
[
stc_1
]})
self
.
assertFalse
(
message
in
self
.
getMessageList
(
delivery
))
self
.
assertFalse
(
message_2
in
self
.
getMessageList
(
delivery
))
@
withAbort
def
test_start_date
(
self
):
message
=
'Property start_date must be defined'
delivery
=
self
.
portal
.
sale_packing_list_module
.
newContent
(
portal_type
=
'Sale Packing List'
)
self
.
assertTrue
(
message
in
self
.
getMessageList
(
delivery
))
delivery
.
setStartDate
(
'2012/01/01'
)
self
.
assertFalse
(
message
in
self
.
getMessageList
(
delivery
))
master/bt5/slapos_accounting/bt/revision
View file @
74c50af2
185
186
\ No newline at end of file
\ No newline at end of file
master/bt5/slapos_accounting/bt/template_portal_type_property_sheet_list
View file @
74c50af2
Hosting Subscription | SlapOSAccountingHostingSubscriptionConstraint
Hosting Subscription | SlapOSAccountingHostingSubscriptionConstraint
Sale Invoice Transaction | SlapOSAccountingSaleInvoiceTransactionConstraint
Sale Invoice Transaction | SlapOSAccountingSaleInvoiceTransactionConstraint
Sale Packing List | SlapOSAccountingSalePackingListConstraint
Slave Instance | InstanceAccountingSynchronisation
Slave Instance | InstanceAccountingSynchronisation
Software Instance | InstanceAccountingSynchronisation
Software Instance | InstanceAccountingSynchronisation
\ No newline at end of file
master/bt5/slapos_accounting/bt/template_property_sheet_id_list
View file @
74c50af2
SlapOSAccountingSystemPreference
InstanceAccountingSynchronisation
SlapOSAccountingHostingSubscriptionConstraint
SlapOSAccountingHostingSubscriptionConstraint
SlapOSAccountingSaleInvoiceTransactionConstraint
SlapOSAccountingSaleInvoiceTransactionConstraint
InstanceAccountingSynchronisation
SlapOSAccountingSalePackingListConstraint
\ No newline at end of file
SlapOSAccountingSystemPreference
\ No newline at end of file
master/bt5/vifib_erp5/bt/dependency_list
View file @
74c50af2
...
@@ -13,7 +13,6 @@ vifib_base
...
@@ -13,7 +13,6 @@ vifib_base
vifib_configurator
vifib_configurator
vifib_data
vifib_data
slapos_category
slapos_category
vifib_data_simulation
slapos_payzen
slapos_payzen
vifib_slap
vifib_slap
vifib_slapos_accounting
vifib_slapos_accounting
...
...
master/bt5/vifib_erp5/bt/revision
View file @
74c50af2
576
577
\ No newline at end of file
\ 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