Commit Graph
3175 Commits
Author SHA1 Message Date
Christophe Simonis f6ea6ce951 [MERGE] forward port branch 11.0 up to c576800813 2018-10-09 13:55:53 +02:00
TWA 983c7e8152 [IMP] mail,crm,...: Replace occurences of name_get()[0][1] by display_name
Purpose
=======

display_name is equal to doing name_get()[0][1]

Replacing name_get()[0][1] by display_name could be good for 2 things:
- Uniformization of the code
- Probable optimization if name_get is used inside a for loop on a recordset (as the values will be prefetched and put in the cache).

TaskID: 1849250

closes odoo/odoo#26341
2018-10-09 11:28:00 +00:00
Christophe Simonis a799b13292 [REL] bump alpha version 2018-10-09 11:40:02 +02:00
Christophe Simonis 835b77ba94 [MERGE] forward port branch 12.0 up to ebe43bad9e 2018-10-09 11:37:30 +02:00
Odoo Translation Bot 44069cc4bd [I18N] Update translation terms from Transifex 2018-10-14 03:21:07 +02:00
Romain Derie a3210dc314 [FIX] base: fix asset generation when there is .less files
Since commit f7130556bb the compiled assets would be returned in a loop
before executing the rest of the `preprocess_css` method.
But every loop would override the previous one as it is `=` and not `+=`.

Fixes #27922

closes odoo/odoo#29109
2018-11-28 16:17:43 +00:00
Rémi Rahir 879a719478 [IMP] base: update phone codes on res.countries
closes odoo/odoo#28580
2018-11-27 13:03:58 +00:00
Goffin Simon b27c5e0c36 [FIX] base: Wrong view displayed
Steps to reproduce the bug:

- Go to Contact app
- click on Configuration > Bank accounts
- Create a new one

Bug:

It was impossible because the field partner_id was hidden.
The form view view_company_partner_bank_form was displayed instead
of view_partner_bank_form.

opw:1908114

closes odoo/odoo#28916
2018-11-26 12:25:11 +00:00
Odoo Translation Bot 07f6b8ef57 [I18N] Update translation terms from Transifex 2018-11-25 01:26:32 +01:00
Raphael Collet c96d4cdbad [FIX] base: ormcache invalidation in ir.config.parameter
Writing on a parameter invalidates the ormcache and propagates the invalidation
to other workers.  Setting a parameter to its current value should not trigger
ormcache invalidations.
2018-11-23 14:02:17 +00:00
Raphael Collet e181f592f3 [FIX] odoo: ormcache invalidation on loading registry
Do not propagate cache invalidations to other workers when simply loading the
registry.  Only do it when installing/upgrading/uninstalling modules.
2018-11-22 11:05:30 +00:00
Raphael Collet ad065093eb [FIX] models: ormcache invalidation on import
Do not propagate cache invalidations to other workers when changes must be
discarded, because of an import error or a dry run, which are both handled as
successful transactions.
2018-11-22 11:03:51 +00:00
Christophe Simonis 0ef5cedebb [MERGE] forward port branch saas-14 up to 637e4c68fc 2018-10-08 17:29:03 +02:00
Christophe Simonis 1b5f14713b [MERGE] forward port branch saas-15 up to 0ef5cedebb 2018-10-08 18:59:03 +02:00
Christophe Simonis 0efe62d63d [MERGE] forward port branch 10.0 up to 085d504561 2018-10-08 14:51:52 +02:00
Duc Dao 085d504561 [FIX] base: use correct field for Vietnamese
There is no name field but a state_name one
Closes #27512
2018-10-08 12:13:32 +02:00
Manuel Vázquez Acosta c77f7fc5cd [FIX] models: Allow rich comparison with third party objects.
Instead of returning False directly when comparing a non-model, return
NotImplemented that will trigger the __eq__ test from the other side.

This allows third party objects (for instance a serialization/deserialization
scheme) that cannot be a Model to be considered equal is some scenarios.

closes odoo/odoo#19977
2018-10-11 16:59:49 +00:00
Martin Trigaux 57884ccdc8 [I18N] all: convert remaining model: translation entries
It should be model_terms:

Fixes odoo/docker#219

closes odoo/odoo#27664
2018-10-11 09:49:01 +00:00
Martin Trigaux 51d9589e02 [FIX] base: print report without template
In case a report has no template defined, the fallback is on the first
body_parent that matched the xpath '//main'
xpath method returns a list

Fixes #27406

closes odoo/odoo#27630
2018-10-10 13:59:02 +00:00
Martin Trigaux 0aa0cec97a [FIX] web: do not warn on empty field
If no value is specified on the datefield, do not set a warnfuture message

Remove code comment that was referring the condition present at b51b0d66c2
but no longer present.

Add tests

Fixes #27551

