Commit 5e43dad4 authored by Sebastien Robin's avatar Sebastien Robin

- the allowed content type of checkbook model was missing

- use getCurrentInventory instead of getAvailableInventory when we check counter stock value
- add some delete transitions

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13542 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4dcb8f16
......@@ -45,7 +45,7 @@
<key> <string>_keys</string> </key>
<value>
<list>
<string>table_0</string>
<string>table_0</string>
</list>
</value>
</item>
......@@ -106,7 +106,7 @@
<key> <string>src</string> </key>
<value> <string encoding="cdata"><![CDATA[
<dtml-var table_0>.original_message = catalog.simulation_state_title\n
<dtml-var table_0>.original_message = catalog.simulation_state\n
AND <dtml-var table_0>.message_context = "simulation_state_title"\n
AND <dtml-var table_0>.language = <dtml-sqlvar "Localizer.get_selected_language()" type="string">
......@@ -146,7 +146,7 @@
<key> <string>raw</string> </key>
<value> <string encoding="cdata"><![CDATA[
<dtml-var table_0>.original_message = catalog.simulation_state_title\n
<dtml-var table_0>.original_message = catalog.simulation_state\n
AND <dtml-var table_0>.message_context = "simulation_state_title"\n
AND <dtml-var table_0>.language = <dtml-sqlvar "Localizer.get_selected_language()" type="string">
......
......@@ -11,6 +11,9 @@
<portal_type id="Checkbook">
<item>Check</item>
</portal_type>
<portal_type id="Checkbook Model">
<item>Checkbook Model Check Amount Variation</item>
</portal_type>
<portal_type id="Checkbook Model Module">
<item>Checkbook Model</item>
<item>Check Model</item>
......
......@@ -472,12 +472,17 @@
<item>
<key> <string>report_root_list</string> </key>
<value>
<list/>
<list>
<tuple>
<string>parent</string>
<string>Parent</string>
</tuple>
</list>
</value>
</item>
<item>
<key> <string>report_tree</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>search</string> </key>
......
......@@ -85,7 +85,7 @@ requested_dict = {}\n
# test all movement\n
tmp_list = context.contentValues(filter={\'portal_type\': portal_type})\n
#context.log(\'tmp_list\', str((tmp_list, portal_type, context)))\n
#context.log(\'source\',source)\n
context.log(\'source\',source)\n
line_list = []\n
for l in tmp_list :\n
# The source can be different for every line (due to getBaobabSource approach)\n
......@@ -114,18 +114,20 @@ for line in line_list :\n
for cell in line.objectValues() :\n
variation_text = cell.getVariationText()\n
#context.log(\'check cell : \', str((source_counter, line_resource, variation_text)))\n
inventory_value = context.portal_simulation.getFutureInventory(node=source_counter, resource = line_resource,\n
inventory_value = context.portal_simulation.getCurrentInventory(node=source_counter, resource = line_resource,\n
variation_text = variation_text)\n
#context.log(\'cell quantity\', cell.getQuantity())\n
#context.log(\'inventory value\', inventory_value)\n
if inventory_value - cell.getQuantity() < 0:\n
context.log(\'bad value for:\',context.portal_simulation.getCurrentInventory(node=source_counter, resource = line_resource,\n
variation_text = variation_text,src__=1))\n
msg = Message(domain=\'ui\', message=\'Insufficient balance for $resource, letter $letter, status $status and variation $variation\', mapping={\'resource\':cell.getResourceTranslatedTitle(),\n
\'letter\': cell.getEmissionLetterTitle(),\n
\'status\': cell.getCashStatusTranslatedTitle(),\n
\'variation\':cell.getVariationTitle()})\n
raise ValidationFailed, (msg,)\n
else :\n
inventory_value = context.portal_simulation.getFutureInventory(section=source_counter, resource=line_resource)\n
inventory_value = context.portal_simulation.getCurrentInventory(section=source_counter, resource=line_resource)\n
if inventory_value - line.getQuantity() < 0 :\n
msg = Message(domain=\'ui\', message=\'Insufficient balance for $resource, letter $letter, status $status and variation $variation\', mapping={\'resource\':line.getResourceTranslatedTitle(),\n
\'letter\': line.getEmissionLetterTitle(),\n
......
......@@ -77,7 +77,25 @@ if len(user_site_list)>0:\n
context.setSite(site_url)\n
\n
from DateTime import DateTime\n
context.setStartDate(DateTime(DateTime().Date()))\n
start_date = DateTime(DateTime().Date())\n
context.setStartDate(start_date)\n
\n
# Set a reference\n
site_id = context.getSiteId()\n
\n
counter_date_list = [x.getObject() for x in context.portal_catalog(\n
portal_type=\'Counter Date\',site_id=site_id,\n
so_order=[(\'start_date\',\'descending\')],limit=10,\n
simulation_state=(\'open\',\'closed\'))]\n
previous_reference = None\n
if len(counter_date_list)>0:\n
previous_counter_date = counter_date_list[0]\n
previous_reference = previous_counter_date.getReference()\n
if previous_reference not in (\'\',None):\n
reference = \'%i\' % (int(previous_reference)+1)\n
else:\n
reference = \'1\'\n
context.setReference(reference)\n
]]></string> </value>
......@@ -137,6 +155,18 @@ context.setStartDate(DateTime(DateTime().Date()))\n
<string>site</string>
<string>site_url</string>
<string>DateTime</string>
<string>start_date</string>
<string>site_id</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>counter_date_list</string>
<string>None</string>
<string>previous_reference</string>
<string>previous_counter_date</string>
<string>int</string>
<string>reference</string>
</tuple>
</value>
</item>
......
......@@ -105,8 +105,6 @@ if vault_report_type is None or vault_report_type==\'inventory\':\n
# add to get by portal type inventory\n
if kw.has_key("portal_type"):\n
inventory_kw[\'portal_type\'] = kw[\'portal_type\']\n
if kw.has_key("explanation_portal_type"):\n
inventory_kw[\'explanation_portal_type\'] = kw[\'explanation_portal_type\']\n
if kw.has_key("omit_input"):\n
inventory_kw[\'omit_input\'] = kw[\'omit_input\']\n
if kw.has_key("omit_output"):\n
......
......@@ -75,7 +75,7 @@ bank_account = state_change[\'object\']\n
\n
# use of the constraint\n
vliste = bank_account.checkConsistency()\n
if len(vliste) != 0:\n
if len(vliste) != 0 and bank_account.getParentValue().getPortalType()!=\'Person\':\n
raise ValidationFailed, (vliste[0].getTranslatedMessage(),)\n
</string> </value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.States</string>
<string>StateDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>deleted</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Deleted</string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Persistence</string>
<string>PersistentMapping</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_container</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -50,6 +50,8 @@
<string>cancel_action</string>
<string>confirm</string>
<string>confirm_action</string>
<string>delete</string>
<string>delete_action</string>
</tuple>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Transitions</string>
<string>TransitionDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>delete</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>deleted</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Transitions</string>
<string>TransitionDefinition</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>delete</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>delete_action</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<tuple>
<string>Products.DCWorkflow.Guard</string>
<string>Guard</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Manager</string>
<string>Assignor</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -83,9 +83,7 @@
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......
152
\ No newline at end of file
157
\ No newline at end of file
......@@ -3,6 +3,7 @@ Check Model | Check Model Type Variation
Check Module | Check
Checkbook Model Module | Check Model
Checkbook Model Module | Checkbook Model
Checkbook Model | Checkbook Model Check Amount Variation
Checkbook Module | Checkbook
Checkbook | Check
Counter Date Module | Counter Date
......
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