Commit Graph
103581 Commits
Author SHA1 Message Date
Jeremy Kersten aaa8a87f36 [FIX] website_forum: check karma to allow to flag a post without rights to edit
If you set 200 kamra to allow to flag a post and 300 to edit all post, you was
not able to flag the post before this commit.

This commit closes #21274

@kangol: warning, fwd port need to add tag_ids into trusted_keys
2018-01-03 16:12:02 +01:00
Goffin Simon 0e943241fe [FIX] web: rotate graph label
When there are too many labels to display on the x-axis, they overlap
and it simply becomes unreadable. By slightly rotating them, this can be
avoided in most cases.

Back-port of this commit 388e258ce8

opw:802925
2018-01-03 09:40:23 +01:00
Odoo Translation Bot 62aa3be24c [I18N] Update translation terms from Transifex 2018-01-01 02:40:01 +01:00
Yannick Tivisse 9d25f63c9b [FIX] account_budget: Make the analytic account mandatory on budget form
Purpose
=======

When you create a budget, the field analytic account on the budget line is not mandatory but if you don't set one, it doesn't work, the practical amount always stays at 0 even if there are journal items in the accounts defined in the budgetary positions
2017-12-27 13:47:42 +01:00
Nicolas Martinelli 8aa1a493a0 [FIX] account: exchange rate of price_subtotal_signed
The field `price_subtotal_signed` contains the price converted in the
company currency. However, we should make sure to use the exchange rate
of the invoice date for its computation.

An use problematic use case is the creation of a deferred revenue from
an invoice (commit 7fe89d08b3).

opw-702352
2017-12-27 10:00:46 +01:00
Lucas Perais (lpe) 49cbeabe10 [FIX] point_of_sale: prevent taxes of another company to be loaded
As admin every tax is loaded, which is wrong anyway.
When the admin opens a session a change the cashier in the POS interface,
every order is made with every tax ever (on the product)
which could lead to major faulty records

See the case on OPW 786803 which is critical
2017-12-26 09:10:04 +01:00
Nicolas Lempereur be5950e429 [FIX] web_planner: use user language on frontend
The web planner specified no language for frontend so the website
planner on the frontend was never translated.

This commit add a specialized fallback for this use case so the planner
on the website is in the language of the current user.

The code is the same that get_context from web_editor.base but requiring
that would possibly adds delays (for dom_ready) that we don't want.

note: this is for 9.0 up to not including 11.0, in 11.0 another solution
is used and in master a bigger change is being worked on.

opw-781727
fixes #20829
closes #21004
2017-12-20 18:01:09 +01:00
qsm-odoo 16065f3ee2 [FIX] website_sale: hide checkout btn on emptied cart in all languages
When an user goes to its cart and removes all the items, the checkout
button is hidden so that the user cannot start an order with no product.
This behavior was not working in languages which are not the default
language of the website, as the button was found in JS relying on the
fact it started by "/shop/checkout", while it can be something like
"/fr_FR/shop/checkout".

Closes https://github.com/odoo/odoo/issues/21722
2017-12-20 12:25:53 +01:00
Guillaume Masson d8846e8e64 [FIX] l10n_fr_pos_cert: bad import
Closes #21735
2017-12-20 10:57:42 +01:00
Guillaume Masson 5651f28cd7 [CLA] add metaminux to TecLib CCLA
Done at #21735
2017-12-20 10:56:49 +01:00
Florent de Labarre 06ccccdb75 [FIX] account: check ACL and ir.rules upon account.move cancellation
Was PR #21732. Was OPW 800611. Courtesy of Florent de Labarre
2017-12-19 17:52:18 +01:00
Stéphane Bidoul (ACSONE) a8e444bea8 [FIX] l10n_lu: bad line breaks in CSV data
This was causing the creation of weird records when installing this module
2017-12-19 16:48:35 +01:00
Nicolas Martinelli ad8e1118c1 [FIX] web: action url never call on_close method
On a tree view:
- Add a button returning an `act_url` action; e.g.:
```
@api.multi
def open_google(self):
    return {
        'type': 'ir.actions.act_url',
        'url': 'https://google.fr/',
        'target': 'new',
    }

```
- Click on a button

The action call works only once because the button is never re-enabled.

The button is actually enabled only at view rendering. Therefore, we
call `on_close` in order to reload the view.

