Commit Graph
117975 Commits
Author SHA1 Message Date
Jeremy Kersten 3820b56c07 [IMP] website_sale: multi image by default
Remove the option to switch from simple image to multi mode.
If only 1 image, multi image show it without carousel
2018-04-06 11:54:39 +02:00
Jeremy Kersten 704755515a [FIX] website_sale: fix zoom wich was not always computed
In some case, (many JS like runbot with all modules), the onload event was
binded after that the image was loaded. So the JS code that make the zoom
conditionnal was not executed.

Now we apply the function on all images already loaded, or that will is loading

Courtesy of @ged-odoo for help and review
2018-04-06 11:54:39 +02:00
Denis Roussel e5fd52d28c [FIX] purchase: button_approve in a multi recordset fails
Closes #24079
2018-04-06 11:36:04 +02:00
tfo 990b7356b6 [CLA] Wink signs CCLA
Done at #24083
2018-04-06 11:23:13 +02:00
Siddarth Gajjar b90b8f3d5d [IMP] account, hr_expense: add section for attachment preview
An empty div `o_attachment_preview` is added in expense and vendor bills form
views. It will be used as a container to preview the attachment.

The actual behaviour will be implemented in another commit.

Task 40663
2018-04-06 11:18:45 +02:00
Raphael Collet 0eb8518786 [IMP] fields: describe group_operator when given on all field types 2018-04-06 10:57:02 +02:00
Valentin Löfberg 8e567f819d [IMP] project: Place every links on relative position on kanbans cards
Purpose
========

The links on the project kanban cards are not always at the same place : https://drive.google.com/file/d/1aONUYkZerqqD7fSVmgozRScgLKR-QHtA/view

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

I get rid of the flex element to allow the placing of links using width
attribute. Create the .o_project_timesheet_box class to assure that the
timesheet/overview link is always placed in the middle.
I also deleted the needaction_count button to avoid breaking the display.

Task: 1817850
2018-04-06 10:49:31 +02:00
Christophe Simonis 76131b7970 [MERGE] forward port branch 10.0 up to ea42f6c176 2018-04-06 10:35:25 +02:00
Nicolas Martinelli ea42f6c176 [FIX] account: missing decorator 2018-04-06 09:44:47 +02:00
Alexis de Lattre c41f7297d3 [FIX] report: create a new environment
self is a rml_parse instance, not a BaseModel
create new environment to call ORM methods
prevent crash when calling formatLang on a RML report

Closes #24068
2018-04-06 09:27:35 +02:00
Olivier Dony 3f975f9769 [FIX] account_payment: make partner_id required only when draft
When not draft, the partner_id field is readonly and cannot be modified
anyway, but it makes the form invalid, so form buttons cannot be used,
e.g. to access the journal items, etc.
2018-04-06 08:51:54 +02:00
Olivier Dony f5b00c11dd [FIX] account_payment: properly compute destination account without partner
When the `partner_id` is not set (it is not required at the model
level), we can still compute the default destination account based on
the company chart of account configuration.

This is necessary to allow creating "customer" or "supplier" payments without
selecting a specific partner.
2018-04-06 08:44:34 +02:00
Adrian Torres 2875b94e03 [FIX] osv.expression: normalize domains in combine
Before this rev:

* Take 2 domains that contain at least two leaves, and at least one of
them must use the implicit `&` operator

e.g.:
    d1 = [('so_line', 'in', [91]), ('amount', '<=', 0.0)]
    d2 = ['&', ('so_line', 'in', []), ('project_id', '!=', False)]

* Perform osv.expression.OR() between both domains

Expected result:
    d3 = ['|', d1, d2]

Actual result (after normalization):
    d3 = ['&', '|', d1, d2]

This is because, since the `&` is implicit for the first domain, when we
OR it, we give it an explicit `|` operator, so when we pass this domain
through the normalize_domain function, d1 no longer contains an implicit
`&` operator but instead the implicit operator is the one between d1 and
d2, therefore giving us a completely wrong domain.

