Commit f06253ab authored by Tatuya Kamada's avatar Tatuya Kamada

Use Business Link when generating Pay Sheet Movements.

This implements the requirement of the following test.

testPayroll
  test_sourceSectionIsSetOnMovements (testPayroll.TestPayroll)

(reviewed by Aurélien)
parent 4c9fae2c
......@@ -796,8 +796,7 @@ class BusinessProcess(Path, XMLObject):
property_dict['start_date'], property_dict['stop_date'] = \
self.getExpectedTradeModelPathStartAndStopDate(
explanation, trade_model_path, delay_mode=delay_mode)
else:
raise TypeError("Explanation must be an Applied Rule in expand process") # Nothing to do
# Else, nothing to do. This method can be used without Applied Rule.
return property_dict
# IBusinessProcess global API
......
......@@ -205,14 +205,16 @@ class PaySheetTransaction(Invoice):
for trade_phase in movement_list_trade_phase_dic.keys():
business_link_list = business_process.getBusinessLinkValueList(trade_phase=\
trade_phase)
# XXX-Aurel
# must convert amount into simulation movement
# by calling method BusinessProcess.getTradePhaseMovementList
# for now delivery builder will fail because it calls setDeliveryValue
# which does not exists on amount
movement_list = []
for amount in movement_list_trade_phase_dic[trade_phase]:
variation_dict = dict([tuple(x.split('/',1)) for x in amount.getVariationCategoryList()])
movement_list.extend(
business_process.getTradePhaseMovementList(
self, amount, trade_phase, update_property_dict=variation_dict))
for business_link in business_link_list:
builder_list = [portal.restrictedTraverse(url) for url in\
business_link.getDeliveryBuilderList()]
for builder in builder_list:
builder.build(delivery_relative_url_list=[self.getRelativeUrl(),],
movement_list = movement_list_trade_phase_dic[trade_phase])
movement_list = movement_list)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Standard Property" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>mode</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>string</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>elementary_type/boolean</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>same_total_quantity_property</string> </value>
</item>
<item>
<key> <string>mode</string> </key>
<value> <string>w</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Standard Property</string> </value>
</item>
<item>
<key> <string>property_default</string> </key>
<value> <string>python: True</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2011-11-09 tatuya
* Add same_total_quantity into PaySheetModel.
2011-10-12 tatuya
* Add preferred_accounting_bank_account_display_method into AccountingPreference to select the way to display bank account.
......
43
\ No newline at end of file
44
\ 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