Commit c144af4f authored by Julien Muchembled's avatar Julien Muchembled

Sync with trunk@39296

Conflicts:
	bt5/erp5_knowledge_pad/bt/revision
	bt5/erp5_payroll/bt/revision
	bt5/erp5_simulation/bt/revision
	bt5/erp5_trade/bt/comment
	products/ERP5/interfaces/simulation_movement.py

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@39299 20353a03-c40f-0410-a6d1-a30d3c3de9de
parents c1fd1b6b 78fca6ca

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

9 12
\ No newline at end of file \ No newline at end of file
None
\ No newline at end of file
1369 1372
\ No newline at end of file \ No newline at end of file
16 19
\ No newline at end of file \ No newline at end of file
12 15
\ No newline at end of file \ No newline at end of file
20 23
\ No newline at end of file \ No newline at end of file
3 6
\ No newline at end of file \ No newline at end of file
15 18
\ No newline at end of file \ No newline at end of file
5 8
\ No newline at end of file \ No newline at end of file
7 10
\ No newline at end of file \ No newline at end of file
14 17
\ No newline at end of file \ No newline at end of file
28 31
\ No newline at end of file \ No newline at end of file
17 20
\ No newline at end of file \ No newline at end of file
52 55
\ No newline at end of file \ No newline at end of file
19 22
\ No newline at end of file \ No newline at end of file
6 9
\ No newline at end of file \ No newline at end of file
175 178
\ No newline at end of file \ No newline at end of file
123 126
\ No newline at end of file \ No newline at end of file
90 93
\ No newline at end of file \ No newline at end of file
...@@ -119,7 +119,7 @@ class ApparelModel: ...@@ -119,7 +119,7 @@ class ApparelModel:
'mode' : 'w' }, 'mode' : 'w' },
) )
_categories = ( 'composition', 'transformation_state', 'pricing', 'origin', 'brand', 'tariff_nomenclature' ) _categories = ( 'composition', 'pricing', 'origin', 'brand', 'tariff_nomenclature' )
#_categories = ( 'transformation_state', 'apparel_pricing', 'apparel_creation_type', 'brand', 'tariff_nomenclature' ) #_categories = ( 'transformation_state', 'apparel_pricing', 'apparel_creation_type', 'brand', 'tariff_nomenclature' )
# XXXXXXX XXXX XXXX apparel_model_creation_type (As in Brussels Tariff Nomenclature) # XXXXXXX XXXX XXXX apparel_model_creation_type (As in Brussels Tariff Nomenclature)
......
None
\ No newline at end of file
267 270
\ No newline at end of file \ No newline at end of file
None
\ No newline at end of file
86 89
\ No newline at end of file \ No newline at end of file
4 7
\ No newline at end of file \ No newline at end of file
685 688
\ No newline at end of file \ No newline at end of file
...@@ -98,12 +98,6 @@ if transaction.getTotalPrice(fast=0, portal_type = \'Check Operation Line\') != ...@@ -98,12 +98,6 @@ if transaction.getTotalPrice(fast=0, portal_type = \'Check Operation Line\') !=
msg = Message(domain=\'ui\', message="Total price doesn\'t match.")\n msg = Message(domain=\'ui\', message="Total price doesn\'t match.")\n
raise ValidationFailed, (msg,)\n raise ValidationFailed, (msg,)\n
\n \n
# if manual validation, check overdreaft facility\n
if state_change[\'transition\'].getId() == "wait_action":\n
context.checkAccountIsOverdraftFacility(state_change)\n
\n
\n
bank_account_dict = {}\n
seen_check_dict = {}\n seen_check_dict = {}\n
\n \n
is_check_less = transaction.isCheckLess()\n is_check_less = transaction.isCheckLess()\n
...@@ -161,31 +155,7 @@ for check_operation_line in transaction.contentValues(filter = {\'portal_type\' ...@@ -161,31 +155,7 @@ for check_operation_line in transaction.contentValues(filter = {\'portal_type\'
check = transaction.Base_checkCheck(bank_account=source_bank_account, reference=check_number,\n check = transaction.Base_checkCheck(bank_account=source_bank_account, reference=check_number,\n
resource=check_type)\n resource=check_type)\n
if check_operation_line.getAggregate() != check.getRelativeUrl():\n if check_operation_line.getAggregate() != check.getRelativeUrl():\n
check_operation_line.edit(aggregate=check.getRelativeUrl()) \n check_operation_line.edit(aggregate=check.getRelativeUrl())\n
\n
# Test if the account balance is sufficient.\n
if state_change[\'transition\'].getId() == "plan_action":\n
account_path = source_bank_account.getRelativeUrl()\n
if bank_account_dict.has_key(account_path):\n
check_price = bank_account_dict[account_path] + check_operation_line.getPrice() \n
else:\n
check_price = check_operation_line.getPrice()\n
bank_account_dict[account_path] = check_price\n
error = context.BankAccount_checkBalance(account_path, check_price)\n
if error[\'error_code\'] == 1:\n
msg = Message(domain=\'ui\', message="Bank account $account is not sufficient on line $line.",\n
mapping={"account": source_bank_account.getInternalBankAccountNumber(), "line" : check_operation_line.getId()})\n
raise ValidationFailed, (msg,)\n
elif error[\'error_code\'] == 2:\n
msg = Message(domain=\'ui\', message="Bank account $account is not valid on $line.",\n
mapping={"account": source_bank_account.getInternalBankAccountNumber(), "line" : check_operation_line.getId()})\n
raise ValidationFailed, (msg,)\n
elif error[\'error_code\'] != 0:\n
msg = Message(domain=\'ui\', message="Unknown error code.")\n
raise ValidationFailed, (msg,)\n
\n
if transaction.getSimulationState() == "draft" and state_change[\'transition\'].getId() == "plan_action":\n
context.createCheckDepositLine(state_change)\n
]]></string> </value> ]]></string> </value>
...@@ -248,8 +218,6 @@ if transaction.getSimulationState() == "draft" and state_change[\'transition\']. ...@@ -248,8 +218,6 @@ if transaction.getSimulationState() == "draft" and state_change[\'transition\'].
<string>msg</string> <string>msg</string>
<string>price</string> <string>price</string>
<string>destination_bank_account</string> <string>destination_bank_account</string>
<string>context</string>
<string>bank_account_dict</string>
<string>seen_check_dict</string> <string>seen_check_dict</string>
<string>is_check_less</string> <string>is_check_less</string>
<string>_getiter_</string> <string>_getiter_</string>
...@@ -261,9 +229,6 @@ if transaction.getSimulationState() == "draft" and state_change[\'transition\']. ...@@ -261,9 +229,6 @@ if transaction.getSimulationState() == "draft" and state_change[\'transition\'].
<string>seen_check</string> <string>seen_check</string>
<string>_write_</string> <string>_write_</string>
<string>check</string> <string>check</string>
<string>account_path</string>
<string>check_price</string>
<string>error</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
transaction = state_change[\'object\']\n
\n
# Test if the account balance is sufficient.\n
bank_account_dict = {}\n
for check_operation_line in transaction.objectValues(portal_type=\'Check Operation Line\'):\n
account_path = check_operation_line.getSourcePaymentValue().getRelativeUrl()\n
bank_account_dict[account_path] = bank_account_dict.get(account_path, 0) + check_operation_line.getPrice()\n
for account_path, amount in bank_account_dict.items():\n
error = context.BankAccount_checkBalance(account_path, amount)[\'error_code\']\n
if error == 1:\n
raise ValidationFailed, (Message(domain=\'ui\', message="Bank account $account is not sufficient.",\n
mapping={"account": source_bank_account.getInternalBankAccountNumber()}), )\n
elif error == 2:\n
raise ValidationFailed, (Message(domain=\'ui\', message="Bank account $account is not valid.",\n
mapping={"account": source_bank_account.getInternalBankAccountNumber()}), )\n
elif error != 0:\n
raise ValidationFailed, (Message(domain=\'ui\', message="Unknown error code."),)\n
\n
context.validateConsistency(state_change)\n
\n
if transaction.getSimulationState() == "draft":\n
context.createCheckDepositLine(state_change)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getitem_</string>
<string>transaction</string>
<string>bank_account_dict</string>
<string>_getiter_</string>
<string>_getattr_</string>
<string>check_operation_line</string>
<string>account_path</string>
<string>_write_</string>
<string>amount</string>
<string>context</string>
<string>error</string>
<string>source_bank_account</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>validatePlanActionConsistency</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># if manual validation, check overdreaft facility\n
context.checkAccountIsOverdraftFacility(state_change)\n
\n
context.validateConsistency(state_change)\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>state_change</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>validateWaitActionConsistency</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
<value> <string>validateConsistency</string> </value> <value> <string>validatePlanActionConsistency</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</item> </item>
<item> <item>
<key> <string>script_name</string> </key> <key> <string>script_name</string> </key>
<value> <string>validateConsistency</string> </value> <value> <string>validateWaitActionConsistency</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
############################################################################## ##############################################################################
# #
# Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved. # Copyright (c) 2006 Nexedi SARL and Contributors. All Rights Reserved.
# Aurélien Calonne <aurel@nexedi.com> # Aurelien Calonne <aurel@nexedi.com>
# #
# WARNING: This program as such is intended to be used by professional # WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential # programmers who take the whole responsability of assessing all potential
......
45 48
\ No newline at end of file \ 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