Commit Graph
99161 Commits
Author SHA1 Message Date
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
Frédéric van der Essen 7d2633f0c9 [FIX] point_of_sale: PosModel extensions were ignored, preventing the floor plan extension from loading 2015-04-13 16:18:09 +02:00
Jay Patel 8a91c9ea6b [IMP] website: relevant data for comparison snippet 2015-04-13 13:39:13 +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
Yannick Tivisse 9c0763c426 [IMP] purchase : onboarding improvements 2015-04-13 11:40:22 +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
Aaron Bohy b4dd0b6f8c [IMP] Web: ControlPanel: properly and securely expose nodesets 2015-04-10 15:34:12 +02:00
Julien De Coster e3d8d95818 [FIX] Website links with new API 2015-04-10 12:37: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
Martin Trigaux d0493ee847 [FIX] sale: recompute tax amount after fiscal position change
When changing the fiscal position of a sale.order, the taxes are recomputed
which means that total amounts may no longer be correct (need to press 'update'
button).
Reset the amount_* fields to force the recomputation at write.
Fixes lp:712772, opw 618419
2015-04-10 11:56:25 +02:00
Jeremy Kersten efbe6ae880 [IMP] website: Split loading of asset to load css before js
"An external CSS files were included after an external JavaScript file in the document head.
To ensure CSS files are downloaded in parallel, always include external CSS before external JavaScript."
-- Chrome analyzer --
2015-04-10 11:43:46 +02:00
Leonardo Pistone 01f1d91006 [FIX] stock: use owner for virtual stock and in/out
Fixes odoo/odoo#5814.

It will also calculate virtual stock when lot/owner/pack is specified, but will
not filter the future stock on lot/pack.
2015-04-10 11:14:30 +02:00
Goffin Simon 0687a5e67d [FIX] website_sale_options: Total in shopping cart
The unit price of each option of a product must be recompute when
the quantity of the product changes.
2015-04-10 11:02:51 +02:00
Goffin Simon 08d69774b0 [FIX] website_sale: Pricelist witn min qty
Each time a product is added in the cart, the qty of this product must be checked to
adjust the price if there is a rule (with min qty) in the partner's pricelist.

opw:630049
2015-04-10 10:57:37 +02:00
Jeremy Kersten 67c40a50fa [FIX] assets : clean typo and useless script 2015-04-10 10:55:58 +02:00
Martin Trigaux d281e7aebd [FIX] stock_account: avoid timezone periode mismatch
The `find` method will get the current accounting periode according to the
user's timezone while time do not. This means that it is possible that users
get a move with a date belongign to a different period that the one returned by
`find`.
Fixing b101808, linked to #4147, courtesy of Graeme Gellatly
2015-04-10 10:12:15 +02:00
Yannick Vaucher aa26c5a81c [FIX] stock: missing context on call of stock.move copy
Closes #4993
2015-04-09 19:09:26 +02:00
Cedric Snauwaert 9d87d15db6 [ADD] new fields.Monetary + updated widgets
Enhance current widget="monetary" client-side feature and
convert it to a first-class type of field, allowing proper
server-side behavior.

- fields: add field.Monetary, similar to fields.Float but
  supporting a `currency_field` attribute instead of the
  decimal_precision attribute.
  `currency_field` indicates the field holding the
  related currency on the same record.
  The symbol of that currency is used when displaying
  the field, and the rounding of the currency is applied
  instead of the usual decimal precision.
- avoids application of a second decimal precision rounding,
  as was the case when the model field was a `fields.float`.
- removes the need for adding explicit boilerplate to each
  view containing a monetary field, i.e.:
    widget="monetary" options="{'currency_field': 'currency_id'}"
- res.currency: add new field decimal_places needed to round
  value at the correct decimal places
- web: cache all currencies, rounding and symbols at
  webclient startup to speedup monetary fields
- new widget monetary for list view + adapt widget monetary
  on form view

Limitations:
- if the currency_field is a related field, the server-side
  application of currency rounding will only work when the
  record already exists, not during creation (to be fixed)
- this field is only supported in the new API
2015-04-09 19:05:44 +02:00
Jay Patel 1ebd67355a [IMP] payment, website_sale: post-payment messages on acquirers 2015-04-09 17:24:16 +02:00
Denis Ledoux 972d966554 [FIX] account: ACLs contracts button in partner form
contracts_count function field
&
journal_item_count function field

used for the "contracts" and "journal items" buttons
in the partner view are computed by the same
method.

But, this is possible that you have access to
one without having access to the other.
e.g., Project users not being salesman nor accountant
must have access to the contract counts,
but not to the journal items.

Besides, these buttons are added to the partner form
by two separated views, applied to analytic accounting group
& accountant group, respectively.

We therefore avoid to compute the journal items count when
not needed, when not loaded in the partner view.
We therefore prevent the access right issue, and provide
a performance improvment at the same time. Yay.

opw-632454
2015-04-09 17:23:42 +02:00
JosDeGraeve 6f35b0b3fa [FIX] point_of_sale: set analytic account on pos invoice
The analytic account is set on entry generated from pos.order but it was not for
the invoices generated from the pos orders.
2015-04-09 16:55:37 +02:00
Martin Trigaux a3c0742b77 [IMP] account: display currency in import invoice wizard
Fixes #3830 (really)
2015-04-09 16:32:31 +02:00
Denis Ledoux 0a9e8898b7 [FIX] l10n_be_invoice_bba: group restricted fields in partner form
This module brands a view adding fields on the partner
form, after the field 'last_reconciliation_date'.

This field is added by the view
account.view_partner_property_form,
not by the view
base.view_partner_form

So, if the user do not have access to the view
account.view_partner_property_form, then
the field last_reconciliation_date wasn't in the view
and the inheriting view could be applied.

This inheritance worked only because
account.view_partner_property_form,
had no group applied, and the sequence
was lower.

opw-632454
2015-04-09 16:12:35 +02:00