Commit e4068e34 authored by Łukasz Nowak's avatar Łukasz Nowak

- create default invoice rule needed by invoices, even for those built by builder


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28718 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2145f38e
...@@ -82,6 +82,7 @@ class TestBPMEvaluationMixin(TestBPMMixin): ...@@ -82,6 +82,7 @@ class TestBPMEvaluationMixin(TestBPMMixin):
self._createOrderRule() self._createOrderRule()
self._createDeliveryRule() self._createDeliveryRule()
self._createInvoicingRule() self._createInvoicingRule()
self._createInvoiceRule()
self._createTradeModelRule() self._createTradeModelRule()
def _createRootTradeRule(self, **kw): def _createRootTradeRule(self, **kw):
...@@ -169,6 +170,17 @@ class TestBPMEvaluationMixin(TestBPMMixin): ...@@ -169,6 +170,17 @@ class TestBPMEvaluationMixin(TestBPMMixin):
rule.validate() rule.validate()
transaction.commit() transaction.commit()
def _createInvoiceRule(self):
# XXX: This is not needed, but invoices, even if built from simulation
# need those rule to create empty one
rule_tool = self.portal.portal_rules
clipboard = rule_tool.manage_copyObjects(ids = ['default_invoice_rule'])
pasted = rule_tool.manage_pasteObjects(clipboard)
new_rule = getattr(rule_tool, pasted[0]['new_id'])
new_rule.validate()
transaction.commit()
def _createInvoicingRule(self): def _createInvoicingRule(self):
# TODO: version # TODO: version
edit_dict = {} edit_dict = {}
......
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