The `combine` function states that it only accepts normalized domains,
however neither the OR nor AND functions do, this leads to a lot of
developers putting non-normalized domains into these functions, and
there's no error checking or anything that obviously indicates that the
domain is incorrect, so we might as well normalize all domains being
passed since it's already pretty optimized.
2018-04-06 07:45:25 +02:00
Christophe Simonis 91ea17af5f [MERGE] forward port branch 10.0 up to a93a5c6824 2018-04-05 19:40:54 +02:00
Christophe Simonis a93a5c6824 [MERGE] forward port branch 9.0 up to 27162b0e73 2018-04-05 19:35:27 +02:00
Raphael Collet 5f06926093 [FIX] models: in _read_group_raw, do not aggregate grouped fields 2018-04-05 18:44:40 +02:00
Christophe Simonis 82f45063c0 [FIX] account_cash_basis_base_account: use correct inherited view
Oversight of previous oversight of previous forward-port.
2018-04-05 17:45:12 +02:00
Romain Derie 27162b0e73 [FIX] website_blog: optimize crawler prevention
Commit d39856db prevents crawler to crawl and index blog tag URL which could
lead to possibly millions of URLs combinaison.

Still, it would crawl (but not index) second level of tags combinaison.

This commit ensure that crawling is prevented when already one tag on the URL.
2018-04-05 17:40:30 +02:00
Christophe Simonis ef3ad219de [FIX] account_cash_basis_base_account: correct dependency
Module `account_tax_cash_basis` has been merged into `account` in
saas~14.

Oversight of previous forward-port.
2018-04-05 17:21:06 +02:00
Alexandre Kühn 9a9da5763b [FIX] web: no record abandon on discard from default_get/onchange
Before this commit, when some records were created from an `onchange`,
we have the following weird behaviour:

    Suppose that this record has some required fields that are empty.
    When we click on this record, then somewhere else, the record
    disappears from the list.

This is because the records contains invalid fields, and it is wrongfully
assuming that the record to be discarded comes from "Add an item".

A previous commit [1] fixed a bit this issue with `default_get`, but since
it relied on a fragile heuristic, we decide to apply the correct fix with
this commit.

[1] https://github.com/odoo/odoo/commit/b09f0c99be2b13d33986414485556d87da186d65
2018-04-05 17:14:57 +02:00
Romain Derie d39856dbe8 [FIX] website_blog: prevent crawler on multiple blog tags page
Before this commit:
If a blog had multiple tags on the page, the crawler would click on every one
of them one after another until every tags combination got crawled.
With a lot of tags, this could result in million of URLs.

Now, we prevent URLs with more than one tag to be crawled.

Eg: With tags 'A', 'B', C':
/A
/A/B
/A/C
/A/B/C
/A/C/B

/B
/B/A
/B/C
/B/A/C
/B/C/A

/C
/C/A
/C/B
/C/A/B
/C/B/A
2018-04-05 16:55:58 +02:00
Parth Gajjar 1d08e12a94 [FIX] mail: not able to see attachment preview in mobile
Chat window having higher z-index value then attachment preview model and in the
mobile chat windows are covers whole screen so attachment preview is hidden behind
chat window. so increasing preview model's z-index by 1 will fix the issue.

