Create business links necessary to correctly expand simulation with tax and discount trade phases

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@45257 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2712522c
......@@ -469,8 +469,32 @@ class TestTradeModelLine(TestTradeModelLineMixin):
taxed = self.createProductTaxed()
discounted = self.createProductDiscounted()
taxed_discounted = self.createProductDiscountedTaxed()
business_process = self.createBusinessProcess(
business_link_list = [
dict(reference='discount',
trade_phase='default/discount',
predecessor='trade_state/invoiced',
# should successor be trade_state/discounted? There is no
# such trade_state category
successor='trade_state/accounted',
),
dict(reference='tax',
trade_phase='default/tax',
predecessor='trade_state/invoiced',
# should successor be trade_state/taxed? There IS such a
# trade_state category, but the rule that wants to match
# the Simulation Movement that has this link as causality
# is default_invoice_transaction_rule, the same as for
# default/discount, so I'll use the same successor as
# above. Besides, we'd have to create a new business_link
# just to get back to accounted, and match it with (or
# create a new) a portal_rule.
successor='trade_state/accounted',
),
],
)
trade_condition = self.createTradeCondition(
self.createBusinessProcess(), (
business_process, (
dict(price=self.default_discount_ratio,
base_application='base_amount/discount',
base_contribution='base_amount/tax',
......
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