Commit 6ba190da authored by Alexandre Boeglin's avatar Alexandre Boeglin

Moved source_section and source_destination verification to the rule test

method.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@18470 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7c605a07
...@@ -86,23 +86,12 @@ class InvoicingRule(Rule): ...@@ -86,23 +86,12 @@ class InvoicingRule(Rule):
# XXX Isn't it better to share the code with expand method # XXX Isn't it better to share the code with expand method
context_movement = applied_rule.getParentValue() context_movement = applied_rule.getParentValue()
# Do not invoice within the same entity or whenever entities are not all
# defined.
# It could be OK to invoice within different entities of the same
# company if we wish to get some internal analytical accounting but that
# requires some processing to produce a balance sheet.
source_section = context_movement.getSourceSection()
destination_section = context_movement.getDestinationSection()
if source_section == destination_section or source_section is None \
or destination_section is None:
return []
# XXX Harcoded list # XXX Harcoded list
invoice_line = { invoice_line = {
'source': context_movement.getSource(), 'source': context_movement.getSource(),
'source_section': source_section, 'source_section': context_movement.getSourceSection(),
'destination': context_movement.getDestination(), 'destination': context_movement.getDestination(),
'destination_section': destination_section, 'destination_section': context_movement.getDestinationSection(),
'start_date': context_movement.getStartDate(), 'start_date': context_movement.getStartDate(),
'stop_date': context_movement.getStopDate(), 'stop_date': context_movement.getStopDate(),
'resource': context_movement.getResource(), 'resource': context_movement.getResource(),
......
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