closes odoo/odoo#27593
2018-10-10 13:59:36 +00:00
Nicolas Lempereur 5c6edfc8d3 [FIX] base: res_config_settings allow deferred field
If a deferred field, for example with auth_user_policy installed:

  <field name="f" password="True" widget="password_meter"/>

is inside the res_config_settings view, the rendering will be deferred
which is not taken into account when initializing the content
(_initModules) or attaching to DOM (after start).

Thus we would would get an error and have no access to settings.

The issue that happened in 12.0 was solved with 23bec7fb7 and refactored
in between in 5bbbd25ed, but the heart of the issue was not solved in
the case of a customization.

With this commit, we do not lose the deferred when it is necessary to
keep them in the case of deferred while rendering.

Without fix, the added test fails with a traceback and message:

 TypeError: Cannot read property 'settingView' of undefined

opw-1890343
closes #27589
2018-10-10 15:02:10 +00:00
qsm-odoo 3daab8ac16 [FIX] web_editor, *: allow cropping all theme images
* base, website

An image URL may be like "/web/image/<xml_id>" where <xml_id> is the
xml id of an ir.attachment. In fact, the route does not use the xml_id
but the 'key' field, which is normally equal to the xml_id for standard
attachment. In the context of themes + multi-website, the value used as
an xml_id may refer to a theme.ir.attachment instead of an ir.attachment
and this led to a bug as those must not be used the same way.

The crop route which gets image information is adapted by this commit to
always look for the *current website* *ir.attachment* related to the
given xml_id/key.

Thanks to @kig-odoo for spotting the issue.
Closes https://github.com/odoo/odoo/pull/27588

closes odoo/odoo#27611
2018-10-10 09:47:45 +00:00
XavierDo 70e604a8fa [FIX] core: correctly read test_tags in config file
The test_tags is stored as None by default in the config file,
but 'None' is interpreted as a string when read.

This is a dirty fix in order to avoid to launch tests when using
a config file, we should do something cleaner in master and refactor
part of this code (substitute 'None' in the load method as it is
done for boolean)

closes #27498

closes odoo/odoo#27564
2018-10-09 09:19:30 +00:00
mreficent dddd4072de [FIX] v12 urls
Was still pointing to old links

closes odoo/odoo#27443
2018-10-09 13:44:38 +00:00
Nicolas Lempereur f3bd4e425f [FIX] models.py: modified field with uppercase
In 7f29b31cf the modifed has been improved but there was a typo if a
column contained an uppercase letter (which happen easily with random
field name in Odoo Studio).

opw-1890248
closes #27546
2018-10-09 13:14:47 +00:00
Nicolas Lempereur 56fe8ee9ee [FIX] base: access_token test pass for python2
In 46f2e1918 that replaced traceback when accessing an attachment with
access token with 403 or 404 errors, the added test would fail if run in
python2.

fix for https://github.com/odoo/odoo/commit/46f2e191#commitcomment-30796449
closes #27514
2018-10-08 09:09:58 +00:00
Jairo Llopis a362d0eb9f [FIX] tests: Make at_install and post_install backwards compatible
Fixes #27471 by just using `tagged()` behind the scenes.

calls to `tagged` were done in the wrong order

closes odoo/odoo#27531
2018-10-08 12:16:08 +00:00
Odoo Translation Bot e06a277c02 [I18N] Update translation terms from Transifex 2018-10-07 07:02:30 +02:00
Odoo Translation Bot fd228ccda4 [I18N] Update translation terms from Transifex 2018-10-07 00:29:41 +02:00
Martin Trigaux 961d68f1c5 [I18N] export 12.0 source terms
Including demo data

closes odoo/odoo#27504
2018-10-08 07:13:33 +00:00
Odoo Translation Bot b6c8919444 [I18N] Update translation terms from Transifex 2018-10-07 02:27:57 +02:00
Christophe Simonis 1868713dbd [REL] 12.0 2018-10-03 19:56:18 +02:00
ThanhDodeurOdoo 8ea5637c1d [FIX] base: ir_http access mode
Before the fix, routes using binary_content with access_mode
and access_token didn't work properly since access_token
was compared to the object's access token in all cases.

This commit:

 -prevents the object's access_token check if
access_mode is truthy (since access_mode does its own access_token
check).

 -changes check_access_mode so it now returns a boolean instead of
 a record and is now private.

Closes #27401
2018-10-03 18:10:07 +02:00
Pedro M. Baeza 1ad4d42f0b [ADD] *: replace hardcoded data URIs with helper
- Add a method for generating an image data URI, and expose it in QWeb context

- Fix reports, website templates or mail templates with data hardcoded
  data URIs, to use the helper (Python cases), or the existing
  kanban_image helper (for JS cases)

This will gracefully handle SVG support in addition to classical image
formats.

Closes #26635
2018-10-03 17:48:14 +02:00
Pedro M. Baeza 1be50fdeaf [ADD] *: support SVG images
Introduce official support for SVG files in the framework, including the
following parts:

