Commit Graph
126256 Commits
Author SHA1 Message Date
Nicolas Lempereur 5838e47ab5 [FIX] web: modal in modal => no block mobile
On a form view:
- we open a modal form view
- in this modal we open a modal form view
- we close that second modal

=> the modal is closed and the first one is still opened, but on mobile
we can't scroll to above or below the modal.

This is because bootstrap remove .modal-open class on body when we close
the second modal, but this class is necessary to scroll (this is not
much an issue on desktop since scroll is often not necessary).

We already had a fix that was weakened in 02a063fd73.

With this changeset, we keep .modal-open as long as a modal is opened.

Without the change, added test failed with:
  10. Modal is said opened (expected: true, result: false)

opw-1948423
closes #32106

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-25 16:58:06 +00:00
Christophe Simonis e9068c290b [MERGE] forward port branch 11.0 up to 0196a6feb5 2019-03-25 16:47:05 +01:00
Olivier Colson 2fa9e881f4 [FIX] l10n_fr: fix wrong tag on tax
Before that, the tag set on this tag for its base amount was wrong; it caused it to be reported in the wrong section in l10n_fr_reports.

closes odoo/odoo#32103

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-25 15:08:55 +00:00
Martin Trigaux 57e6346442 [FIX] web: format date without locale
moment().locale('en').format('YYYY-MM-DD')
"2019-03-25"
moment().locale('ar').format('YYYY-MM-DD')
"٢٠١٩-٠٣-٢٥"
moment().locale('my').format('YYYY-MM-DD')
"၂၀၁၉-၀၃-၂၅"

Was rejected as a valid bug at moment/moment#4448
Apply the same logic than 109b319d64

Fixes odoo/odoo#32081

closes odoo/odoo#32102

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-25 14:42:28 +00:00
Isabel Esparza 6155210d12 [FIX] crm: states
Onchange to show only the states of an especific country in
opportunities.

Closes #31993
opw-1958170

closes odoo/odoo#32099

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-25 14:13:34 +00:00
Christophe Simonis 0196a6feb5 [MERGE] forward port branch saas-15 up to 6cd6d1d468 2019-03-25 15:12:00 +01:00
Thibault Delavallée 02f5b654c3 [FIX] website_slides: fix vote karma
Currently doing a like then dislike does not give a void karma total. Indeed
karma is removed / added only when the vote hits 1 or -1 but does not correctly
take into account the third (void) state. We also avoid adding karma when
upvoting / downvoting an already upvoted / downvoted slide. Interface does
not allow it but avoiding to add karma at model level is always a good idea.

Karma-related tests are improved a bit.

Commit linked to task ID 1958810 and PR #32057

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-25 12:39:32 +00:00
Can Tecim a39b1f4595 [ADD] l10n_tr: add provinces of Turkey
closes odoo/odoo#31592

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-25 12:38:05 +00:00
Christophe Simonis 6cd6d1d468 [MERGE] forward port branch saas-14 up to 3c7be1e88f 2019-03-25 13:32:17 +01:00
Christophe Simonis 3c7be1e88f [MERGE] forward port branch 10.0 up to a95811eee2 2019-03-25 13:30:34 +01:00
Thibault Delavallée 534822e54c [REF] website_slides: better completion computation
Purpose is to avoid having to recompute too much stuff. Indeed currently
slide.channel.partner completion field depends on its channel number of
slides. It means adding a slide on a channel having a lot of members will
trigger the recompute of all its slide channel information.

Instead completion on slide.channel.partner is now simply the number of
completed slides. Computed (not stored) field on channel that indicates
current user status is now based on total slide (completion / total slides).

Commit linked to task ID 1958810 and PR #32057
2019-03-25 12:18:28 +00:00
Thibault Delavallée eb045af676 [FIX] website_slides: remove unnecessary sudo in computed field
As we always update slide / partner relationship using sudo let us remove
unnecessary sudo in the computed field.

Tests are added to ensure it is effectively working. At least probably.

Commit linked to task ID 1958810 and PR #32057
2019-03-25 12:18:28 +00:00
Xavier Dubuc 46d22fbd4f [FIX] product: template kanban view perf
When displaying product template list in kanban mode, all the variants
of the product template are loaded but aren't used at all. This causes a
perf issue when loaded product templates have a lot of variants.

This commit removes the field `product_variant_ids` from view
`product_template_kanban_view` to avoid that perf issue.

opw 1951369

closes odoo/odoo#32048

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-25 11:44:55 +00:00
Bernard Letourmy 8d95b6c172 [CLA] Signature for bletourmy
closes odoo/odoo#32092

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-25 11:04:58 +00:00
Nicolas Lempereur e1b1d3cd1b [FIX] web_editor: no lose tooltip on selection
The editor has a tooltip editor wizard "Change media description and
tooltip", but when selecting an image there is also a tooltip:

  "Double-click to edit"

