Commit Graph
94675 Commits
Author SHA1 Message Date
Jérome Maes bbba261ec6 [FIX] im_livechat : remove async attribute for internal livechat lib
The internal livechat loader should not be loading in a asynchronous way, since it depends on the other assets bundle included in a odoo website page. Sometime (depending on the browser cache), this triggered a 'TypeError' when executing 'new openerp.im_livechat.LiveSupport', since 'openerp' was 'undefined'. This was introduced with b03b7280b3.
2015-04-15 17:12:44 +02:00
Jérome Maes f8be7105e3 [FIX] im_livechat : starting a conversation can be done by an identified user (ie: a portal user).
The bus channel will still be public (using the uuid), but access to the message history and session information should be with the authenticated user and not the anonymous one. There is no anonymous name, and the request.session is used to identify the user.
2015-04-15 17:04:53 +02:00
Jérome Maes e10820f354 [FIX] im_chat : add security access rules for portal user. This allow portal to chat in the frontend with the livechat. Otherwise, they never see any messages sent or received. 2015-04-15 17:03:49 +02:00
Jeremy Kersten fe4df440a0 [FIX] base: disable cache in dev mode for read_template
Without it, the xml template are not refreshed when file is changed.

A better way will be to invalide cache when XML file is modified.
Same way that we restart the server when a python file is updated.
2015-04-15 16:32:16 +02:00
Julien De Coster 32389f0073 [FIX] UTM security 2015-04-14 15:30:06 +02:00
Christophe Simonis 0e2a453fe2 [MERGE] forward port of branch 8.0 up to ba54a66 2015-04-14 12:22:33 +02:00
Christophe Simonis ba54a668d4 [MERGE] forward port of branch saas-3 up to 2ffbb5f 2015-04-14 12:12:39 +02:00
Martin Trigaux a82da88c3d [IMP] account: help to configure fiscal year
Fiscal year is created when a chart of account is installed on the company.
If no chart of account is installed, setting dates will have no effect in the
accounting configuration wizard.
Fixes #3547
2015-04-14 11:50:31 +02:00
Christophe Simonis 2ffbb5f93d [MERGE] forward port of branch 7.0 up to d246e36 2015-04-14 11:40:23 +02:00
Christophe Simonis 32cede1563 [FIX] mail: ignore bounce mails.
Note: bounces from marketing campaigns are already processed
2015-04-14 11:37:43 +02:00
Nicolas Martinelli 5a8fcd5c01 [FIX] point_of_sale: use session start date instead of system date when closing session
When the session is closed, the date used is the date of the session start instead of the
system date. This is necessary when the server is not on the same timezone than the user,

opw: 631497
2015-04-14 11:26:15 +02:00
Julien Laloux 5e97d25e9b [ADD] CLA for jlaloux 2015-04-14 10:59:05 +02:00
Torvald B. Bringsvor 4a11cce93d [ADD] CLA for Bringsvor Consulting AS. 2015-04-14 10:44:13 +02:00
Jeremy Kersten 1e810a5493 [IMP] base: auto redirect if // in url
Redirect odoo.com/page//contactus ==> odoo.com/page/contactus

(only for get method)

Apache don't redirect but search for route with only one slash...
For SEO optimization, Odoo force a redirect permanently
2015-04-14 10:10:16 +02:00
Nicolas Martinelli b438522c42 [FIX] account: exchange rate uses invoice date instead of server date
When an invoice is created, the exchange rate used takes into account the invoice date instead
of the server date.

opw: 631749
2015-04-13 19:25:59 +02:00
Nicolas Martinelli d246e36c82 Revert commit "[FIX] sale_margin: purchase price calculated using the currency of the price type"
Reasons:
- the currency conversion is done assuming that the cost price currency is the company currency
- we support only one price type per field. Defining several price types on the same field using
  different price types is not supported.
2015-04-13 19:09:20 +02:00
Nicolas Lempereur 00099db4f3 [FIX] css: move ie9 targetted rules to ie.css
Moving existing rules targetting IE9 or less to addons/web/static/src/css/ie.css
2015-04-13 18:24:10 +02:00
Nicolas Lempereur 8a285e6a62 [FIX] css: ie9 specific fixes
Create a new stylesheet for IE9 and less custom css.

The issue #6198 and #6201 is present in IE9 since a div with height 100% inside
a table-cell (i.e: td tag) element only take the minimum height possible for the
content.

For issue #6198: in IE9 a kanban tile could not be moved to an empty kanban,
this fix sets a minimum height for a empty column (80px, the size of two empty
tiles) so now a tile can be moved in the 80px in the top of the column.

For issue #6201: graphs took the minimum height in IE9, this fix set a fixed
height to improve the situation.

For issue #6200: in IE9, the list view could wrongly not go the next line
even if its width is 100%. For the given case, the display CSS property of
these listview is set to value "block".