1. When client-side SVG images are uploaded, the content is displayed until
you save using data URI scheme according RFC 2397 [1]. This scheme requires
to specify content format. Using hardcoded "image/png" works for all images
types except SVG.
Type-sniffing is done using "magic byte" detection via the first base64
encode byte, so that the proper data URI scheme can be used.
This should not cause SVG-related security problems as the file is
displayed through `<img>` tag, which does not allow SVG scripting [2].

2. Make /web/image controller compatible with SVG

3. Add support for SVG files for company logo, which uses a dedicated
controller.

4. Resizing of SVG files is a no-op, as it makes little sense for a
vector-based format. We also want to avoid micro-alterations to the SVG
document (in "natural" viewport parameters) as we would store multiple
copies of the files in the filestore.

5. Because SVG files are inherently dangerous, upload of SVG files is
restricted to administrators, either by blocking it directly before
saving it in the database (binary fields with attachment=False), or by
neutering them to text/plain mimetype (for binary fields with
attachment=True)

6. Add tests for the SVG upload cases and for the non-admin uploads.

[1] https://tools.ietf.org/html/rfc2397
[2] https://www.w3.org/wiki/SVG_Security

Closes #26635
2018-10-03 17:48:01 +02:00
qsm-odoo d9a589ad7a [FIX] base, website: review https://github.com/odoo/odoo/commit/89678c60412feea004cd3081200092365e6ef3b4
Share the common code in the ir.attachment model and add a sort order
and a limit to attachment serving.
2018-10-02 15:17:09 +02:00
Odoo Translation Bot 47369090db [I18N] Update translation terms from Transifex 2018-10-07 04:11:56 +02:00
Odoo Translation Bot 6bb4b305f0 [I18N] Update translation terms from Transifex 2018-10-03 14:27:50 +02:00
Martin Trigaux d77000aef3 [I18N] export saas-11.5 source terms
Reflect module moved to enterprise and remove fields after c9837ac5d
2018-10-02 13:15:40 +02:00
Yannick Tivisse b2b9545cf3 [IMP] ir_ui_view: Log warning on incorrect 'groups' attribute
Purpose
=======

They are a lot of places where we set an attribute 'groups' on a view element and:

- The group doesn't exist anymore
- The group xmlid is not correct
- The group xmlid exists but the modularity is not respected (example: group_stock_user
  used in a view in the 'product' module).

Where it happens, nothing warns the user or the developer. The element is just never
rendered.

Specification
=============

In the method _check_xml, log a warning if a 'groups' attribute is set and if
a group doesn't not exist at that moment.
2018-10-02 12:35:34 +02:00
Martin Trigaux c9837ac5dc [FIX] base: compare on original module
Introduced at 574f4c3d
model._module has for value of the last module extending the model.
This means that, when a module B inherit from a model defined in a module A (e.g
to add a field on the model), an external id, tagged with module B, will be
created for each field of the model, including the one defined only in A.

The intention of the patch at 574f4c3d was to include the automatic fields (i.e.
LOG_ACCESS_COLUMNS) into the condition.
Without that condition, the fields such as create_date were deleted when
upgrading a module (not defined in any module)
2018-10-02 11:51:15 +02:00
Martin Trigaux 718b0f8b63 [FIX] models: display first external id onyl
In case the result matches two records (e.g. a model has one external id per
module inheriting it), the last was used.

Use the first only.

Fixes #27363
2018-10-02 11:20:01 +02:00
Olivier Dony 9bae56acd4 [IMP] http: reinstate session rotation after login
Session rotation was introduced a long time ago, but deactivated at
login due to obscure side-effects related to #6949 (aka the "BBQ" PR).
This commit reinstates the rotation, which is better from a security
standpoint.

In order to also prevent session ID reuse, we force the renewal of
deleted sessions, at the SessionStore level (via `renew_missing`).
2018-10-02 01:00:37 +02:00
qsm-odoo 89678c6041 [FIX] base, website: make attachment serving multi-website
- Reaching an attachment datas thanks to its URL was not multi-website
- Compiling assets with URLs to attachment datas was not multi-website
2018-10-01 21:33:32 +02:00
Antony Lesuisse 62644f93fe [IMP] base: onboarding prefill email in company data 2018-10-01 16:38:00 +02:00
Christophe Simonis 43b63a0465 [MERGE] forward port branch saas-11.4 up to 57e387b645 2018-10-01 16:01:54 +02:00
Christophe Simonis 998723b909 [MERGE] forward port branch saas-11.3 up to e980af9df0 2018-10-01 11:27:51 +02:00
Christophe Simonis e980af9df0 [MERGE] forward port branch 11.0 up to a9a556178d 2018-10-01 10:44:38 +02:00
Odoo Translation Bot 62ab7eb88b [I18N] Update translation terms from Transifex 2018-09-30 07:02:39 +02:00
Odoo Translation Bot a01c1bf5bf [I18N] Update translation terms from Transifex 2018-09-30 02:25:45 +02:00