(PR #24065)
2018-04-05 16:40:03 +02:00
Christophe Simonis ff46163bca [MERGE] forward port branch 10.0 up to f4326b4dab 2018-04-05 16:21:23 +02:00
Martin Trigaux 282605a8fc [FIX] website_blog: cut teaser after 150 chars
Space as word separator does not work in some non-latin languages like Japanese.
Cut arbitrarily after 150 chars

Closes #23219
2018-04-05 16:17:29 +02:00
Mathieu Duckerts-Antoine 5144414a3a [IMP] web: graph views can now aggregate many2ones
The read_group method was recently modified to allow more flexibility.
With this commit, we add the possibility of aggregating many2one fields.
These fields can be aggregating by counting the number of distinct IDs,
directly in postgres.

Also, note that we had to modify the mock server to implement the
corresponding functionality.
2018-04-05 15:59:40 +02:00
Dharmraj Jhala b67331fc18 [IMP] web: Allow user to set custom 'create_text' for x2m fields
For x2many relational fields(of type kanban), we shoud be able to set custom label for
'Create / Add' button by adding 'create_text' node option on particual field from xml.

Right now, 'create_text' is only handled for many2many fields, preventing users to set
custom label for one2many fields.

This commit allows users to set Create Button label for both m2m and o2m fields.
2018-04-05 15:15:07 +02:00
Alexandre Kühn fef6d7967f [FIX] mail: various discuss test fixes
This commit fixes two issues with discuss tests (JS):

    1. Improved mocked `message_fetch` rpc

        Some tests were incorrectly mocking the `message_fetch` rpc.

        With this commit, the mock server correctly mock this route,
        so that tests should simply pass the records as data, and the
        mock server correctly handles this rpc.

    2. Patch `_.debounce` and `_.throttle`

        The test "older messages are loaded on scroll" failed with
        Google Chrome right after destroying the widget discuss.
        This is due to a debounced function that called its inner
        function at this moment.

        With this commit, any discuss test patch `_.debounce` and
        `_.throttle` so that the inner functions are executed
        immediately and synchronously.
2018-04-05 14:57:49 +02:00
Florent de Labarre f8ade1c96d [FIX] stock: To avoid singleton error
Execute on a single record is used when calling the function
_update_line_quantity and avoid singleton error

Closes #23860
2018-04-05 14:48:53 +02:00
Andreas Perhab 115b9616c1 [FIX] doc: remove not existent attribute
color is not accepted by rng on gantt views
copy-paste the code would not work

Closes #24055
2018-04-05 14:42:54 +02:00
Christophe Simonis f4326b4dab [MERGE] forward port branch 9.0 up to eaf54656fc 2018-04-05 14:39:37 +02:00
Fabien Meghazi fd4939dc78 [FIX] base: honor registry/cache signaling for multiple threaded servers
Before this patch the registry and cache signaling was only activated
for PreforkServer. In case Odoo was deployed in a multi process/multi
threaded architecture the signaling was not ensured, causing registry
de-synchronisation amongst threaded servers.

This fix will be backported in v10.0 and v11.0 as soon as it has been
battle tested.
2018-04-05 14:22:32 +02:00
Lucas Perais (lpe) e05b2d01d1 [FIX] hr_recruitment: email from in template should be safe
Create a hr.attendant in a stage where a mail template is present.
Fill the email field as: Name Surname <name@surname.com>

Before this commit:
- the created partner's email has been rendered as name@surname.com&gt;
- the email failed to be sended because of this

This was because Jinja rendered that snippet escaping the special characters
Putting a 'pipe' safe in the snippet does the trick

After this commit:
both the partner and the email are created successfuly

OPW 1830739
closes #24059
2018-04-05 13:35:30 +02:00
Xavier Morel 4e784adbf7 [FIX] doc: non-module JS autodocumenters
Also when there is both a docstring and directive-level content put
the docstring first. That seems to match what Sphinx's autodoc does
and looks less odd.

Possible future improvement: a parameter to suppress the docstring?
Possibly a way to reorder the non-docstring content (e.g. members
documentation)?
2018-04-05 12:31:27 +02:00
Xavier Morel 944755dd1d [FIX] doc: non-module JS autodocumenters
Also when there is both a docstring and directive-level content put
the docstring first. That seems to match what Sphinx's autodoc does
and looks less odd.

Possible future improvement: a parameter to suppress the docstring?
Possibly a way to reorder the non-docstring content (e.g. members
documentation)?
2018-04-05 12:28:56 +02:00
stefanorigano c99177bcf5 [IMP] mail: document_viewer, add reset zoom button 2018-04-05 11:12:58 +02:00
stefanorigano 00aabb8895 [IMP] mail: document_viewer, improve design and fixes
- Improve design
- LESS: use mixing and variables when possible, code formatting
- Solve a minor issue causing images to be not perfectly centered
- Improve visual feedbacks (tooltips, cursors, hover states...)
2018-04-05 11:12:26 +02:00
Nicolas Martinelli 9b6ca49b58 [FIX] http: Bokmål language code
- Install Website
- Load the 'Norwegian Bokmål' translation, and choose to translate the
  website
- Logout

When accessing the website, the language displayed is not consistent to
the browser language.
1. `no` shows homepage in `nb_NO` (Firefox only) => expected since
    Bokmål is the main language in Norway
2. `nb` shows homepage in `en_US` => unexpected
3. `nn` shows homepage in `en_US` => expected since 'Norwegian Nynorsk'
   is not a language available (this will be the topic of another PR)

The issues comes from Babel's side, since `nb` is not in the
`LOCALE_ALIASES` while `no` is. We monkey-patch the value to avoid this
while Babel is corrected.

opw-1827258
2018-04-05 11:01:11 +02:00
Yenthe V.G 0fc2ee8c6a [FIX] stock: complete 85499c76d4
Was another one remaining

Closes #24047
2018-04-05 10:50:14 +02:00
xmo-odoo b5c660d8c0 [IMP] base: batch XID generation during export
* add UUIDs to XID sections (4 bytes / 8 hex digits) so it's not
  necessary to handle collisions & add a fallback generator
* use COPY for performances over executemany: executemany just
  performs an implicit loop on all statements (in psycopg2)
* ~pure SQL was possible:

      INSERT INTO ir_model_data (module, model, name, res_id)
      SELECT
          '__export__',
          '{model}',
          '{table}_' || A.id || '_' || uuid_generate_v4(),
          A.id
      FROM {table} A
      LEFT JOIN ir_model_data B
             ON A.id = B.res_id AND B.model = %s
      WHERE B.res_id IS NULL;

  but would have required installing pg extensions (problematic
  especially in stable) and performances are about the same as
  the COPY version

task 36343
Fixes #22493
2018-04-05 10:34:48 +02:00
Mathieu Duckerts-Antoine e5b109b422 [IMP] web: update mock server to better match server semantics
The read_group method (from the server) is implemented in the mock
server, to allow easy unit testing in javascript.  However, the
behaviour was not exactly the same: a read_group call on a domain with
no records returns null for aggregates.  But the mock implementation
returned a value of 0.

We fix this in this commit, to allow more precise testing of Odoo
javascript.
2018-04-05 10:33:24 +02:00
Martin Trigaux 85499c76d4 [FIX] stock: do not set useless filters
The filters have no effect and it may be confusing to remove it and see the same
result.
The filters themself will be removed in master.

opw-1832502
2018-04-05 10:29:53 +02:00
Simon Lejeune 0cdfae0e25 [FIX] stock: _compute_show_operations
Using `break` when looping over a recordset in a compute method could
have side effects. Computed field are computed in batch, according to
the order of the recordset, the value may only be computed correctly for
some records

related to rev c493569866

opw-1833347
2018-04-05 10:18:22 +02:00
Nicolas MartinelliandGéry Debongnie 6397ce7eb0 [FIX] web: loss of context when duplicating
- Create a vendor bill, save and validate
- Duplicate the bill, save
- Click on "Create"

A customer invoice is created, while the user expects a vendor bill.

After duplication, the new record is loaded but the context is lost.
Since the default value for the invoice type is based on the context key
`type`, a loss of context leads to an incorrect invoice type.

opw-1826453

Co-authored-by: Géry Debongnie <ged@odoo.com>
2018-04-05 10:12:06 +02:00
Géry Debongnie 19946294fa [DOC] doc: update/add documentation on js framework
The state of the JS documentation was quite sad, not updated in a long
time.  With this commit, we rework a lot of the JS doc.  Most notably,
we add a section 'Javascript Cheatsheet' (help on some common
customization tasks) and rewrite the 'Javascript Reference' totally.

Note that the JS reference page also contains a reference on all field
widgets.

This work is just the beginning, it is probably not complete, but at
least we will have a foundation.
2018-04-05 09:22:09 +02:00
Romain Derie 64ef2b396b [FIX] web_editor: same style on div and p in backend in edit mode
Before this commit:
In the web_editor in backend, entering edit mode would display differently text
in `div` and text in `p` but not when viewing the content outside edit mode.

Now, `div` and `p` won't have different style when entering edit mode.
2018-04-04 22:56:45 +02:00
Romain Derie 6be3a2a2a0 [FIX] web_editor: Reduce interline in web editor html lists
Backport of 2b575e9 that landed in master
2018-04-04 22:56:28 +02:00
thomas-tankengine eaf54656fc [FIX] l10n_fr_pos_cert: set decorator on unlink
As unlink from models is still written in old API, needs to set the decorator to
avoid an error when trying to delete a bank statement

Closes #23999
2018-04-04 16:31:49 +02:00
tlemaire 7d2f082d80 [CLA] signature for Thomas Lemaire
Done at #23999
2018-04-04 16:31:48 +02:00
Denis Vermylen (dve) 9d95abd35c [FIX] theme_*: restore category to theme
category was changed to "Website" so it'd appear under the website
category in the store, but it needs to be "Theme" otherwise it doesn't
appear in the "Choose your theme" menu after installing website.

This is a backport of 10.0 https://github.com/odoo/odoo/commit/3d53a740

Without extra themes, the "Choose your theme" would be empty.

fixes #21898
opw-1802936
closes #24042
2018-04-04 16:18:29 +02:00
Goffin Simon a36ff26ce0 [FIX] point_of_sale, sale_stock, stock_account: POS Anglo-Saxon Accounting
In average price or in FIFO, the stock move cost related to the picking of the POS Order
must be used to compute the price.

opw:1829842
2018-04-04 16:16:59 +02:00