Code review comment for lp:~savoirfairelinux-openerp/banking-addons/loose-coupling

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

> And I do not see the point of adding return True to functions where this does
> not have any meaning:
> if a function contains (or detects) errors, it should throw an exception. No
> exception thrown means function did the work it was supposed to do.

That's related to the XML/RPC API of OpenERP.
OpenERP considers that all the public methods are accessible from the XML/RPC service, all public methods should have a return value that is valid for XML/RPC. As XML/RPC forbids None values, usually a True / False value is returned.

I see 2 figures:
 - if a method should be accessible from XML/RPC, it should never return None
 - if not, it should be declared private (prefixed with _) and does not need to return anything if it does not make sense.

« Back to merge proposal