Allow module to override the http dispatching process:
- The default implementation uses werkzeug.routing but any other method could
be used, it'a also possible to pre/postprocess (i.e. url aliases)
- Authentication (auth param on route) is plugggable by defining now
_auth_method_<methodname>
- Error handler are overridable, any module can define a new exception and
handle it by orverriding the _handle_<error_code> method.
- Add model converters for routes, to directly get the browse record example
@route(['/job/detail/<model("hr.job"):job>'], type='http', auth="user")
This is done by splitting dispatching, when the db is unknown low level http.py
dispatching is used, it's only used by a few controller in base and web. When
the db is known, ir_http is used because it's a regular Model it is fully
overridable by openerp modules.
bzr revid: al@openerp.com-20131110142731-qi9910fkty25cdtd
Split low level dispatching and high level dispatching.
Low level dispatching is used when the db is unknown it's only used by a few
controller in base and web.
High level dispatching is used when the db is known, it is used by most
controllers and it handles authentication and errors. Because it's a regular
osv object all it is fully overridable by openerp modules.
bzr revid: al@openerp.com-20131110014609-io03vspj2q1wtqa0
guessed_db is only computed by the /web controller, so even if the provided db
match the guessed_db we should save it in the http session. Because all rpc
call made before the authentication wont compute the guessed_db, so the
request.db will be wrong for those calls.
bzr revid: al@openerp.com-20131110010411-s7ermjwmfbile1ix
Depending on the way the search view is setup, a single item
(e.g. "Search foo for bar") can follow a list of a bunch of
completions. In that case, it is hard to notice that it's not just one
more item of said list.
Add a marker on the first of every completion list in order to catch
1-item lists (or lists without titles/categories) and prepend a small
border every time, so that single-element completions following
lists-with-titles can be noticed.
bzr revid: xmo@openerp.com-20131107112858-1xyvcesize0doblz
Similarly to the recent fixes in Purchase Analysis,
the Sales Analysis view must not group on the quantity
field. It is one of the columns that must be aggregated,
not used to fold PO lines into the same
result row.
The line count was also incorrect because of this, and
had to be corrected to actually count() the underlying
SO lines.
In addition, the JOINs were done in the wrong order,
which could cause problems (e.g. if an empty SO ever
landed in the database, all the SO line columns
would be empty in the JOIN, and cause errors)
bzr revid: odo@openerp.com-20131105103011-vkix07lsb6q3y9fd
The product quantity is one of the columns that must be
aggregated, not used to fold PO lines into the same
result row.
This, combined with missing aggregation operators
was causing multiple identical PO lines from the
same PO to be merged together and only counted once
in some aggregations.
bzr revid: odo@openerp.com-20131105101930-f2qbcp12luom08je
It is a common need to set a higher decimal precision
for `Product Price` (i.e. the product cost field) for
high volume / low value items. This may typically
require up to 4-6 decimals for e.g. EUR/USD-based
companies where the currency has 2 decimals.
In that case the product cost should be stored with
full precision without applying the currency rounding.
The appropriate currency rounding will be applied
anyway as soon as a transaction actually uses that
product cost (typically in a SO/PO)
bzr revid: odo@openerp.com-20131104173232-84g115x6ykxoc1rh
While processing a picking we must keep track of
previously processed lines as they modify the
stock on hand but are not yet included in the
`qty_available` function.
Negative stock on hand is handled as if
the stock was zero as far as the average
price computation is concerned.
bzr revid: odo@openerp.com-20131104171245-z1lgsplyu4cdz9gc
Without the right precision the default rounding is
applied and causes a possible loss of precision when
the `Product Price` precision is increased.
This can in turn lead to incorrect average price
computations.
bzr revid: odo@openerp.com-20131104170118-ls5q0yridevw0jgt
The starting table for Purchase Analysis is purchase_order_line
not purchase_order. The previous code was using a wrong JOIN
combination starting from purchase_order, which resulted in
a crash if an empty PO was created.
In order to prevent this an extra WHERE clause on product_id
being NOT NULL was added, but this was incorrect too as it
prevented PO lines with no product_id value from appearing
in the Purchase Analysis results, while being perfectly valid.
bzr revid: odo@openerp.com-20131104165826-kltuzlh4i8q89sk0