[Erp5-users] Changing default_invoice_transaction_rule

Romain Courteaud romain at nexedi.com
Thu May 10 15:13:33 CEST 2007


* Lukasz Nowak [2007-05-08 12:26:56 +0200]:

> Hello,

Hello,

> I've created some predicates for default_invoice_transaction_rule. With
> this DITRs we do have some Orders, Packing Lists and Invoices in many
> different states.
> 
> With more experience in ERP5 system we stopped at point, where our DITRs
> has to be reimplemented. Well - I've created new ones, they are passing
> our unit tests. But now it is time to upgrade our production system -
> with updating of DITRs.
> 
> In 1st scenario I've deleted old predicates in
> default_invoice_transaction_rule. Well - old orders, packing lists,
> invoices, etc aren't expandable anymore. System down, backup restore, 20
> cigarettes, system up.
> 
> I was thinking about disabling our "obsolete" predicates. So I've
> created function which always returns false and attached it as test
> method id for our obsolete predicates in DITRs, creating new ones.
> 
> My questions:
>  * is such method for obsoleting predicates, but still applying rules is
> good?
>  * where I may find documentation/code snippets/case studies describing
> such scenarios?
>  * is changing DITRs acceptable in real-world running systems? I fell
> that from time to time such configuration change - to be up-to-date with
> law, to solve some misconfiguration?

Currently, there is no documentation for such cases. And some parts in
the default erp5 bt5s are still missing.

All rules in portal_rules need a validation_workflow, which is used to
validate/invalidate rules.
Rules also have start_date and stop_date properties, which have to be
used as applicable time period of the rule.

Then, test methods in Rule Document have to check the workflow state of the rule,
and the start and stop dates.
An efficient way could be to add the predicate API to rules.

In your case, the idea is not to "obsoleting predicates", but obsoleting
rules, in order to keep compatibility with existing datas, by:
 - entering a close date in the default_invoice_transaction_rule
 - copy/paste it, and change predicates in the pasted rule.
 - change the start/stop dates of the pasted rule
 - validate the pasted rule

Those explanations have to be entered in the discussion:
http://erp5.org/Discussion/SimulationRules
but I didn't had time yet to had it.

Romain



More information about the Erp5-users mailing list