[Erp5-report] r20557 - /erp5/trunk/products/ERP5/Document/TaxRule.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Apr 16 11:05:38 CEST 2008
Author: jerome
Date: Wed Apr 16 11:05:37 2008
New Revision: 20557
URL: http://svn.erp5.org?rev=20557&view=rev
Log:
test if the tax rule will actually do something before applying it
Modified:
erp5/trunk/products/ERP5/Document/TaxRule.py
Modified: erp5/trunk/products/ERP5/Document/TaxRule.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/TaxRule.py?rev=20557&r1=20556&r2=20557&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/TaxRule.py (original)
+++ erp5/trunk/products/ERP5/Document/TaxRule.py Wed Apr 16 11:05:37 2008
@@ -105,3 +105,13 @@
# Pass to base class
Rule.expand(self, applied_rule, force=force, **kw)
+ def test(self, context, *args, **kw):
+ """Test if this rule can be applied.
+
+ We return false immediatly if the rule won't create any simulation
+ movement, to prevent creating an empty applied rule.
+ """
+ if not (context.DeliveryMovement_getCorrespondingTaxLineList()):
+ return False
+ return DeliveryRule.test(self, context, *args, **kw)
+
More information about the Erp5-report
mailing list