Merge lp://staging/~therp-nl/web-addons/7.0-web_relativedelta into lp://staging/~webaddons-core-editors/web-addons/7.0

Proposed by Holger Brunn (Therp)
Status: Rejected
Rejected by: Holger Brunn (Therp)
Proposed branch: lp://staging/~therp-nl/web-addons/7.0-web_relativedelta
Merge into: lp://staging/~webaddons-core-editors/web-addons/7.0
Prerequisite: lp://staging/~therp-nl/web-addons/7.0-web_relativedelta_momentjs
Diff against target: 377 lines (+352/-0)
4 files modified
web_relativedelta/__init__.py (+20/-0)
web_relativedelta/__openerp__.py (+77/-0)
web_relativedelta/static/src/js/web_relativedelta.js (+179/-0)
web_relativedelta/static/test/web_relativedelta.js (+76/-0)
To merge this branch: bzr merge lp://staging/~therp-nl/web-addons/7.0-web_relativedelta
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Needs Resubmitting
Stefan Rijnhart (Opener) Needs Information
Review via email: mp+217653@code.staging.launchpad.net

Description of the change

Reimplementation of relativedelta for use in client side domains in the hope that it sucks less than the one provided in upstream.

This uses http://momentjs.com which was committed separately to simplify the review.

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks! Code looks clean enough. But I was wondering about the rationale. Can you give an example how to use this in a custom module (I assume)? Why do you 'hope' it sucks less, I mean, what is bad about the standard implementation in the OpenERP web client? Why not propose this into upstream OpenERP web client trunk then?

review: Needs Information
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

The hope part is modesty and the fact that I'm not sure that the day= parameter is handled correctly.

What is bad about the standard implementation:
- no weekday, so there's no chance to have filters for the current (calendar) week, next week, etc
- no datetimes, only date
- no hours, minute, second
- negative days are not properly implemented

For an example:
Just use relativedelta as usual, but without the drawbacks as described above

36. By Holger Brunn (Therp)

[IMP] sanitize input for absolute values
[IMP] handle day parameter correctly (don't cross month boundaries)

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :
37. By Holger Brunn (Therp)

[FIX] actually use relativedelta's semantics for weekdays

38. By Holger Brunn (Therp)

[ADD] tests
[ADD] more detail in manifest

39. By Holger Brunn (Therp)

[ADD] actually add tests

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

This project is now hosted on https://github.com/OCA/web. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Needs Resubmitting
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Unmerged revisions

39. By Holger Brunn (Therp)

[ADD] actually add tests

38. By Holger Brunn (Therp)

[ADD] tests
[ADD] more detail in manifest

37. By Holger Brunn (Therp)

[FIX] actually use relativedelta's semantics for weekdays

36. By Holger Brunn (Therp)

[IMP] sanitize input for absolute values
[IMP] handle day parameter correctly (don't cross month boundaries)

35. By Holger Brunn (Therp)

[ADD] web_relativedelta

34. By Holger Brunn (Therp)

[ADD] moment.js

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches