Commit Graph
127612 Commits
Author SHA1 Message Date
Goffin Simon 0247d2f35f [FIX] sale_coupon, sale_coupon_delivery: Wrong discount on promotion program
Let's consider a product P with a unit price = 100€
When a price list PL with a discount of 20% was applied, and
a coupon program CP with a discount of 10% was also applied,
system still calculated the rate based on unit price of the product
and not on the discounted price.

So in this example, the amount of the CP discount was 10€ instead of
8€ because the CP discount was computed on the unit price 100€
instead of the discounted price 80€ (with 20% discount of PL)

opw:2006829

X-port/Cherry-pick of odoo/enterprise@23739e8a71
2019-06-27 19:14:28 +02:00
Christophe Simonis 6c5783bd5a [MERGE] forward port branch saas-12.2 up to 465909f0fd 2019-06-27 19:10:09 +02:00
Christophe Simonis 465909f0fd [MERGE] forward port branch 12.0 up to cd21c016b0 2019-06-27 18:01:07 +02:00
Christophe Simonis cd21c016b0 [MERGE] forward port branch saas-11.3 up to 2f2bc67c06 2019-06-27 17:24:24 +02:00
Nicolas Martinelli 52749f9a02 [FIX] payment_stripe: UserError
In case of failure at token creation, raise a proper UserError instead
of a generic traceback.

opw-2025723

closes odoo/odoo#34420

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 13:07:18 +00:00
Nicolas Martinelli 7670c6c80a [FIX] pos_discount: change customer
- Enable general discounts for POS
- Create a POS session
- Add a product
- Create a general discount of 10%
- Change the customer

The discount is reset to the product price.

When changing the customer, the prices are reset:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/screens.js#L1251

In the case of a global discount, the price is therefore reset to the
product price in:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/models.js#L2304

To avoid this, we set the price as manually set. Conceptually, this is
indeed the case since we manually chose the percentage, therefore the
price.

opw-2009761

closes odoo/odoo#34416

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 11:51:54 +00:00
Nicolas Martinelli 365110e9eb [FIX] sale: no company
Avoid crash at currency conversion when no company is set on the SO

opw-2009044

closes odoo/odoo#34408

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 09:37:22 +00:00
William Henrotin fdcabf19b2 [FIX] mrp: wrong message construction
The error message is built from string pieces except one that is a list.
This commit cast this list into a proper string to be able to build the
error message.

closes odoo/odoo#34402

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-06-27 08:23:59 +00:00
Christophe Simonis b5beeb0901 [MERGE] forward port branch 11.0 up to 7742887e96 2019-06-26 13:52:44 +02:00
Nicolas Martinelli d870749d79 [FIX] l10n_fr_fec: remove new line
- Make a SO with a product that have a carriage return in its
description
- Export FEC report

The CSV contains new lines and is not correctly formatted.

opw-2026861

closes odoo/odoo#34385

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-26 11:45:57 +00:00
Nicolas Martinelli da986aa479 [FIX] l10n_fr_fec: backport fixes
Backport of:

a3519638a3
fe9e7d47b8

opw-2026861
2019-06-26 11:41:41 +00:00
Christophe Simonis d65953124c [MERGE] forward port branch saas-14 up to 61a51a8651 2019-06-26 11:15:32 +02:00
Christophe Simonis 61a51a8651 [MERGE] forward port branch 10.0 up to ea4ddff117 2019-06-26 11:12:36 +02:00
Nicolas Martinelli 6387614dca [FIX] product: create variants in multi-company
- Install stock module
- Activate multi-company and variants
- Create a second company
- Create a product with 2 variants
- Create a picking with the product for both companies
- Add an attribute on the product with 2 values
- Save

An AccessError is raised on `stock.move`.

It arises because the field `product_qty` on `stock.move` must be
recomputed but is on a record in a different company.

The `try` / `except` clause doesn't protect against the recomputation.
Indeed, what happens is:
- try to unlink in batch => AccessError due to recomputation
- try to unlink individually => AccessError due to recomputation
- try to write individually => the field couldn't be recomputed before
(flagged as dirty), so try again to recompute => AccessError

We perform the operation as sudo, and take care of checking the access
rights beforehand.

opw-2009450

closes odoo/odoo#34369

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-26 07:21:22 +00:00
Romain Derie 762b809f71 [FIX] website_sale_delivery: adapt test to 55ed70f405
There is a conflict in saas-12.3.
Indeed, the optional popup on a product when adding to cart got encapsulated
into a new module with 55ed70f405.

But 9308180089 introduced a new test in 12.0 about free delivery.
The tour expects the popup to be shown, but it is not the case anymore.

The tour needed to be adapted. Standard runbot was green since the test would
luckily be executed after `website_sale_product_configurator` would be
installed. That was not the case on runbot theme.

The chance is also taken to ensure the test is executed on the correct
delivery.

closes odoo/odoo#34367

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-25 16:53:08 +00:00
Nicolas Seinlet 33f47e0ae9 [FIX] sale: larger terms and conditions field
In edit mode, the terms and condtions field is too small

closes odoo/odoo#34332

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-06-26 10:39:20 +00:00
Olivier Colson 8c7d7e0c2f [FIX] account: correct default country on new tax repartition lines
When creating a new tax, before saving, the default-computed repartition lines had no country_id associated. It only 'appeared' when saving the record.

closes odoo/odoo#34359

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2019-06-26 08:11:17 +00:00
Bohdan Lisnenko 7742887e96 [FIX] http_routing: slugify_lib - max_length param should be int
closes odoo/odoo#33858

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>

closes odoo/odoo#34363

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-25 12:15:37 +00:00
Vincent Schippefilt 793933a128 [FIX] web: fix wrapping of many2one in list view
Before this fix, the many2one text in the list view was not wrapping.
After this fix, the text will wrap according to the available space
(managed automatically by the browser).

closes odoo/odoo#34345

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-25 08:34:11 +00:00
Christophe Simonis fbd874368a [FIX] website_sale_comparison: correct product removal from comparison list
Oversight of previous forward-port.
2019-06-24 14:48:54 +02:00
Goffin Simon 3d27337f6d [FIX] account: correct communication when registering payment for multiple invoices
When registering a payment against multiple vendor bills and change the memo,
the memo must be populated to all the payments. This behavior has been introduced
with the following commit in stable 11.0: c04065abd8

opw:2024652

closes odoo/odoo#34322

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-24 11:29:08 +00:00
Jorge Pinna Puissant 49b949759f [FIX] crm: change team with the default one
Backport from 12.0 to 11.0 (commit: 3cbdfe8807)

- Have two crm teams with the same team leader, and without team members
(team1, team2 as instance).
- Create a new lead, add as Salesperson the team leader, and as Sales
team the second previously created team (team2).
- Save the new lead.

Before this commit, when we save the lead, the sales team will change,
to set the default sales team for the chosen Salesperson, in this case
team1.

opw-2005924

closes odoo/odoo#33898

closes odoo/odoo#34327

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-06-24 11:22:23 +00:00
qmo-odoo cd8afe8546 [IMP] website(_sale)_slides: Add login,join,buy button on quiz
This commit improves the elearning onboarding on the quizzes

If the user is not logged in, a log in button will show up under
the quiz

If he is logged in but not a member of the course and the course is public,
a join button will appear under the quiz

If the course needs to be bought, a buy button will appear under the quiz.

If the course is on invite only, a message under the quiz will inform the
user about it

TaskID: 2003986
PR: #33861

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-06-24 10:51:27 +00:00
sri-odoo d334313125 [FIX] website_profile: fix ranks' imgs alignment
task-2025167

closes odoo/odoo#34238

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-27 10:24:50 +00:00
Christophe Simonis 0862963877 [FIX] sale_mrp: adapt test to new version
Since 9df79f42d0, you cannot confirm MO
without raw moves.

Oversight of previous forward-port.
2019-06-24 10:58:32 +02:00
Odoo Translation Bot eaeb75a3fb [I18N] Update translation terms from Transifex 2019-06-23 06:15:20 +02:00
Odoo Translation Bot 149783fb19 [I18N] Update translation terms from Transifex 2019-06-23 03:06:47 +02:00
Carlos Lopez eedb1bd8d2 FIX: take date on user time zone for payments of backend
closes odoo/odoo#34307

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-06-22 03:54:41 +00:00
Xavier Morel 7800433896 [FIX] base: don't overwrite existing extensions
The point was to fix files attachments without an extension,
potentially appending to existing extensions was not a smart idea.