opw-784587
2017-12-19 11:18:12 +01:00
Olivier Dony f65f065901 [FIX] web tests: correct wrong route visibility 2017-12-19 10:12:34 +01:00
Nicolas Martinelli 9b83b1ba64 [FIX] point_of_sale: prevent scanning on receipt
- Sell a Product A
- From receipt screen, scan the barcode of Product B
- B will be in tab along with A
- Pay and validate
- Close the session

Only an order with Product A is recorded in the session (order 1).

When performing this set of actions, a new order is not created: the POS
simply reuses the current order. However, `create_from_ui` (called in
the receipt screen) discards an order if the reference already exists.
This means that the first order is correctly synchronized at validation,
while the second order is silently discarded.

Closes #16781
opw-766459
2017-12-18 14:40:19 +01:00
qdp-odoo 9bba7fea42 [FIX] l10n_ch: update taxes for 2018
- Added taxes for year 2018 of sales and purchase with percentage 3.7 and 7.7
- Added tags to show newly added tax in VAT report(enterprise branch) for Switzerland

Was PR #20851. Was task 39082.
2017-12-15 15:50:43 +01:00
qsm-odoo 69d4383d7b [FIX] web_editor: browser-unify alignment editor option
Summernote uses `document.execCommand` to apply most styles when
editing, leveraging the implementation to the browser.

Summernote is configured to use HTML styling (`'styleWithSpan': false`),
and in this case, browsers such as Firefox use HTML attributes for
styling text align, while Chrome still uses CSS for that. In fact,
`document.execCommand` is browser-inconsistent... but so is the
`styleWithSpan` option. Indeed, setting the option to `true` will make
Firefox use CSS property for alignment too... but not Internet Explorer.
So we might consider changing this option's value but this would not
solve the current problem.

Indeed, any CSS `text-align` style in Firefox takes precedence above
the element's `align` attribute, so when users were trying to align text
on stuff that was pre-aligned, they were unable to do so.

We can better explain the situation with this example:
A user tries to left-align in Firefox a `p.text-center` element, and
produces this:

```html
<p class="text-center" align="left"/>
```

(`align` attribute is ignored because of the `text-center` class)

On Chrome, this would be produced with the same steps:

```html
<p class="text-center" style="text-align:left"/>
```

With this patch, we actually make that HTML look like expected by the
user, no matter the browser he's using, by forcing the editor to use
the text-align CSS property. Note that the implementation is quite
ugly but had to take care of compatibility.

See https://github.com/odoo/odoo/pull/20900
(thanks to @Yajo for original PR)
2017-12-15 14:06:04 +01:00
Nicolas Lempereur c8df0333f5 [FIX] mrp: determine order of mrp.production
The order of production was first based on "priority DESC" and then
"date_planned ASC".

So for production with the same priority/date_planned the order is not
deterministic.

This commit make the order deterministic as it seems preferred.

opw-784243
closes #21644
2017-12-14 12:57:22 +01:00
Christophe Simonis 228f6086b1 [FIX] l10n_fr_pos_cert: correct dependency 2017-12-14 12:55:32 +01:00
Lucas Perais (lpe) b75927f9e3 [FIX] l10n_fr_certification: adapting to the new specs
Main resource document to be found at https://www.economie.gouv.fr/files/files/directions_services/dgfip/controle_fiscal/actualites_reponses/logiciels_de_caisse.pdf

    This document states that only business operations with partners not being subject to VAT should be inalterable and secure.
    We adpat the module by differentiating between b2c and b2b journals and apply hashing on the former's moves

    Protection against account_cancel is not necessary anymore

    By default, this module considers a sales journal being a b2c, thus activating hashing on its move.
    Since we can't afford to lose information, when a b2c journal contains hashed moves, its b2c characteristic cannot be changed

[ADD] l10n_fr_pos_cert: module to adapt the POS to the recent French regulation CGI art. 286, I. 3° bis.

    The module adds following features:

    - Inalterability: deactivation of all the ways to cancel or modify key data of POS orders, invoices and journal entries

    - Security: chaining algorithm to verify the inalterability

    - Access to download the mandatory Certificate of Conformity delivered by Odoo SA (only for Odoo Enterprise users)

