Discussion:
[Erp5-dev] PredicateMatrix.py backward compatibility fix with warning proposal
Łukasz Nowak
2008-06-03 09:04:56 UTC
Permalink
Hello,

I'm going on risky path to upgrade our system from old 15401 revision
to version-5.0 from tags. (BTW: Is that destination revision good
decision?)

And I'm trying to have only one source tree for both versions as long
as possible, so sometimes I'm spotting incompatibilities.

One of them is problem with updateMatrix from PredicateMatrix. Patch
attached, so it is possible to use customised
InvoiceTransactionRule_asCellRange, using old API (relative_url)
instead of id.[1]

Proposed patch attached.

Regards,
Luke

[1]http://svn.erp5.org/?view=rev&revision=20541
--
?ukasz Nowak R&D Ventis http://www.ventis.com.pl/
tel: +48 32 768 16 85 fax: +48 32 392 10 61
``Use the Source, Luke...'' I am only craftsman.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PredicateMatrix.py-backward-comp.patch
Type: text/x-patch
Size: 1336 bytes
Desc: not available
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20080603/2841fd41/attachment.bin>
Yoshinori Okuji
2008-06-06 12:36:08 UTC
Permalink
Post by Łukasz Nowak
Hello,
I'm going on risky path to upgrade our system from old 15401 revision
to version-5.0 from tags. (BTW: Is that destination revision good
decision?)
It is difficult to answer this question. It depends on your requirements. Bug
fixes have been made since then, as usual. But I can say that it is fairly
stable.
Post by Łukasz Nowak
And I'm trying to have only one source tree for both versions as long
as possible, so sometimes I'm spotting incompatibilities.
One of them is problem with updateMatrix from PredicateMatrix. Patch
attached, so it is possible to use customised
InvoiceTransactionRule_asCellRange, using old API (relative_url)
instead of id.[1]
Proposed patch attached.
It is a bad idea to catch all exceptions (i.e. except:).

Besides that, there might be an easier way to check the API. For instance, if
a relative URL is given, it should contain '/'. But I think J?r?me should
take a look, as I don't know this change well.

YO
--
Yoshinori Okuji, Nexedi CTO
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Full Featured High End Open Source ERP
http://www.erp5.com
ERP5 Wiki: Developer Zone for ERP5 Community
http://www.erp5.org
Jérome Perrin
2008-06-13 12:59:43 UTC
Permalink
Hi,
Post by Yoshinori Okuji
Post by Łukasz Nowak
And I'm trying to have only one source tree for both versions as
long
Post by Łukasz Nowak
as possible, so sometimes I'm spotting incompatibilities.
One of them is problem with updateMatrix from PredicateMatrix. Patch
attached, so it is possible to use customised
InvoiceTransactionRule_asCellRange, using old API (relative_url)
instead of id.[1]
r20475 was an incompatible change, before this change it was impossible,
to copy and paste an invoice transaction rule.
Post by Yoshinori Okuji
Post by Łukasz Nowak
Proposed patch attached.
It is a bad idea to catch all exceptions (i.e. except:).
Besides that, there might be an easier way to check the API. For instance, if
a relative URL is given, it should contain '/'. But I think J?r?me should
take a look, as I don't know this change well.
Checking that the cell index contain "/" could be a way, but I'm not
sure this will always be true in the future. To make it easier I added
code to migrate existing invoice transaction rule's matrix index to the
new format in r21581.

J?rome

Loading...