opw-632415 opw-632417 opw-632416
2015-04-13 18:23:58 +02:00
Denis Ledoux 23ffff7a6f [FIX] product: recursive category name search
Before this rev.,
if you had two child categories with the same name, e.g.:

- Chocolates / Orange
- Fruits / Orange

In the product list, searching for category "Fruits / Orange"
also returned the products from category "Chocolates / Orange",
because it fetched all products which had "Orange" in the category.

This rev. corrects this (in the above example, it returns
only products from category "Fruits / Orange".

The code is particularly complex. A proper solution would be
to store the complete name field (but this cannot be done in
stable releases, such as 8.0).

Besides, it handles the fact a product category child can have
' / ' directly in its name (it's not only the category tree separator).
e.g., you could have a category name called 'Fruits / Orange' directly
not only in the complete name.

opw-628793
2015-04-13 17:30:16 +02:00
Goffin Simon eb0a309522 [FIX] account: lang used for invoice taxes
The lang used for invoice taxes must be the lang of the partner.

opw:631461
2015-04-13 17:12:45 +02:00
Goffin Simon cb86fefc3a [FIX] point_of_sale: Bad tax code
The tax code used for a return product must be the refund tax code.
Tax/Base Amount amount must be positive.

opw:631303
2015-04-13 17:09:58 +02:00
Christophe Simonis d1031c34ac [FIX] ormcache: correct stat counter usage. 2015-04-13 13:17:23 +02:00
Denis Ledoux cad5dffdfa [FIX] point_of_sale: Taxes in sales lines report
product_taxes_rel is the many2many table between
product.template and account.tax

product_id on the POS order line is a product.product.

Therefore, the join on product_taxes_rel should
be done using the product.template id of
the product on the pos order line, and
not directly the product.product id.

opw-632720
2015-04-13 13:00:52 +02:00
Christophe Simonis 3206a35aed [MERGE] forward port of branch 8.0 up to 8ac8281 2015-04-13 12:07:58 +02:00
Christophe Combelles 737728a7a0 [FIX] base: import po file with comments only
Do not crash when importing a po file with only comments lines (e.g.
autogenerated files)
Fixes #4887
2015-04-13 11:38:42 +02:00
Goffin Simon a41d8ef937 [FIX] account_voucher: VAT warning
VAT error shouldn't be displayed as it doesn't look deep enough for information.
It is better to raise this kind of exception at the creation of a VAT than at its use.

opw:631769
2015-04-13 11:11:18 +02:00
Christophe Simonis 8ac8281a7f [MERGE] forward port of branch saas-3 up to d3e7a8e 2015-04-10 18:35:34 +02:00
Christophe Simonis d3e7a8ef5e [MERGE] forward port of branch 7.0 up to 856bc6f 2015-04-10 18:24:46 +02:00
Raphael Collet 6d239190ba [IMP] ir_values: ormcache method get_actions
On the Customer list, the request on `fields_view_get` takes 12 queries instead
of 62.  Overall, it saves queries on every call to `fields_view_get`.

The cache is invalidated upon any creation/modification/deletion on models
'ir.values', 'ir.actions' and 'res.groups'.
2015-04-10 18:23:32 +02:00
Xavier Morel 20b6003dce [IMP] safe_eval: speed up evaluation
* creating the huge builtins dict inline represents ~40% of safe_eval's
  total cost according to line_profiler
* for the specific situation of opcodes, using a set difference is
  apparently much faster than for+if. all(gencomp) is also faster than
  for+if but not as much as letting Python do (almost) all of it

  might be that returning a set from _get_opcodes would be even faster,
  but didn't test it
2015-04-10 18:23:32 +02:00
Raphael Collet 60ad1fec4d [IMP] fields_view_get: make it issue less queries in tree views
When method `fields_view_get` retrieves the toolbar actions, let it `browse`
the actions to check instead of `read`ing them.  This enables prefetching and
reuse of cached values.

On the list of Customers, `fields_view_get` takes 62 queries instead of 73.
2015-04-10 18:23:32 +02:00
Olivier Dony 1ffa4d26d5 [FIX] forum: restore superuser bypass in per-post karma check
During conversion to new API[1] the superuser bypass
was dropped in the computation of karma-based
permissions on forum posts.
The check still needs to be bypassed to avoid
blocking sudo() mode when the admin account
has a low karma.
sudo() mode is used for various actions done
by the system on behalf of the forum users,
and should not fail because the admin has less
karma than the user herself.

[1] See rev. 893d7fa864
2015-04-10 18:23:32 +02:00
Xavier Morel aa25670c69 [FIX] forum: optimize vote metadata queries
Saves 2 requests per post, aka 20 requests on a full page (89 -> 68):

* don't create a new sudoed env and recordset for each post, create a
  single one so prefetch can work
* don't do unnecessary sudoed access (.parent_id.create_uid without
  reading any field)
* temp variables in template seems to save a few queries, not sure why

There's still a linear growth of requests wrt posts in the
page (single-post page has 56 queries), but it's a bit less terrible.
2015-04-10 18:23:32 +02:00
Arthur Maniet bc33b8dd04 [IMP] account_bank_statement_import: ask for confirmation before creating a journal
In previous versions the system would simply refuse to import
a bank statement if the corresponding journal/account did
not exist.
As of 9.0 the system can create them automatically, but
should not do that without asking for confirmation first,
to avoid user mistakes with dangerous consequences.

Closes #6023
2015-04-10 18:23:32 +02:00
Xavier Morel 8c65573885 [IMP] res.lang: ormcache the lookup of a lang based on a lang code
_lang_data_get returns only numerical data, the website tends to need
date formatting stuff instead with one lang lookup for each date or
datetime formatting (via t-field).

Caching the id matching a lang code means one less query for each
date/datetime formatting on the website, that's 10 queries saved for the
default forum front page.
2015-04-10 18:23:32 +02:00
Jeremy Kersten 7fecbc91eb [IMP] website_crm_score: optimize computation of static rules
Added new field `event_based` for marking dynamic rules that need
to be re-evaluated even for leads that were checked previously
and did not match.  (default: False)

If this field is not set to true, check only newer leads that
were never checked before, significantly speeding up the
check when there are hundreds of thousands of leads.

Closes #6019
2015-04-10 18:23:32 +02:00
Olivier Dony fd73263c51 [FIX] tests: clear ormcache at teardown, to avoid side-effects between tests 2015-04-10 18:23:32 +02:00
Xavier Morel aa6224117f [IMP] ir.config.parameter: cache ir.config_parameter values
Reduces the number of SQL queries needed to render a typical page.

Considering the low number of config parameters, we could probably cache
all the parameters for a user the first time one is requested (and not
in cache), really.

On the contact form with (almost) all website_* modules installed,
brings the number of queries from 21 back to the original 15 once caches
are warm.
2015-04-10 18:23:31 +02:00
Xavier Morel 64a72d3780 [FIX] ir.http: avoid re-authing when not needed
The extra auth blows an environment and causes an extra query
of ``website`` before calling the controller.

The preceding two SQL queries likely can't be avoided: one uses uid1 to fetch
the current website's public user in order to set it, the other one
fetches the current website using the user set beforehand
2015-04-10 18:23:31 +02:00
Xavier Morel 298ef06b98 [IMP] website: use env.ref to ensure main_menu is fetched w/ correct environment
By using get_object and not passing in the request's context, creates a
divergent environment from the one used in the rest of the request,
resulting to the cached menu items not being reused when displaying the
menu in the page (during qweb rendering), saves ~4 requests on the index
page (though probably nothing elsewhere)
2015-04-10 18:23:31 +02:00
Jeremy Kersten b03b7280b3 [IMP] base: allow to load bundle js in async mode
+ Import live support and editor en async

m
2015-04-10 18:04:37 +02:00
Jeremy Kersten 1971b987ad [FIX] website_forum: fix template to support html minifier 2015-04-10 18:02:54 +02:00
Jeremy Kersten 99ab640499 [FIX] website: no left strip at minimize html
<b>2</b><p> comments</p>  ==> need to keep the space
2015-04-10 18:02:54 +02:00
Frédéric van der Essen 9fe4457c43 [FIX] point_of_sale: fixing various issues with the list selection and password popup 2015-04-10 17:53:53 +02:00
Frédéric van der Essen 9041d6e0ff [FIX] point_of_sale: make sure user security PIN only contains digits 2015-04-10 17:53:52 +02:00
Frédéric van der Essen 3b33e5c36a [FIX] point_of_sale: there is no need to restrict customer barcode to ean13 anymore 2015-04-10 17:53:52 +02:00
Denis Ledoux 54eff11470 [FIX] event: send event mails for registration without date_open
date_open is not a required field of event.registration.
There is therefore very likely that this field could
not be defined. We should therefore not rely on the fact
it is always defined.

When trying to sent an event mail for an event registration
with a date_open not set (false), the email wasn't sent,
and it prevented the rest of the event mail queue to be
sent as well.

opw-632549
2015-04-10 17:31:47 +02:00
Olivier Dony 856bc6f2b1 [FIX] apply same visibility rules as base 2015-04-10 17:15:50 +02:00
Olivier Dony 8d750ecdc8 [FIX] apply same visibility rules as base 2015-04-10 17:14:59 +02:00
Somesh Khare 39010d3856 [FIX] account: wrong amount for tax included
Backport of 8.0 code, rev f61339b
Create a new journal item with an tax included, the automatically created tax
line had the amount computed as tax excluded.
Fixes #3731, opw 618305
2015-04-10 12:17:52 +02:00