Merge lp:~akretion-team/openobject-addons/addons_purchase into lp:openobject-addons
Status: | Rejected |
---|---|
Rejected by: | Antony Lesuisse (OpenERP) |
Proposed branch: | lp:~akretion-team/openobject-addons/addons_purchase |
Merge into: | lp:openobject-addons |
Diff against target: |
51 lines (+17/-3) 1 file modified
purchase/purchase.py (+17/-3) |
To merge this branch: | bzr merge lp:~akretion-team/openobject-addons/addons_purchase |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Olivier Dony (Odoo) | Approve | ||
Florent (community) | Approve | ||
Review via email: mp+88347@code.launchpad.net |
Description of the change
This is a refactoring of date_planned in the class purchase_order_line in order to overload it easily. I define a new fonction: _get_date_planned. I need it for a module calculating the delivery orders considering the working time.
Moreover, it seems to me that having int(seller_delay) or 0.0 is useless. Indeed, if seller_delay == False, int() will return 0.
I can add a commit to delete "or 0.0" if it's necessary.
Unmerged revisions
- 6339. By Benoit Guillot - http://www.akretion.com
-
[FIX] fix typo and change the "int" conversion
- 6338. By Benoit Guillot - http://www.akretion.com
-
[REF] Refactor the function purchase/
_get_date_ planned to have the seller informations in the function - 6337. By Benoit Guillot - http://www.akretion.com
-
[FIX] Change the returned type to fit with the other methods: _get_purchase_
schedule_ date and _get_purchase_ order_date - 6336. By Benoit Guillot - http://www.akretion.com
-
[REF]refactor of the date_planned in the purchase order line
The patch looks OK.
However, the returned value can be simplified as:
return str(datetime.now() + relativedelta( days=int( seller_ delay)) )
Because str() returns the correct value:
- on a 'date' it returns '%Y-%m-%d'
- on a 'datetime' it returns '%Y-%m-%d %H:%M:%S'
In this case the date_planned is a 'fields.date' object, so it's ok to store '%Y-%m-%d' on it.
The docstring should be fixed accordingly.