| Age | Commit message (Collapse) | Author |
|
This commit introduces a new module system for the javascript code.
Instead of using global (namespaced) variables everywhere (like
openerp.web.whatever, ...), each file declare one (or more) module
with its dependencies. Each module will be loaded after its
dependencies, and will be given a reference to the return values.
This change is a massive departure from the way the client worked
previously. It will sadly break some/most history, but I am sure that
the future git ecosystem will allow you to easily browse the history
past this revision (one can dream).
This commit feature:
* main namespace is now odoo instead of openerp
* a way to define modules and dependencies (inspired by requirejs)
* many files have been splitted in simpler subfiles
* basic support for debugging in odoo.__DEBUG__
* no global variable (i.e. nothing in window.openerp)
* many bug fixes, many new bugs
Future vision: this modularization should simplify future code
development, simplify debugging and will allow a serious testing effort
|
|
Rewrite relativedelta.__add__ based on dateutil 2.4.0
* completely remove any hint of supporting time deltas (could be
implemented in the future, but not currently asked for and lots of
code to implement)
* implement weekday support (ordinal only)
* probably better leapyear support
* remove relativedelta.__sub__ (only works between relativedeltas)
* add relativedelta.__neg__
fixes #5089
|
|
courtesy of mva. This adds the weekday function to date objects in
pyeval. This will be useful for adding better filters (such as this
week) in the searchview.
|
|
Needed to create filters like "previous month"
It was just defined for "datetime", but is also needed for "date"
closes #2915
|
|
The problem was that when the user manipulates the graph view (in pivot
table mode), the graph view resetted the group by facet in the search
view. It was not a problem unless a custom filter with a groupby was
already there, in which case, the group bys were duplicated.
The search view is now smarter, it only resets the additional groupbys
(and col_groupbys). Also, to prevent usability problems, the graph
view disable the '+/-' groupbys added by a custom filters.
Note that this fix is only temporary: a revamp of custom filters, facets,
search view is coming in the next months. (at least, that's the idea). Right
now, too much 'search logic' is in the graph view.
Another note: this fix is somewhat fragile: it makes some assumptions
about the search query (mainly that the custom filter is the first facet,
also, that no other filters add groupbys/col_groupbys)
|
|
* Alter datetime.now(), generate a local datetime (add utcnow() which generates a UTC datetime)
* Implement datetime.replace() to manipulate local datetimes
* Implement date.today(), generates a local date
* Implement datetime.toJSON(), returns a javascript Date (assumes datetime attributes are local)
* Add conversion hook in JSON and JSONP handlers, automatically converts a Date object to a UTC datetime formatted according to server formats
Should allow the generation of correctly working (from the end-user's POV) [Today] filters, amongst other things.
Eg: a local expression in a domain for 'Today 00:00:00' would now be expressed as 'datetime.datetime.now().replace(hour=0, minute=0, second=0)' (no .strftime) and will be converted to UTC when sent to the server
bzr revid: mat@openerp.com-20140128133706-4yp610pp5w06tcia
|
|
* change datetime.now() to generate user-local naive datetimes
* add datetime.utcnow() behaving as the old now()
* add date.today() generating a user-local date (for the current day)
* add datetime.replace() to replace any specific attribute of the
datetime object (except tzinfo, for now)
* datetime.toJSON() now returns the equivalent javascript Date object
(warning: uses the datetime attributes directly, since datetimes are
naive if they were created with utcnow() the Date result is going to
be complete nonsense). With the previous commit datetime.now()
generates a user-local now() which is converted to the correct UTC
datetime when sent to the server.
This means it becomes possible to generate datetime bounds for the
user's local today with either
datetime.datetime.now().replace(hour=0, minute=0, second=0)
or
datetime.datetime.combine(
datetime.date.today(),
datetime.time())
and once send over JSON-RPC the server will get the local datetime
in UTC to the server's format.
nb: user-local means "in the timezone of the user's browser" in this
context.
bzr revid: xmo@openerp.com-20140122151911-akn1nr6e739eg92s
|
|
bzr revid: ged@openerp.com-20131113102204-m0gox7odwgkmon4o
|
|
Still has some retro-compatibility for other addons.
bzr revid: nicolas.vanhoren@openerp.com-20130806125022-bzjbtn0nqk40ak4g
|
|
bzr revid: nicolas.vanhoren@openerp.com-20130725103301-65nld10p1if7k0zt
|
|
bzr revid: nicolas.vanhoren@openerp.com-20130725100749-0i82gf3k3nvt4r44
|
|
bzr revid: mat@openerp.com-20130702141600-4s7oan9yidjrlmcc
|
|
JS objects are converted to py.object when passed in through the
evaluation context. py.object are not serializable by default (because
that doesn't really make sense), which breaks when the input is
intended as a dict and returned (e.g. o2m values, which are triples of
(int, int?, dict?)).
Intuitively, JS objects passed as part of the context should be mostly
JSON-ish and thus dicts, but that turns out not work work as some
addons use attribute accesses within contexts (e.g. parent.access in
account/account_invoice_view.xml)
=> Temporarily solve by converting raw js objects to an "attributed
dict" which acts as both a dict and an object and can be converted to
JSON.
Ideally, py.js should provide for a pluggable conversion, or should
use an attributed mapping internally. See issues 21 and 23.
lp bug: https://launchpad.net/bugs/1182101 fixed
bzr revid: xmo@openerp.com-20130624055929-3rtkgqrp4o87pvau
|
|
read-only mode
bzr revid: nicolas.vanhoren@openerp.com-20130319102719-0gdwvmix4d3x8th5
|
|
bzr revid: xmo@openerp.com-20130318105244-qkgvi69do0219lkk
|
|
Custom keys from user context may be used in action contexts (not just
e.g. searchview filters). For instance, have a custom key
context_salesteam (in the user model) and an action defining some
search default as a function of the salesteam.
In that case, the action's context evaluation (view.js:~275) will blow
up.
Ensure that does not happen.
Note: eval_contexts already injects user_context in the reduction of
contexts to evaluate. It should be possible to alter the reduction
function to avoid having to inject instance.session.user_context
through pyeval.context(), maybe by _.extend-ing ``result_context``
into ``evaluation_context`` at the *top* of the reduction function
rather than at its bottom?
bzr revid: xmo@openerp.com-20130128130640-ksyvxvx6rlc4820n
|
|
bzr revid: xmo@openerp.com-20121130103638-8r77jpmb3hhmo8dt
|
|
bzr revid: nicolas.vanhoren@openerp.com-20121130095228-mffq2407lq7tf8jj
|
|
bzr revid: nicolas.vanhoren@openerp.com-20121129160746-c3c691zk5fxhzse0
|
|
only returns the same timezone than server (UTC).
bzr revid: nicolas.vanhoren@openerp.com-20121129153601-vtpnvkc0vylo9hux
|
|
bzr revid: xmo@openerp.com-20121128110542-nplg9o3e5jpxmqic
|
|
bzr revid: xmo@openerp.com-20121126084229-wgpjszmquhibbrpf
|
|
bzr revid: xmo@openerp.com-20121123114923-t4047w6jztria91x
|
|
bzr revid: xmo@openerp.com-20121123113932-siz0u2vp2u7z6wk2
|
|
bzr revid: xmo@openerp.com-20121123101822-inox7gkxvd0gtqbp
|
|
bzr revid: xmo@openerp.com-20121123101658-xoynynruwnuzyrv3
|
|
bzr revid: xmo@openerp.com-20121123095824-xg6afc1l01t3y48y
|
|
bzr revid: xmo@openerp.com-20121123095206-dtvoiignb7xnzsl0
|
|
bzr revid: xmo@openerp.com-20121123075938-oazwt4bn2l639r3a
|
|
so you can access the context while you're accessing the context
bzr revid: xmo@openerp.com-20121122124130-t8j6sggtnl4f0b8r
|
|
side, also add some offline-evaluation of contexts and domains in rpc call methods
bzr revid: xmo@openerp.com-20121011100532-5ihje0maslp37zpf
|
|
contexts and domains should be local, not UTC
bzr revid: xmo@openerp.com-20121011075759-qfwkfws5tu9yidab
|
|
contexts
bzr revid: xmo@openerp.com-20121010145945-16shdry3udum0mn1
|
|
bzr revid: xmo@openerp.com-20121008125523-ed1g42vjxbcfo62r
|
|
timedelta
bzr revid: xmo@openerp.com-20121008120619-lhmexjnujjrigjn9
|
|
bzr revid: xmo@openerp.com-20121005142808-yx6o8nfnn0o4ms56
|
|
bzr revid: xmo@openerp.com-20121005131205-ffk746ac5xrua62j
|
|
corelib, as well as the standard evaluation context building (and related objects)
bzr revid: xmo@openerp.com-20120806094627-8c9lwtfkbfws2bmj
|