See #34299, 5eb15c01b5
2019-07-02 10:04:55 +02:00
Romain Derie 805955b4d9 [FIX] website_crm_partner_assign: fix sitemap partner no country
Same fix as dee3b87ae4
Avoid sitemap to crash if a `res.partner` has no country.

Fixes #32636

closes odoo/odoo#34494

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-01 14:18:55 +00:00
Pragya Ladda bd49d9c0cf [IMP] website: cannot deactivate language used by website
closes odoo/odoo#31520

---

backport of 8e2f9a4fe2
Initially a improvement, it is now backported in 12.0 to fix #34430

closes odoo/odoo#34474

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-07-01 08:59:28 +00:00
Robot Odoo 44372471ef [FIX] website_sale: avoid adding website on customer when not needed
Before this commit, when an address would be edited or created from checkout,
we would always add a website_id on it.
(values_postprocess -> _checkout_form_save)

That would be incorrect if the website has not 'specific user account' enabled.

It would lead to an error as the user would not be able to connect to another
website. Indeed, the billing address is stored on the partner directly. Since
the res.user website_id is a related to the partner one, the user would then be
restricted to that website.

Fixes https://github.com/odoo/odoo/issues/34308

closes odoo/odoo#34396

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-01 14:26:35 +02:00
Romain Derie 9d5131a696 [FIX] website_sale: add tests
Parent commit moved needed functions into misc so this test could use those.
This test is for parent's parent commit which fix checkout billing address
edition.

Part of #34396
2019-07-01 10:05:30 +00:00
Jorge Pinna Puissant 47bbb504a8 [FIX] account_voucher: round globally
1. Set "Round Globally" on Invoicing settings;
2. Create a new vendors receipts and validate it;
There are an error messages that said : "Cannot create unbalanced
journal entry."

Fine turning of : 3e147220fd

opw-2026534
closes #32667

closes odoo/odoo#34415

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-06-27 11:35:03 +00:00
Jorge Pinna Puissant 7f57d3c5f2 [FIX] mail: allow more complex email layout
Add record to the email values to allow the use of more complex
email layout as : "mail.mail_notification_paynow"

opw-2025099

closes odoo/odoo#34375

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-06-27 08:15:51 +00:00
Martin Trigaux ead2d19e4a [I18N] crm_reveal: add module on Transifex
The terms were already exported but it was not in the configuration file
Courtesy of Erwin Van der Ploeg

closes odoo/odoo#34467

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-01 06:21:20 +00:00
Nicolas Martinelli 38eb5346c7 [FIX] purchase_stock: average cost
- Create 2 rates:
2019-05-01: 1.0
2019-06-01: 0.5
- Set-up a product A in AVCO
- Create a PO for A on 2019-05-15
- Receive the product after 2019-06-01

The AML are created with a rate of 0.5, but the product cost is updated
with the rate of 1.0.

This is because the stock move date is used when it is still assigned,
and not done yet. As described in:

https://github.com/odoo/odoo/blob/2f789b6863407e63f90b3a2d4cc3be09815f7002/addons/stock/models/stock_move.py#L36

The date is the scheduled date until the move is done, then it is the
date of the actual move processing.

We change the date to today's date, since it is the value used to update
the move date:

https://github.com/odoo/odoo/blob/2f789b6863407e63f90b3a2d4cc3be09815f7002/addons/stock/models/stock_move.py#L1143

opw-2006368

Note: the test has been slightly refactored to avoid an inconsistency
between `fields.Date.context_today` and `fields.Datetime.now`. Now, they
both return the same day. Moreover, the date is updated before each
action.

closes odoo/odoo#34444

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-28 19:15:48 +00:00
Odoo Translation Bot 2cc3ec0b8a [I18N] Update translation terms from Transifex 2019-06-30 01:17:50 +02:00
Julien Castiaux 1882c24195 [FIX] base: respect attachment search limit
Configure two companies, add a bunch of attachments to each company so
at least one has more attachments than the default 80 search limit. List
the attachments of that company, only the 7à-ish firsts are displayed
and the pager is disabled.

The `_search` method is override in `ir.attachment` to filter the
original record set. If the original record set had reached the limit,
the filter may only return a subset whose length is lower than the
limit, this trick the different JS views making them think there are no
more records to return and disable the pager.

The fix has been to recursively re-search until the subset length is
equal to the limit.

opw-2025940

closes #34287

closes odoo/odoo#34450

Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2019-06-28 14:36:18 +00:00
Jeremy Kerstenandqsm-odoo 0b8c430706 [FIX] website_slides: make url multi website compliant
Before this commit, all url of channel were using `web.base.url` instead of the
current website domain.

Fixes #32348

The override of `get_base_url` method should not be forward ported after
saas-12.4 as since saas-12.5 it is now a model method (f727cd2645).

closes odoo/odoo#34421

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>


Co-authored-by: qsm-odoo <qsm@odoo.com>
2019-06-28 14:36:02 +00:00
Antoine Prieels 2f789b6863 [FIX] hw_escpos: Avoid crashes on error
Two different problems on the box and resulted in the crash of the Odoo
instance running on the IoT Box:

When `usblp` had troubles communicating with a printer, a NoDeviceError
was raised. The `printer` variable was still set from the last time the
loop was processed, so we tried to close it, resulting in an error.

The code handling generic execptions was broken.

closes odoo/odoo#34437

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-06-28 09:11:30 +00:00
Joren Van Onder 40a3822a40 [FIX] pos_mercury: don't show amount due in payment method popup
This popup shows in the rare situation where somebody has 2 payment
methods that use Mercury. It allows them to choose which one to use
when swiping a card.

It would show the amount due in the title of the popup however this
isn't correct when a "pending swipe" payment line has been added.

Fix it by removing this amount, it's clear what will be paid from the
information on the payment screen. Also use this opportunity to make
it translatable.

opw-2006596

closes odoo/odoo#34398

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 21:58:12 +00:00
Romain Derie 6ebcb1db80 [IMP] tool, website, website_sale: move test utils functions
We have multiple ways of simulating a frontend context while running python
tests (mainly during TransactionCase):
  - `MockObject` class from 8557bcfa30
  - `simulate_frontend_context` method from a5a5a57e48
  - `DotDict` from f8efc9a957

This commit moves `MockObject` to misc to be reusable and adapt it to be
accessible by dot notation with `DotDict`.

Part of #34396
2019-06-26 17:08:09 +00:00
Romain Derie bb81e4ccd7 [FIX] website_sale: avoid adding website on customer when not needed
Before this commit, when an address would be edited or created from checkout,
we would always add a website_id on it.
(values_postprocess -> _checkout_form_save)

That would be incorrect if the website has not 'specific user account' enabled.

It would lead to an error as the user would not be able to connect to another
website. Indeed, the billing address is stored on the partner directly. Since
the res.user website_id is a related to the partner one, the user would then be
restricted to that website.

Closes #34396
Fixes #34308
2019-06-26 17:07:29 +00:00
Joren Van Onder 63f052a400 [FIX] pos_mercury: barcode scanner option should be activated
Card readers act as barcode scanners, they produce barcodes in a
certain format (see pos_mercury.barcode_rule_credit). Update the label
of the option to reflect this.

opw-2006596
2019-06-25 21:07:36 +00:00
Christophe Simonis 78b2063b29 [MERGE] forward port branch saas-12.2 up to 8747d72f1e 2019-06-21 15:16:54 +02:00
mgh-odoo 75fb46d848 [FIX] website_profile: use wysiwyg editor instead of textarea for biography
Currently, while editing user profile from frontend, biography is displayed in
textarea despite of being an HTML field.

This commit fixes the behavior by providing users with wysiwyg ediotr to
update their biography while editing profile from frondend.

task-2007731

closes odoo/odoo#34207

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-06-21 12:48:04 +00:00
Jeremy Kersten a5b1a288a6 [FIX] base_geolocalize: handle ZERO_RESULTS as google response
Before this commit, it was considered as an error because status was not OK

closes odoo/odoo#34377

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-26 10:00:59 +00:00
qsm-odoo 064eb0a4f4 [FIX] base: restore address display alignments
Commit https://github.com/odoo/odoo/commit/0c6e0d660ea00ad7ee9a3e94c0ac944cdf46565f
used flex to properly align address information and the fa icons. The
problem is that using flex prevents the parent div to ask for the
address information to be center/right aligned. This is the case for
the job pages in internal.

This commit uses display: inline-block on the top-level element of the
address to solve the problem.

opw-2000947

closes odoo/odoo#34371

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-26 09:00:17 +00:00
Jeremy Kersten 06e1220bbf [FIX] website_slides: display slide total time in minutes
And hide if no time set

task-fpreq

closes odoo/odoo#34346

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-24 11:57:46 +00:00