[ADD] l10n_fr_sale_closing: module to store automatically the total of daily/monthly/annualy sales.

    (both of the period and cumulative).

    This fulfills another requirement brought by the recent French regulation CGI art. 286, I. 3° bis related to the storage of data

Was PR #20581. Was task 29922
2017-12-13 17:22:51 +01:00
Josse Colpaert 22f8660e22 [FIX] stock: don't propagate cancel when chained move is done
When you have e.g. an SO with a product MTO generating a manufacturing
order, and you put the delivery order to done, before the MO is done,
you can not cancel the MO anymore, because the cancel method checks if
the move is not done (and raises an error).

As the user stays blocked in this case, it is better to just not try to
cancel the destination move by not propagating the cancel when the destination
move is done.

opw-786571
2017-12-13 10:17:48 +01:00
Wolfgang Taferner 30d0861f0a [FIX] base: ir.sequence better fallback
Zero is an non-acceptable value for sequences, so the fallback should be
one instead.

Fixes #21267
2017-12-13 08:51:05 +01:00
Nicolas Martinelli 7a24a2f45f [FIX] field: avoid overhead of record._set_dirty when setting fields (#21378)
Setting fields as dirty was dramatically slow for huge one2many fields.
2017-12-12 13:36:23 +01:00
Pedro M. Baeza d82b360309 [CLA] backport signature for Tecnativa
backport of dc8010c9b to 9.0
Asked in #21496
2017-12-12 11:39:35 +01:00
Romain Derie ce038f5d15 [FIX] auth_oauth: correctly retrieve user facebook email
Before this commit, you could never get the user's facebook email. Since there
was no email field on facebook response, email would be then set to an auto
generated value like 'provider_2_user_0123456789123456' by odoo.

Now, we correctly request user's email to facebook.

opw-782771
2017-12-05 13:29:06 +01:00
Joren Van Onder b2f0af4543 [FIX] point_of_sale: allow searching a partner on >2 fields
When searching for a partner the ' ' (SPC) character can be used as a
field separator. You can search for e.g.:

'agr namur'

which will return the 'Agrolait, 69 rue de Namur,...' partner.

For some reason only the first space was considered a separator. So
e.g.:

'agr namur belgium'

wouldn't work.

This commit makes it so that every space character is considered a
separator.

Fixes #21357
2017-12-04 14:18:36 -08:00
Adrian Torres c338e24ee7 [FIX] *: ordered group_by for field with capital letters
When doing a group_by in a tree view, and then ordering by an
aggregated field which contains at least one capital letter in its name,
you will get an error and won't be able to ordery by this field.

Why? read_group is called when sorting a group by, which calls
_read_group_raw which then goes to call _read_group_prepare, which will
return order by terms in this manner ['id asc', 'x_Test desc']
the problem with this is that postgres automatically converts
non-quoted/non-qualified column name to lowercase, of course this means
that if we have a field "x_Test" but no field "x_test", it will try to
look up "x_test" instead of "x_Test" and since the column doesn't exist,
it will throw a ProgrammingError.

This commit changes this behavior by wrapping the order_by terms generated in
_read_group_prepare with double quotes, which postgres interprets
correctly.

Fixes #21348
2017-12-04 16:28:32 +01:00
Christophe Simonis 62fcf6a9fe [FIX] project: only copy tasks when not explicitly set 2017-12-04 15:07:49 +01:00
Nicolas Martinelli e5075147cf [FIX] web: pie chart
Mixing positive and negative values in a pie chart is not possible.
However, in this case, a crash occurs instead of displaying an error
message.

opw-786137
2017-12-04 14:02:12 +01:00
qsm-odoo 5e38bef5a5 [FIX] website: review iframe video building
/!\ This commit *must* be "forced" forward-ported /!\

Recent commit(s) broke existing databases making website videos
disappear / not be saved / ...

Original code was broken then fixed by a succession of commits which
solved some errors to create new ones. Hopefully, this one is the right
stable one. Existing databases should be restored while allowing new
videos to be added correctly no matter the version. In master, a solution
must be found to smoothly migrate old videos to a new better system.

See:
https://github.com/odoo/odoo/commit/8749410b1033ddec1207ce1db42d1889a0d2ea33
https://github.com/odoo/odoo/commit/45e0cd564afdae71e9525193250744e88076da71
https://github.com/odoo/odoo/commit/6d2bf44fee76a8b73ebad206cd7a283c88b6c4ef (opw-783233)

opw-786165
2017-12-04 11:45:06 +01:00
Adrien Dieudonne e15e6fe32e [FIX] web_editor: support of SVG elements in snippets
Before this commit, it was not possible to save a page
containing a snippet with a SVG tag.

To support SVG elements, we need to use 'Element.getAttribute'
and 'Element.setAttribute' as mentionned in the documentation:
https://developer.mozilla.org/en-US/docs/Web/API/Element/className

For more information, see GH-14485
2017-12-04 09:24:35 +01:00
Odoo Translation Bot 19fda52a53 [I18N] Update translation terms from Transifex 2017-12-01 02:53:01 +01:00
Thibault Delavallée fe4bb49b21 [FIX] mail: fix wrongly duplicated access right 2017-11-30 12:55:48 +01:00
Romain Derie 82bde85030 [FIX] website_sale(_options): text in field qty throws error and/or create infinite quotations
Before this commit:
1. If user wrote text in the quantity field to add to his cart, it would crash
and show a server error.

Now, if the user insert a non-valid quantity in the field, we set it to 1

Step to reproduce:
With website_sale only
  - Go to a product page on the shop
  - Insert 'abc' in the quantity field and click 'Add to Cart'
  - Server will throw an error 'Can't parse float..'
With website_sale_options
  - Go to a product page on the shop
  - Insert 'abc' in the quantity field and click 'Add to Cart'
  - Popup confirmation with optional product will show with 'NaN' in the qty
  - Click 'Proceed to checkout'
  - Server will throw an error 'Can't parse int..'

2. On the checkout, if user typed text in qty field it would create infinite
quotations.
Some modules (eg: website_event_sale) would hide this behavior because they
override the RPC call to '/shop/cart/update_json' and throw an error on the
RPC.

Now, if user type incorrect integer quantity, we set the quantity to 1.

Step to reproduce:
1. On base (website_sale only)
  - Add an item to your cart
  - On checkout page, set qty to 'abcd' or whatever text
  - Check your browser console, every 500ms their will be a RPC call
  - Check your quotations in backend, their will be a new one every 500ms
2. On db-all
  - Add an item to your cart
  - Set qty to 'abcd' or whatever text
  - Check your browser console, it will throw an error on the second call

This closes #20482, closes #20904
2017-11-29 13:31:59 +01:00
Ivan Yelizariev 832d73deb4 [CLA] IT-Projects LLC 2017-11-29 12:43:09 +01:00
Ivan Yelizariev 6ba492fb09 [IMP] point_of_sale: log error message too
It's needed in phantomjs tests.

Without this commit it printed only error stack, which doesn't provide enough
information to fix it. This is a problem when the error is not reproduced on
running tours manually in browser.
2017-11-29 12:43:09 +01:00
adekock11 59a5dfefa8 [FIX] base: South African Rand is before the amount
Closes #21234
2017-11-28 15:24:36 +01:00
adekock11 90d4d7318b [CLA] signature for adekock11
Done at #21234
2017-11-28 15:24:23 +01:00
Lucas Perais (lpe) cae188514f [FIX] web_editor: Fieldtexthtml wait until iframe loaded to save
In the case where:
- you are too fast editing a mass mailing, trigger an onchange (e.g. mailing_model) and then save
You can use the edit/save shortcuts to make yourself believe you are Flash Gordon
- your internet is too slow (Down: 4Mb/s, Up: 500kb/s, Latency: 20ms)

Before ths commit, the onchange will return *before* the field (the iframe actually) is loaded.
This onchange contains a signal *in* the body_html of the field to allow communication with the iframe.
If you save before the iframe is loaded, this body_html keyword will be saved.

After this commit we deactivate the save button until the iframe is loaded.
We could have gone for a python user error on the value of the body_html too.
But it would have added a supplementary click and potential reloading

OPW 783616
2017-11-28 11:22:30 +01:00
qsm-odoo 6d2bf44fee [FIX] website: do not duplicate iframes at each edition
Before this commit, when an user added a video in his page (an <iframe>)
it was then duplicated each time the snippet in which the video is was
edited and saved again, slowing the page loading.

As the code responsible for that is quite outdated, it should be
reviewed and refactored in master. This commit only fixes the problem
with more code. This commit will also fix existing databases, if the
user edit the video snippet once again.

(Note: even if this commit's code will be even more strange in master,
it *should* be forward-ported anyway).
2017-11-28 10:03:27 +01:00
Joren Van Onder 11ae103e12 [FIX] point_of_sale: search customers with full search query
When the keypress handler is called the pressed key has not yet been
added to this.value. This leads to the search being performed with
e.g. 'Agr' when the user has typed 'Agro'.

Fix this by getting this value when the timeout expires. At this point
the value will be updated.

Fixes #21129
2017-11-27 16:03:47 -08:00
Martin Geubelle ccaced9292 [FIX] web: display selection label in graph
When grouping a graph view by a selection field, the labels on x axis
were the selection values themselves (not their corresponding label).

This issue was only present if there was only one group by field. In
this case, the attribute `grouped_on` is not an array but a string
containing the field name. This case wasn't correctly handled.

Note that this issue is not present in the new views (from saas-16).

Closes #19790
2017-11-27 15:47:35 +01:00
Stefan Rijnhart 10de33a57e [FIX] mail: handle emails with a single non-text part
SAP sends out emails that only contain a PDF part, without a text or
html body, e.g.:

    X-Mailer: SAP NetWeaver 751
    Content-Type: application/pdf; name="Afleveringsbewijs.pdf"
    Content-Transfer-Encoding: base64
    Content-Description: Afleveringsbewijs

Before this patch, this single non-text part was parsed into the body of
the final message, as if it was a text part.

Making the check for the main part more restrictive solves the issue, as
there is no reason to assume that a non-multipart content is
necessarily of text/* type. This PR also includes a regression test.

Closes #21102
2017-11-27 10:58:16 +01:00
Laurent Smet 8214395a49 [FIX] account: fix account.tax order
Suppose some taxes with the same sequence:

The tax are not computed in the same order in POS and SO/INV.
This is wrong in case of multiple taxes affecting the base.

-opw: 779498
2017-11-22 11:55:28 +01:00
Jeremy Kersten 8be77ca382 [FIX] website_event: add old class removed in previous commit
That could break xpath for others modules and that have no real impact to keep
it since it is removed in JS via:
    .find('.modal-body > div').removeClass('container'); // retrocompatibility

Related to https://github.com/odoo/odoo/commit/809aaf9e7b9de28383444d5059b19a67bb513f51#commitcomment-25751949
2017-11-21 11:32:13 +01:00
Lucas Perais (lpe) 586d3d4460 [FIX] point_of_sale: fix perms in posbox script
Before this commit, the posbox was built and in the process the permissions of the repo were whanged
As a result, there was a diff in the repo, making it un-upgradable

After this commit, the permissions on the posbox' Odoo repository are unchanged, and no diff is to be seen
2017-11-21 08:30:13 +01:00
Lucas Perais (lpe) fee8b2b2d3 [FIX] point_of_sale: hardcode jessie in posbox scripts
Before this commit, the latest version of Raspbian was chosen.
It is not very helpful though as if something goes wrong, we don't on which part it is.

Also, fix python dependencies for the image
2017-11-21 08:29:52 +01:00
Lucas Perais (lpe) bab597bb47 [FIX] calendar: r_date must be defined before use
commit b4ec51021b forgot about the case where no domain was supplied
or when the conditions on it were not fulfilled.

before this commit, a traceback was thrown and no event was shown

After this commit, no errors and all the relevant events are shown

opw 782985
2017-11-20 09:16:16 +01:00
qsm-odoo 8d5c4cb30d [FIX] web: adapt JS boot logs to new Firefox version
When logging multiple elements in one log call in the new Firefox
version, all the elements are kept on one line. So if the second
element starts with a line feed, it will not go under the first
element but still be at the right of the first element, on a new
line.
2017-11-17 17:04:00 +01:00
Cedric Snauwaert 5b10f5dbc1 [FIX] account: reconciliation of payment with statement should not take lock date into account
If we have a payment in october and a statement in november and the lock date is 1st november, we can't reconcile both because we try to write statement_id on payment but there is the lockdate constraint. This is not correct and we should be able to reconcile both even after lock date as it is the case for other moves.
2017-11-16 12:23:48 +01:00