added by the editor.

The combination of the two break the functionality, eg:

- if a tooltip is set with editor, then selecting the tooltip: we see
  the set tooltip and not "Double-click to edit"

- if a tooltip is set with editor, then selecting the image back, then
  opening the tooltip editor => the set tooltip is lost

With this changeset, we just do not show "Double-click to edit" tooltip
if there is a tooltip set on the element.

opw-1946801
closes #32482

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-08 08:17:57 +00:00
Odoo Translation Bot 610ab82b51 [I18N] Update translation terms from Transifex 2019-04-07 03:14:49 +02:00
Jorge Pinna Puissant f666d78ff1 [FIX] base_address_city: city field without CSS class
Have the module 'City Addresses' installed.
Open a contact, with the city field and  the zip code field filled.

Before this commit, there is a display error, the city and the zip code
are bonded. This occurs because the 'City Addresses' module override all
views with the city field. In this override the city field don't had a
CSS class.

Now, the city and the zip code are display correctly.

opw-1958175

closes odoo/odoo#32455

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-05 11:56:22 +00:00
Matthew Watkins 1ad2a864df [CLA] signature for matthewdwatkins
closes odoo/odoo#32435

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-05 09:36:43 +00:00
Lucas Perais (lpe) 6524b79652 [FIX] stock: constrains should raise ValidationError
Before this commit, some constrains rose UserError
Which is not compliant with the api.constrains

After this commit, the constrains raise ValidationError

OPW 1949572

closes odoo/odoo#32444

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-05 08:17:05 +00:00
jev-odoo 741ffc45d1 [FIX] account_payment: invalid partner on payment token
The payment token was created using the partner of the invoice,
not the one really paying the bill.

opw 1938787

closes odoo/odoo#32176

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-05 08:15:58 +00:00
Christophe Simonis e3f5f17561 [MERGE] forward port branch saas-15 up to 214e819c1b 2019-04-04 20:07:27 +02:00
Damien Bouvy ce8d651cce [FIX] orm: don't crash on index creation
Creating field indexes might not always be possible.  For instance,
adding an index on an existing Char/Text field will fail if the column
contains values longer than 8192 bytes (PostgreSQL limit for BTrees).

Instead of failing miserably during the schema modification, simply log
the problem and continue.

closes odoo/odoo#32416

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-04 11:47:20 +00:00
Nicolas Martinelli 8b6be83f70 [FIX] stock_account: zero quantity
- Set up a stockable product for which the product category is FIFO / Perpetual
- Create a PO for this product with a unit price of 100$
- Confirm the purchase order
- Receive the item in stock
- Create a SO for this product
- Confirm the SO
- Deliver the item
- Unlock the delivery order and change the done quantity to 0
- Unlock the delivery order and change again the done quantity to a positive value

A `ZeroDivisionError` is raised.

Since `move.product_qty` is still zero, we fallback to `quantity`.

opw-1963984

closes odoo/odoo#32421

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-04 12:05:39 +00:00
Nicolas Lempereur 8557bcfa30 [FIX] website: language prefixed URL on website bis
Reintroduces 5324284f5 that was reverted because in the case of an URL
like /payment_stripe/static/src/js/stripe.js directly inside a QWeb
template, we would possibly get:

  /fr_FR/payment_stripe/static/src/js/stripe.js

Which is not accepted by werkzeug SharedDataMiddleware we use to serve
static data in /{module_name}/static/ directories.

Added test without changeset failed with:

- test_process_att_no_request_lang: <AssertionError>
  line: self._test_att('/en_US/', {'href': '/'})
  wrong result: {'href': '/en_US/'}
- test_process_att_with_request_lang: <AssertionError>
  line: self._test_att('/', {'href': '/fr_FR/'})
  wrong result: {'href': '/'}
- test_process_att_matching_cdn_and_lang: <AssertionError>
  line: self._test_att('/en_US/a', {'href': 'http://test.cdn/a'})
  wrong result: {'href': 'http://test.cdn/en_US/a'}
- test_process_att_no_route: <AssertionError>
  line: self._test_att('/my-page', {'href': '/fr_FR/my-page'})
  wrong result: {'href': '/my-page'}
- test_process_att_url_crap: <IndexError: list index out of range>
  line: request.httprequest.app._log_call[-1],

opw-1922051
closes #32095

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-02 14:45:24 +00:00
Nicolas Martinelli f1744a31a1 [FIX] stock: scrap and validate
- Sell 4 units of a product in stock
- On the picking, create a scrap for 1 unit
- Validate
- In the immediate transfer wizard, validate

