Commit 72bab7ad authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Update Constraint for Accounting Transations type

   Only require project when ledger is automated
   Accept no ledger (1 or 0) on accounting transactions in case manual accounting is used.
parent b252e8cd
<property_sheet_list> <property_sheet_list>
<portal_type id="Accounting Transaction"> <portal_type id="Accounting Transaction">
<item>SlapOSLedgerConstraint</item> <item>SlapOSLedgerAccountingConstraint</item>
<item>SlapOSVirtualMasterSourceProjectConstraint</item> <item>SlapOSVirtualMasterSourceProjectAccountingConstraint</item>
</portal_type> </portal_type>
<portal_type id="Amortisation Transaction"> <portal_type id="Amortisation Transaction">
<item>SlapOSLedgerConstraint</item> <item>SlapOSLedgerAccountingConstraint</item>
<item>SlapOSVirtualMasterSourceProjectConstraint</item> <item>SlapOSVirtualMasterSourceProjectAccountingConstraint</item>
</portal_type> </portal_type>
<portal_type id="Balance Transaction"> <portal_type id="Balance Transaction">
<item>SlapOSLedgerConstraint</item> <item>SlapOSLedgerAccountingConstraint</item>
<item>SlapOSVirtualMasterSourceProjectConstraint</item> <item>SlapOSVirtualMasterSourceProjectAccountingConstraint</item>
</portal_type> </portal_type>
<portal_type id="Cloud Contract"> <portal_type id="Cloud Contract">
<item>SlapOSCloudContractAccounting</item> <item>SlapOSCloudContractAccounting</item>
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
<item>SlapOSLedgerConstraint</item> <item>SlapOSLedgerConstraint</item>
</portal_type> </portal_type>
<portal_type id="Internal Invoice Transaction"> <portal_type id="Internal Invoice Transaction">
<item>SlapOSLedgerConstraint</item> <item>SlapOSLedgerAccountingConstraint</item>
<item>SlapOSVirtualMasterSourceProjectConstraint</item> <item>SlapOSVirtualMasterSourceProjectAccountingConstraint</item>
</portal_type> </portal_type>
<portal_type id="Invoice Line"> <portal_type id="Invoice Line">
<item>SlapOSMovementConstraint</item> <item>SlapOSMovementConstraint</item>
...@@ -41,15 +41,15 @@ ...@@ -41,15 +41,15 @@
<item>SlapOSMovementConstraint</item> <item>SlapOSMovementConstraint</item>
</portal_type> </portal_type>
<portal_type id="Payment Transaction"> <portal_type id="Payment Transaction">
<item>SlapOSLedgerConstraint</item> <item>SlapOSLedgerAccountingConstraint</item>
</portal_type> </portal_type>
<portal_type id="Purchase Invoice Transaction"> <portal_type id="Purchase Invoice Transaction">
<item>SlapOSLedgerConstraint</item> <item>SlapOSLedgerAccountingConstraint</item>
<item>SlapOSVirtualMasterSourceProjectConstraint</item> <item>SlapOSVirtualMasterSourceProjectAccountingConstraint</item>
</portal_type> </portal_type>
<portal_type id="Sale Invoice Transaction"> <portal_type id="Sale Invoice Transaction">
<item>SlapOSAccountingSaleInvoiceTransactionConstraint</item> <item>SlapOSAccountingSaleInvoiceTransactionConstraint</item>
<item>SlapOSLedgerConstraint</item> <item>SlapOSLedgerAccountingConstraint</item>
<item>SlapOSSaleProfileConstraint</item> <item>SlapOSSaleProfileConstraint</item>
</portal_type> </portal_type>
<portal_type id="Sale Order"> <portal_type id="Sale Order">
......
<?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> <string>Require a portal type to have a ledger configured to prevent conflict between the automated and manual document handling.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlapOSLedgerAccountingConstraint</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>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Membership Arity Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>constraint_base_category</string> </key>
<value>
<tuple>
<string>ledger</string>
</tuple>
</value>
</item>
<item>
<key> <string>constraint_portal_type</string> </key>
<value> <string>python: (\'Category\',)</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Require to configure at least one ledger.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ledger_arity_constraint_constraint</string> </value>
</item>
<item>
<key> <string>max_arity</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>min_arity</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Membership Arity Constraint</string> </value>
</item>
<item>
<key> <string>use_acquisition</string> </key>
<value> <int>0</int> </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>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ledger_category</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category Property</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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> <string>Require a portal type to be linked to a virtual master.</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SlapOSVirtualMasterSourceProjectAccountingConstraint</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>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TALES Constraint" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Only applicable if ledger is automated</string> </value>
</item>
<item>
<key> <string>expression</string> </key>
<value> <string>python: len([x for x in [here.getSourceProjectValue(portal_type=\'Project\'), here.getDestinationProjectValue(portal_type=\'Project\')] if ((x is not None) and (x.getValidationState() in (\'validated\', \'invalidated\', \'suspended\')))]) != 0</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>source_or_destination_project_constraint_constraint</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>membership_criterion_category</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>message_expression_false</string> </key>
<value> <string>A project is required</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>TALES Constraint</string> </value>
</item>
<item>
<key> <string>string_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>test_method_id</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>test_tales_expression</string> </key>
<value> <string>python: here.getLedger() == \'automated\'</string> </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>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Accounting Transaction | SlapOSLedgerConstraint Accounting Transaction | SlapOSLedgerAccountingConstraint
Accounting Transaction | SlapOSVirtualMasterSourceProjectConstraint Accounting Transaction | SlapOSVirtualMasterSourceProjectAccountingConstraint
Amortisation Transaction | SlapOSLedgerConstraint Amortisation Transaction | SlapOSLedgerAccountingConstraint
Amortisation Transaction | SlapOSVirtualMasterSourceProjectConstraint Amortisation Transaction | SlapOSVirtualMasterSourceProjectAccountingConstraint
Balance Transaction | SlapOSLedgerConstraint Balance Transaction | SlapOSLedgerAccountingConstraint
Balance Transaction | SlapOSVirtualMasterSourceProjectConstraint Balance Transaction | SlapOSVirtualMasterSourceProjectAccountingConstraint
Cloud Contract Line | SlapOSCloudContractLineAccounting Cloud Contract Line | SlapOSCloudContractLineAccounting
Cloud Contract | SlapOSCloudContractAccounting Cloud Contract | SlapOSCloudContractAccounting
Computer Consumption TioXML File | SortIndex Computer Consumption TioXML File | SortIndex
Hosting Subscription | SlapOSAccountingHostingSubscriptionConstraint Hosting Subscription | SlapOSAccountingHostingSubscriptionConstraint
Hosting Subscription | SlapOSLedgerConstraint Hosting Subscription | SlapOSLedgerConstraint
Internal Invoice Transaction | SlapOSLedgerConstraint Internal Invoice Transaction | SlapOSLedgerAccountingConstraint
Internal Invoice Transaction | SlapOSVirtualMasterSourceProjectConstraint Internal Invoice Transaction | SlapOSVirtualMasterSourceProjectAccountingConstraint
Invoice Line | SlapOSMovementConstraint Invoice Line | SlapOSMovementConstraint
Open Sale Order Line | SlapOSAccountingOpenSaleOrderLineConstraint Open Sale Order Line | SlapOSAccountingOpenSaleOrderLineConstraint
Open Sale Order Line | SlapOSMovementConstraint Open Sale Order Line | SlapOSMovementConstraint
Open Sale Order | SlapOSAccountingOpenSaleOrderConstraint Open Sale Order | SlapOSAccountingOpenSaleOrderConstraint
Open Sale Order | SlapOSLedgerConstraint Open Sale Order | SlapOSLedgerConstraint
Open Sale Order | SlapOSSaleProfileConstraint Open Sale Order | SlapOSSaleProfileConstraint
Payment Transaction | SlapOSLedgerConstraint Payment Transaction | SlapOSLedgerAccountingConstraint
Purchase Invoice Transaction | SlapOSLedgerConstraint Purchase Invoice Transaction | SlapOSLedgerAccountingConstraint
Purchase Invoice Transaction | SlapOSVirtualMasterSourceProjectConstraint Purchase Invoice Transaction | SlapOSVirtualMasterSourceProjectAccountingConstraint
Sale Invoice Transaction | SlapOSAccountingSaleInvoiceTransactionConstraint Sale Invoice Transaction | SlapOSAccountingSaleInvoiceTransactionConstraint
Sale Invoice Transaction | SlapOSLedgerConstraint Sale Invoice Transaction | SlapOSLedgerAccountingConstraint
Sale Invoice Transaction | SlapOSSaleProfileConstraint Sale Invoice Transaction | SlapOSSaleProfileConstraint
Sale Order | SlapOSSaleProfileConstraint Sale Order | SlapOSSaleProfileConstraint
Sale Packing List Line | SlapOSAccountingSalePackingListLineConstraint Sale Packing List Line | SlapOSAccountingSalePackingListLineConstraint
......
...@@ -8,6 +8,8 @@ SlapOSAccountingSalePackingListLineConstraint ...@@ -8,6 +8,8 @@ SlapOSAccountingSalePackingListLineConstraint
SlapOSAccountingSaleTradeConditionConstraint SlapOSAccountingSaleTradeConditionConstraint
SlapOSCloudContractAccounting SlapOSCloudContractAccounting
SlapOSCloudContractLineAccounting SlapOSCloudContractLineAccounting
SlapOSLedgerAccountingConstraint
SlapOSLedgerConstraint SlapOSLedgerConstraint
SlapOSMovementConstraint SlapOSMovementConstraint
SlapOSSaleProfileConstraint SlapOSSaleProfileConstraint
SlapOSVirtualMasterSourceProjectAccountingConstraint
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment