Commit Graph
3175 Commits
Author SHA1 Message Date
Martin Trigaux 044b8b1240 [I18N] export saas-16 source terms 2017-07-25 12:26:50 +02:00
Odoo Translation Bot 621e392b52 [I18N] Update translation terms from Transifex 2017-07-25 12:14:02 +02:00
Richard Mathot 35601dfe6f [REM] tools: old and unused lib pdf_utils 2017-07-24 16:54:42 +02:00
Martin Trigaux 09c6d9f7ce [I18N] Update translation terms from Transifex 2017-07-24 15:45:48 +02:00
Christophe Simonis f00aa596a3 [REL] back to v11 alpha 2017-07-24 13:06:32 +02:00
Laurent Smet b446930dc4 [IMP] base/report, web/report: remove pdf merge with single call to wkhtmltopdf
The old behavior was to call wkhtmltopdf for each report and to put all of them together
using the merge_pdf method. It was a very slow approach because all report needs
5 temporary files, one subprocess and then, a merge.

The new behavior is to perform a single call to wkhtmltopdf by putting all the footers/headers
html together and so, avoid call to merge_pdf to greatly improve the performances of the reporting.
2017-07-20 14:48:43 +02:00
Christophe Simonis 9185eb4b79 [MERGE] forward port branch saas-17 up to f830f14d98 2017-07-20 13:26:09 +02:00
Christophe Simonis fa3e89064a [MERGE] forward port branch saas-16 up to 104dfe3c07 2017-07-20 11:48:49 +02:00
Christophe Simonis b857fd4c90 [MERGE] forward port branch 10.0 up to 11270336fa 2017-07-19 16:21:12 +02:00
Raphael Collet 5b054ffbf2 [IMP] model: optimize setup_models (#18300)
When setting up models, retrieve all manual fields in a single and specific
query.  This makes the method `_add_manual_fields` 20 times faster.
2017-07-19 15:50:03 +02:00
Xavier Morel b656eda22d [FIX] ir_qweb: decoding of attachment assets
For uploaded modules (e.g. saas), uploaded assets are stored in
attachments.

When the asset content is retrieved, static "filesystem" files are
assumed to be UTF8 and properly decoded, but attachment data is not
and is thus interpreted as ASCII further down the line, leading to a
UnicodeDecodeError (and a broken page/template/...) if the asset data
is not actually ASCII (e.g. if it's UTF-8).

Fix by treating attachment assets as UTF8 encoded, same as filesystem
assets.

OPW-752858
2017-07-19 15:41:37 +02:00
Raphael Collet 74acfc2054 Revert "[IMP] base: optimize method _add_manual_fields by making less queries"
This reverts commit 8b5257b1e5.
2017-07-18 14:49:38 +02:00
Xavier Morel e26a212304 [FIX] P3: reorder finders in meta_path
So that was a fun one: mock.patch calls would regularly fail refusing
to find the addon in odoo.addon (e.g. essentially getattr(odoo.addon,
'account_budget' deep within the bowels of mock).

Turns out the answer is that our import hooks would not be used for
many imports: while in Python 2, sys.meta_path is empty and the
default finders are run after all meta_path finders fail as noted by
the documentation[0].

However when the import system was rewritten in Python 3.3[1]
meta_path was "despecialised" and the default finders were moved to
meta_path rather than be a hidden part of the import machinery[2]:

> sys.meta_path and sys.path_hooks now store all of the meta path
> finders and path entry hooks used by import. Previously the finders
> were implicit and hidden within the C code of import instead of
> being directly exposed.

The result of this change is that ``sys.meta_path.append`` means the
default finders should take priority and the custom ones should be
fallback. This is the exact opposite of what we want.

Fix issue by ``sys.meta_path.insert``-ing our finders at the start of
the path rather than appending them at the end. This should change
nothing in Python 2 but seems to fix the issue in P3.

[0]
https://docs.python.org/2/library/sys.html?highlight=meta_path#sys.meta_path
[1] https://docs.python.org/3/whatsnew/3.3.html#importlib
[2] https://docs.python.org/3/whatsnew/3.3.html#visible-changes
2017-07-18 11:49:28 +02:00
Xavier Morel 3cad551a88 [FIX] P3: stupid use of hasattr
In Python 2, hasattr swallows *any* exception raised during the
access. In Python 3, it only swallows AttributeError.

Accessing an attribute on an unbound threadlocal proxy raises
RuntimeError, while running test_ir_http_mimetype ``request`` is
unbound, in Python 2 ``hasattr`` would return ``False`` on an unbound
threadlocal, in Python 3 it lets ``RuntimeError`` pass through blowing
up the test.

Fix this by just checking if the threadlocal is bound by using it as a
boolean…
2017-07-18 11:49:28 +02:00
Xavier Morel 9bd793e1b5 [FIX] P3: / has become 'real division' in all cases 2017-07-18 11:49:28 +02:00
Xavier Morel 17fe075cda [FIX] P3: absolute ordering removed 2017-07-18 11:49:28 +02:00
Xavier Morel ace4ee39e8 [FIX] P3: round() compatibility shim
In Python 3 round:

* rounds half to even (banker's rounding) rather than up
* returns an int if not given a precision (or given a precision of
  None)
* discards the negative sign when rounding to 0

Add a compatibility shim which implements P2 behaviour and at least
allows passing float_utils's tests.

Implementing float_round on top of Decimal was attempted but did not
work: although Decimal.quantize takes a non-integral
Decimal (e.g. ``d.quantize(D('0.001'))``) it only supports integral
powers of 10 and does not support quantizing to e.g. 0.05: while that
will not fail it will just use the exponent for quantization and 0.05
is thus equivalent to 0.01, which is not what we want if e.g. need to
round a value to 5 cents.

This is hinted at but maybe not clearly spelled out by the official
documentation:

> Return a value equal to the first operand after rounding
> and **having the exponent of** the second operand.

Also convert a bunch of hand-rolled currency rounding to just using
the round() method on res.currency.
2017-07-18 11:49:28 +02:00
Thibault Delavallée 62de570395 [IMP] base, website: correctly use inheritance when creating qweb rendering context
Base render method now calls a prepare_qcontext method used to prepare
the qweb context used for the rendering. Website override of ir_ui_view
now simply inherits this method to add its own set of values instead of
doing strange things with the base render override.

Qweb context should be the same after this commit, i.e. containing a lot
of duplicated things like a copy of the context. The only change is that
user_id and res_company are now directly supported in base rendering
instead of only in website version of rendering. Future commits will
use those values.
2017-07-17 18:06:37 +02:00
Martin Trigaux f0a03da2b2 [I18N] Update translation terms from Transifex
Not sure why it did not fetched
2017-07-17 13:33:29 +02:00
Dipali Tank 65d0fddc78 [IMP] base: rename Holidays module category to Leaves as this is the App name 2017-07-17 12:19:52 +02:00
Martin Trigaux 6a61921ddd [I18N] Update translation terms from Transifex 2017-07-17 11:52:51 +02:00
Martin Trigaux 47859c393c [I18N] export saas-15 source terms
4 new modules that were not exported
Reword unclear error message
2017-07-17 11:02:33 +02:00
Nicolas Martinelli 779fc8e4fe [FIX] *: raw_value for id
Since the new views, `record.id.value` contains the formatted value of
the ID, meaning it can contain separators. For example, by default,
`1234 => 1,234`. Since this value is used in the image URL, using
`value` won't work anymore.
2017-07-17 09:48:24 +02:00
Simon Lejeune 9d9d1f1d1b [REL] 10.saas~17 2017-07-14 17:13:36 +02:00
qdp-odoo 8bea502f33 [REM] *: removal of fax field on res.partner object
Deprecated technologuy that doesn't deserve its dedicated field anymore. RIP faxes
2017-07-12 17:48:43 +02:00
qdp-odoo 9d1df81af5 [IMP] account: onboarding of the invoicing app
-added tour for invoicing
-allow to set easily the number of the first invoice/bill/refund of a journal, from the invoice screen
-small usability fixes and refactoring
2017-07-12 17:48:43 +02:00
qdp-odoo dcf71c0148 [IMP] base: usability improvement of the res.partner form view
Addition of a shorter and cleaner form view, to be used in quick creates
2017-07-12 17:48:43 +02:00
Mehul Patel 50b3b3c8d1 [FIX] web,odoo: Remove remaining workflow related code 2017-07-11 16:27:15 +02:00
Raphael Collet e25bcf41e2 [REF] models: group recomputation triggers to minimize the number of requests
When several fields are modified and trigger the same recomputations, the same
SQL queries were made to determine the records to recompute, because each field
was processed independently.  In order to avoid duplicated SQL queries, process
the triggers of the modified fields altogether.

This reduces the number of queries by 15% to 25%, depending on the number of
computed fields.
2017-07-10 16:18:33 +02:00
Raphael Collet 8b5257b1e5 [IMP] base: optimize method _add_manual_fields by making less queries 2017-07-10 15:03:04 +02:00
Raphael Collet 439fa82676 [IMP] models: improve code of read()
Remove the `ORDER BY` clause from the query.  The values fetched from the
database are stored in the records' cache, and their ordering is irrelevant.
2017-07-10 15:02:44 +02:00
Raphael Collet ffd93a9937 [REF] models: do vacuum of transient models by cron only 2017-07-10 15:02:44 +02:00
Raphael Collet faacacb45f [IMP] registry: check existence of tables with a single SQL query 2017-07-10 12:38:25 +02:00
Vandan Shah b0650464fe [IMP] base: Rename xmlid correclty from report to base
Grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep grep
2017-07-07 16:32:22 +02:00
Ankit Sathvara 0c1941ab15 [IMP] sale,account,pos: Improve label on config to active currencies
PURPOSE
=======

Simplify the way to activate currencies

SPECIFICATION
=============

On res.company :

Currency_id: options={‘no_open’: True}
oe_edit_only on “Activate more currencies”

In the list view of the currencies, replace the checkbox active by a boolean_toogle widger

There is normally a default filter on the currencies list view to only show the active currencies : this filter should be kept except if you arrive on this screen by clicking on "Activate more currencies"  from the res.company and from the settings. Only the menuitem Currencies should only show the active ones
2017-07-07 16:18:23 +02:00
Christophe Simonis bf51fe55a1 [MERGE] forward port branch saas-16 up to 0f2b2c4e2b 2017-07-07 14:30:30 +02:00
Christophe Simonis 0f2b2c4e2b [MERGE] forward port branch saas-15 up to 514a1a76d8 2017-07-07 14:18:07 +02:00
Christophe Simonis 514a1a76d8 [MERGE] forward port branch saas-14 up to 5b28570769 2017-07-07 14:14:55 +02:00
Christophe Simonis 5b28570769 [MERGE] forward port branch 10.0 up to aef7748845 2017-07-07 14:13:07 +02:00
Christophe Simonis aef7748845 [MERGE] forward port branch saas-11 up to 96fa86779b 2017-07-07 14:07:47 +02:00
Martin Geubelle a29f7f671b [FIX] *: explicit color_field attribute for m2m_tags
Since the previous commit, the `color_field` needs to be explicitly stated
in the options for the tags to be colored.

The previous behaviour (always read the field `color`) was leading to server
warnings if the field was not present on the comodel.

Thìs commit set the `color_field´ for every many2many_tags on fields that have
a `color` field on the comodel.
2017-07-07 13:40:50 +02:00
Christophe Monniez c1e154bee1 [FIX] tools: ensure xlsx worksheet names are valid
When xlsx is used, the worksheet name may be longer than 31 chars and
raise an exception.

This fix will troncate the name up to 31 chars and will remove invalid
chars.

Similar patch was already done at 0122c05eff for xlwt

xlsxwriter 0.9.8 has added a parameter worksheet_class=None so adding **kw to be
compatible with installs with the latest version (requirements.txt asks for
version 0.9.3)

Closes #18077
opw-751157
2017-07-07 09:44:09 +02:00
Yannick Tivisse 5e908b0b17 Revert "[IMP] base: Only show uninstalled languages on install wizard"
This reverts commit 1e2e55872f.

In debug mode, there's a checkbox to reload the language and overwrite the existing terms. This previous commit makes that use case impossible.
2017-07-06 14:22:16 +02:00
Yannick Tivisse 89d5fadc20 [IMP] base: Reload the webclient on language install
PURPOSE
=======

When I install a language, I shouldn't have to refresh the page to see the newly installed language.

Example : I install a language, then click on my user (upper right corner) and try to select this language. The newly installed language is not available. I first need to reload my page.
2017-07-06 14:12:49 +02:00
Yannick Tivisse 1e2e55872f [IMP] base: Only show uninstalled languages on install wizard 2017-07-06 14:12:49 +02:00
Christophe Simonis 7dc731db83 [MERGE] forward port branch saas-15 up to 1f16d34aaa 2017-07-06 13:54:22 +02:00
Christophe Simonis 1f16d34aaa [MERGE] forward port branch saas-14 up to 5009752dcf 2017-07-06 13:53:17 +02:00
Christophe Simonis 5009752dcf [MERGE] forward port branch 10.0 up to 1206cc3f7d 2017-07-06 13:05:24 +02:00
Denis Vermylen e0a1549307 [IMP] models: add access_user to get_access_action
In order to be able to identify what action to return based on the
access_user.

Typically portal users will need to be redirected to the front-end,
while internal users will need to be redirected to the back-end.
2017-07-06 12:53:39 +02:00
Christophe Simonis 1206cc3f7d [MERGE] forward port branch saas-11 up to 5f7f3209e0 2017-07-06 12:30:51 +02:00