The scrap is reset to zero.

This is because the wizard overwrite the done quantity with the reserved
quantity (0.0).

If the move is already done, there is no reason to overwrite the
quantity.

opw-1958514

closes odoo/odoo#32410

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-04 09:19:23 +00:00
jev-odooandNicolas Martinelli 82d733d68c [FIX] survey: incorrect selector
The jQuery selector is slightly too permissive, and therefore incorrect
elements may be matched. See opw for example.

Co-authored-by: Nicolas Martinelli <nim@odoo.com>

opw-1947698

closes odoo/odoo#32149

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-03 13:41:57 +00:00
Florent de Labarre b9f2d8f3f4 [FIX] account: add date field in account.move.line form view
closes odoo/odoo#31800

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-03 16:12:06 +00:00
Denis Ledoux a7ac88e68c [FIX] point_of_sale: crashing tax cash basis when no reconciled order line
Because of rev. d3453f7d15
when none of the pos order lines were reconciled,
the closing of the point of sale sessions failed
because of the tax cash basis entry generation.

There is no need to create the tax cash basis entries as nothing has been reconciled.

A known case is when the the bank journal credit account is set to a receivable account,
which has as effect to fully reconcile the payment line with its counterpart,
leaving no payment lines to reconcile with the order debit lines.
This is obviously not a correct accounting configuration,
but the point of sale validation did no fail because of this previously.

Fixes #32330

closes odoo/odoo#32399

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-04-03 15:22:12 +00:00
Cas Vissers 436eb69450 [FIX] account: reconcile older invoices first
Often an invoice with the same amount is send to the same customer every week/month. If the customer pays just the amount, without any matching invoice information, common practice is to take the oldest invoice first.

Odoo currently suggests the invoice with the highest due date.
After the fix Odoo will suggest the invoice with the lowest due date.

closes odoo/odoo#32334

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-03 14:01:47 +00:00
Nicolas Lempereur 2a89f0c7f8 [REV] "[FIX] website: language prefixed URL on website"
This reverts commit 5324284f56
This reverts commit ad826f56ba.

If for example we had in a template:

 <script type="text/javascript" src="/payment_stripe/static/src/js/stripe.js"></script>

it has been reproduced to be gotten as:

 <script type="text/javascript" src="/de_DE/payment_stripe/static/src/js/stripe.js"></script>

which is unexpected and could cause an error.
closes #32090

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-25 10:53:25 +00:00
Gert Pellin 6814f27bbc [FIX] hw_escpos: opening pulse cashdrawer
Some cashdrawers will not open when the command is send. This can be
solved by sending a longer opening pulse.

Used fix of newer library:
https://github.com/python-escpos/python-escpos/blob/0a89ee2b8610452f18b521af71b1ab1af7932894/escpos/constants.py#L40
Explanation for command:
http://www.beaglehardware.com/howtoprogramcashdrawer.html

closes odoo/odoo#32079

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-25 10:03:54 +00:00
Colinliz a4f9b48667 [CLA] add Colinliz to Inspur CCLA
closes odoo/odoo#32076

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-03-25 10:02:08 +00:00
Nicolas Martinelli d3bd48d67b [FIX] stock: has_tracking
The field `has_tracking` should be read-only, there is no reason to make
it writeable.

opw-1958266

closes odoo/odoo#32080

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-25 08:24:01 +00:00
Odoo Translation Bot fa12433867 [I18N] Update translation terms from Transifex 2019-03-24 03:11:51 +01:00
Yenthe666 92313e11dc [FIX] mrp: make product_tracking readonly to avoid write operation
closes odoo/odoo#32070

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-03-23 09:46:07 +00:00
Nicolas Martinelli 719b0ab683 [FIX] stock_account: standard price currency
Oversight during forward-port of 950d0f1849

closes odoo/odoo#32488

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-08 10:09:10 +00:00
Nicolas Martinelli 2d17baa07c [FIX] product: archived template
When a new `product.template` is imported with `active` set to `False`,
the associated `product.product` is active.

This is not consistent with what happens in the UI: when a template is
archived, all variants are archived.

At variant creation, we keep the `active` value of the template.

opw-1955116

closes odoo/odoo#32461

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-05 14:14:59 +00:00
Nicolas Martinelli 0f971130d6 [FIX] base: inactive lang
Make sure to retrieve the lang in case it is inactive. Note that a lang
cannot be deactivated if it is set on a `res.users`, but no check if
performed on a `res.partner`.

opw-1964655

closes odoo/odoo#32457

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-05 13:04:04 +00:00
Olivier Dony 28a1371035 [FIX] payment_ogone: send client info in S2S tx data
The client IP and email are useful pieces of information for auditing
transactions, and are used by the Fraud Detection Module(s) of Ingenico.

