-
- Downloads
[IMP] base: Deprecate 'compute' and introduce '_convert'
Purpose ======= The method compute is annoying for the following reasons: - 'compute' is difficult to grep - Developers don't understand that they can specify the company and the date on which we want to convert the amount. This is quite error prone because if these parameters aren't specified, they are set by default to the company of the current user and the current date (today). - Passing parameters is the context is not a correct way to call a method. Furthermore, using with_context is not really good for the performance too, as the record as to be rebrowsed, the computed fields have to be re-evaluated Specification ============= - Introduce a new method '_convert'. This method takes 2 more parameters: 'company' and 'date'. - Deprecate 'compute' and '_compute'. Log a warning to notify that we should use '_convert'.
Please register or sign in to comment