closes odoo/odoo#32058

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-03-22 18:35:28 +00:00
Nicolas Lempereur ad826f56ba [FIX] http_routing: ignore # when checking multilang URL
With 953a693df when a route is not found we assume it is a website.page
that can be multilang.

But with #31792 we should once again prefix URL by the language if
necessary.

The combination of the two cause issue when an url like `/web#home` is
tested since we do not take `#` into account, we check if the route is
multilang but no route `/web#home` is found => so we get
`/fr_FR/web#home`.

With this fix, `#fragment` is not taken into account when searching
route.

related to #31792
related to opw-1922051
closes #32059

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-22 16:51:09 +00:00
Nicolas Lempereur 5324284f56 [FIX] website: language prefixed URL on website
In 10.0 and before, if we were eg. on website page /fr_FR/contact, if
`fr_FR` language (french) is installed and not the default website
language we would have all URL towards translated content (route with
multilang=True) prefixed with /fr_FR/ (the language code).

With 9cd982bcc some improvments were done to CDN but this also breaks
language prefixing, so this cause an unecessary redirect:

- we are on /fr_FR/contact and click on "Shop"
- we go to /shop
- odoo redirects US /fr_FR/shop

With this PR, URLs are prefixed with language once again.

note: the added test is hackish but the function tested depends on a lot
of odoo.http things that are hard to use for test (request.render,
request.context, request.httpreqest).

opw-1922051
closes #31792

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-22 16:14:09 +00:00
Christophe Simonis 3a0bedd655 [MERGE] forward port branch saas-15 up to 48e4c18fc4 2019-03-22 16:26:33 +01:00
Christophe Simonis 48e4c18fc4 [MERGE] forward port branch saas-14 up to cded89b531 2019-03-22 13:26:19 +01:00
Christophe Simonis cded89b531 [MERGE] forward port branch 10.0 up to f1c72ee8ee 2019-03-22 13:25:55 +01:00
Adrian Torres 353474fba2 [FIX] sale: do create of sale.order.line in batch
With this patch, `sale.order.line` records can now be created in batch,
this means that operations such as:

    - SO copy
    - SO create + commands
    - SO import

will benefit from this patch in terms of performance.

E.g.

For a SO of 2k lines, duplicating the SO takes:
Before patch: 1515s
After patch: 171s

Creating an SO with SOL as o2m commands:
Before patch: 181s
After patch: 43s

closes odoo/odoo#32040

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-03-22 12:08:35 +00:00
Nicolas Martinelli f15a19d127 [FIX] delivery_hs_code: help on field
At the moment, the HS Code is only used in FedEx. This is confusing for
users, since they expect it to be supported for all providers.

We improve the tooltip.

opw-1961472

closes odoo/odoo#32445

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-05 08:25:04 +00:00
Nicolas Martinelli 6e1170b3c3 [FIX] sale: send sample
In a multi-company / multi-currency / multi-pricelist environment,
sending the sample SO may crash because the `company_id` field on the SO
line is not yet defined when a price conversion is necessary.

This is because it is a stored related field used in `product_id_change`
which is called programmatically at creation.

opw-1948629

closes odoo/odoo#32443

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-05 07:51:05 +00:00
Martin Trigaux 489494e733 [FIX] base: upsert translations during copy_translations
When doing a copy, create the new translations directly in SQL and handle
potential conflicts.

Conflicts can occure in case of reinstallation as showed in opw-1955062 and
opw-1950117.
In case of "leftovers" of translations (e.g. remaining after the uninstallation
of a module), creating the new translations (when reinstalling the module) may
produce a conflict with (type, name, res_id, lang) and raise an error.

This is NOT a problem of reading .po file during installation (which handles
correctly conflicts) but of business code creating new records and linked
translations (e.g. website copying website.menu records).

Removing old translations during uninstall is handled in a previous commit in
ir.model.fields _drop_column method.
This commit fixes the reinstallation on instances with leftover translations
and fixes the issue without needing a manual intervention (i.e. delete the old
translations manually).

Closes odoo/odoo#32056

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-04-04 14:41:26 +00:00
Martin Trigaux 112bd835d8 [FIX] base: drop translations when dropping a column or table
Better than if ba58888ced as the records may be removed via ondelete='cascade'
(where the unlink is not called on the record).  Will be faster too.

A solution to opw-1955062 and opw-1950117 with uninstallation of website.

Closes odoo/odoo#32056
2019-04-04 14:40:20 +00:00
Deiber Rincón ad4b5053ba [CLA] add Deiber to Xoe Corp CCLA
Signed-off-by: David Arnold (dar) dar@xoe.solutions

closes odoo/odoo#32403

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-04 19:49:37 +00:00