Commit Graph
126133 Commits
Author SHA1 Message Date
Adrian Torres f4b7dab00e [FIX] account, sale: create invoice lines in batch
This patch changes the create of `account.invoice.line` to use
`model_create_multi`, which allows the batch creation of multiple
invoice lines while only triggering the recompute of all related fields
once.

It also changes the generation of invoices from a SO to take advantage
of the create multi of `account.invoice.line`.

For a SO of 2000 lines:
    Pre-patch:
        ~417s to generate an Invoice
    Post-patch:
        ~30s to generate an Invoice

closes odoo/odoo#31975

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-03-20 14:34:17 +00:00
Nicolas Martinelli 7dfcea0655 [FIX] web: previous
Wrong label.

opw-1958313

closes odoo/odoo#32008

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-21 10:37:41 +00:00
Johan Demaret RivarolaandMarius Stedjan 36435b4ad7 [FIX] website_sale: fix authorized message
Field `auth_msg` never existed, this is an uncaught mistake. This commit
removes its usage and displays the fallback message to avoid runtime
error.

Closes #31903

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>


Co-authored-by: Marius Stedjan <marius@stedjan.com>
2019-03-18 09:58:45 +00:00
Christophe Simonis c6353942ff [MERGE] forward port branch saas-14 up to 5162ca7be7 2019-03-18 10:53:01 +01:00
Christophe Simonis 5162ca7be7 [MERGE] forward port branch 10.0 up to 36ba37a7a1 2019-03-18 10:20:06 +01:00
Xavier MorelandDaniel Reis 1f008a439a [FIX] stock: inefficient traceability domain
PR #31086 converted the not-downstream traceability domain to use a
filter instead as =/!= False on an o2m can lead to memory issues due
to the way they're currently implemented / transformed. This also
converts the downstream versiom just in case and to limit deviations
between the branches.

Co-Authored-By: Daniel Reis <dgreis@sapo.pt>

closes odoo/odoo#31901

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-03-18 08:53:21 +00:00
Odoo Translation Bot fd97b5b12a [I18N] Update translation terms from Transifex 2019-03-17 06:01:58 +01:00
William Henrotin 150d7730f8 [FIX] delivery: free_over management
The commit 9a9cb9e refactored the way delivery carrier price
are added on sale orders. The management of free delivery price
was not taken into account past then.
This commit put the free price message directly on the sale order line
and on the wizard. The carrier price is showed on the wizard but is 0 on
the SO.

Task : 1943480

closes odoo/odoo#31315

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-03-15 14:21:56 +00:00
qsm-odoo 0c6e0d660e [FIX] website_event, *: review some design
* base

With https://github.com/odoo/odoo/pull/30559, the event pages were
a bit redesigned (even though the original goal of the task was to
focus on the mobile registration). This commit reviews part of the
redesign (titles too big, misalignment, ...).

closes odoo/odoo#31914

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-18 12:28:20 +00:00
Robot Odoo b07dfedbd3 [FIX] lunch: make it work on mobile
This module didn't worked on mobile: user cannot select the products or
see their cart.

This commit reworks the LunchKanbanWidget template and introduces a
dedicated template for mobile. This template introduces a button at the
bottom of the screen to toggle the "cart" widget on mobile (hiding it by
default).

It tries to make the best use of the existing Bootstrap classes allowing
to have a more responsive layout and reducing the custom CSS required by
this module (both in desktop and in mobile).

This commit adds a decent JS tests-suite (mobile & desktop) to this
module as the existing one left substential parts of the UI untested
(opening wizard when clicking on a kanban record, cart's lines content,
clear cart button, widget structure and content based on the state...).
Those tests are also less based on DOM nodes order/tag names and use
instead dedicated classnames.

It also modifies the LunchKanbanRecord click handling to had a dedicated
event handler instead of overriding the default _onGlobalClick() and
make it more testable.

Finally this commit also remove unused code.

Task ID: 1945032

closes odoo/odoo#31428

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-19 12:11:28 +01:00
Pierre Paridans bdc0b4b892 [FIX] lunch: make it work on mobile
This module didn't worked on mobile: user cannot select the products or
see their cart.

This commit reworks the LunchKanbanWidget template and introduces a
dedicated template for mobile. This template introduces a button at the
bottom of the screen to toggle the "cart" widget on mobile (hiding it by
default).

It tries to make the best use of the existing Bootstrap classes allowing
to have a more responsive layout and reducing the custom CSS required by
this module (both in desktop and in mobile).

This commit adds a decent JS tests-suite (mobile & desktop) to this
module as the existing one left substential parts of the UI untested
(opening wizard when clicking on a kanban record, cart's lines content,
clear cart button, widget structure and content based on the state...).
Those tests are also less based on DOM nodes order/tag names and use
instead dedicated classnames.

It also modifies the LunchKanbanRecord click handling to had a dedicated
event handler instead of overriding the default _onGlobalClick() and
make it more testable.

Task ID: 1945032
2019-03-19 09:26:08 +00:00
Robot Odoo 7e35c40c5a [MERGE][IMP] website_slides_survey: handle certification re-enroll/purchase flow
Task #1945036

Purpose
======

If the user fails his last attempt at a course certification, we remove him from
the members of the course (and he has to enroll again).
He receives an email in the process notifying him of his failure and suggesting
he enrolls to the course again.

The purpose is to have a 'certification flow' where the user can re-purchase the
certification when they have failed it.

This could lead to some issues if the course containing the certification also has
other slides with content because the user will not have access to them after failing.
This also prevents configuring courses with multiple certifications since the membership
will be removed at the first failure.

These use cases are considered "non standard" by the business and are thus not handled
in the code. We assume that users will configure their courses "correctly".

closes odoo/odoo#31484

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-19 10:11:09 +01:00
Aurélien Warnon 199ecdd30f [IMP] website_slides_survey: handle certification re-enroll/purchase flow
Task #1945036

Purpose
=======

If the user fails his last attempt at a course certification, we remove him from
the members of the course (and he has to enroll again).
He receives an email in the process notifying him of his failure and suggesting
he enrolls to the course again.

The purpose is to have a 'certification flow' where the user can re-purchase the
certification when they have failed it.

This could lead to some issues if the course containing the certification also has
other slides with content because the user will not have access to them after failing.
This also prevents configuring courses with multiple certifications since the membership
will be removed at the first failure.

These use cases are considered "non standard" by the business and are thus not handled
in the code. We assume that users will configure their courses "correctly".
2019-03-18 14:46:32 +00:00
Aurélien Warnon 3f6d09037d [FIX] product: make product_template_attribute_value tree not editable
Purpose
=======
The product.template.attribute.values can't be edited in an inline tree view
because we need to be able to define exclusions for them in the form view.

closes odoo/odoo#31601

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-18 13:41:34 +00:00
Aurélien Warnon 99bae2cdb7 [FIX] product: fix _name_search to include dynamic product variants
Targets commit d3530eb07e

Purpose
=======
- The _name_search of product.template fallbacks by default on product.product
  In case there are no product.products yet (dynamic product variants configuration), we need to
  include the base product.template _name_search in the results
2019-03-18 13:41:33 +00:00
Pierre Paridans ec88b4e1a2 [FIX] hr_recruitment: scope kanban record's width
Module's css rules shouldn't override globally the one from 'web'.

closes odoo/odoo#31538

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-18 13:51:33 +00:00
Antoine Guenet becfef8f7b [FIX] web_editor: properly start website edit mode as restricted editor
It was impossible to open the website's edit mode as a user with
"restricted editor" permissions. The reason was that wysiwyg_multizone
was trying to manipulate data that is not injected into the html node
when `editable` is false (see `website.layout` template).

closes odoo/odoo#31702

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-03-18 09:32:14 +00:00
Pierre Paridans 6506cfd775 [FIX] lunch: remove unused code 2019-03-18 08:36:42 +00:00
Aurélien Warnon 2fb9fe279a [FIX] survey: prevent certification email from being sent twice
Purpose
=======

The certification email template had both "email_to" and "partner_to" fields set
and that implied the mail being sent twice.

This commit removes the "partner_to" field to fix it.
2019-03-18 08:03:46 +00:00
Denis Vermylen 744bdd275e [FIX] server.py: stop the FSWatcher when stopping the server
Avoid potential tracebacks from the FSWatcher's thread being killed.

Drawback: Server shut down can have an extra small delay

(only applies when the --dev=reload option is given)

closes odoo/odoo#31855

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-15 14:18:11 +00:00
Denis Vermylen 7b6cfc412e [IMP] server.py: --dev=reload with inotify
Add the alternative of inotify instead of watchdog to watch the addons
paths the server was started with.

Reason: watchdog spawns 2 threads per path to watch. When there are a
lot of addons paths, this can become too costly. With inotify we watch
all the repositories in a single thread.

https://github.com/dsoprea/PyInotify

installation:

    pip install inotify
2019-03-15 14:18:09 +00:00
qsm-odoo 2a39ab0579 [FIX] web_editor: handle snippet option submenus of submenus
Commit https://github.com/odoo/odoo/commit/8ca92330b367d54fddf1c02089ee9d0bc3edbfdc
did not think about submenus inside submenus, which is the case in the
website animate option. This made snippets potentially have multiple
animations on them, with undesired behaviors.

This commit also accordingly reviews the _setActive method for the
select-class option and also adapts following the recent forward-port of
https://github.com/odoo/odoo/pull/31440

Related to task-1929133

closes odoo/odoo#31477

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-15 13:58:50 +00:00
Nicolas Martinelli 36ba37a7a1 [FIX] base: default rate
We set the default rate to be 1.0 instead of 0.0, since a rate of 0.0
doesn't make sense.

Partial backport of 298491597c

opw-1949866

closes odoo/odoo#31866

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-15 09:58:51 +00:00
Swapnesh Shah 0719559904 [FIX]website: Themes should be installed from website_theme_install only
closes odoo/odoo#31854

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-03-14 17:04:04 +00:00
Christophe Simonis 15a78da0c9 [FIX] account: avoid using non existant field in test
Oversight of previous forward-port.
2019-03-19 10:36:17 +01:00
Christophe Simonis bd63913326 [MERGE] forward port branch saas-11.3 up to 4e39328a76 2019-03-18 20:03:24 +01:00
Toufik Ben Jaa ec327d3f86 [FIX] project: Access to attachments with CDN
- The attachments in the tasks page on the portal can be accessed by
  clicking on them.
  They are delivered by the controllers at URL `/web/content/XXXXX`.

  By default when enabling the Content Delivery Network feature on the
  website module, the content delivered by the controller
  `/web/content/` is done through the CDN which has no user account,
  thus may not have access to the attachment.

  To fix the issue, we disable the CDN feature for the attachments in
  the tasks portal page.

  OPW-194571

closes odoo/odoo#31924

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-03-18 15:33:14 +00:00
Nans Lefebvre eee6e26b37 [FIX] mail_enterprise: display all attachements in preview widget
If res_id is not defined, this method used to crash.
Made obvious by commit a26496b6e7,
which added a call to that function in the main controller of web.

opw 1950403

closes odoo/odoo#31923

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-18 15:27:20 +00:00
Christophe Simonis ff1bca32f3 [MERGE] forward port branch 12.0 up to a26496b6e7 2019-03-14 17:43:32 +01:00
Denis Vermylen 83b2d2e1b5 [FIX] server.py: don't start multiple FSWatcher in multiworker mode
Before this commit every worker would start his own FSWatcher.
2019-03-14 14:37:57 +00:00
Lucas Perais (lpe) 04f7c650d0 [FIX] l10n_fr_fec: float representation when summing
Before this commit, it may happen that the the grouped account move lines
sum will be business-wise "zero" but that its representation in SQL will not be
rather, it will be equal to "10^[-high number]"

After this commit, we round the sum to the number of digits of the company's currency
to see if it is equal to zero, or not.

We also need to filter out the specific case of unaffected earnings

OPW 1942177

closes odoo/odoo#31755

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-14 13:14:07 +00:00
Jorge Pinna Puissant 1ceb689805 [FIX] account: missing partner bank account in vendor credit note
Have a partner (vendor) with a bank account.
Create a Vendor Bills. Change the form view of the vendors bills to
display the field partner_bank_id ('Bank account').
The field shows correctly the bank account of the vendor.

Before this commit, when creating a Credit Note, the field
partner_bank_id is empty.

Now, the field parnet_bank_id is the one of the Company.

opw-1903143

closes odoo/odoo#31554

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-18 08:47:57 +00:00
Nicolas Martinelli a03bd36ec8 [FIX] point_of_sale: picking on move line
- Activate Lots and S/N
- Track a product A by unique S/N
- Receive one unit of A
- Sell the unit of A through the POS
- Go to Invnetory > Products > Lots/Serial Numbers, and open the
  Upstream Traceability report

The line corresponding to the outgoing move line is not linked to the
corresponding picking.

The field `picking_id` is empty on the `stock.move.line`, so the link is
not directly retrieved.

Related to #31879 which fixes the issue for existing `stock.move.line`.
opw-1939413

closes odoo/odoo#31880

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-15 13:21:25 +00:00
Nicolas Martinelli e7c92352be [FIX] stock: picking of move line
- Activate Lots and S/N
- Track a product A by unique S/N
- Receive one unit of A
- Sell the unit of A through the POS
- Go to Inventory > Products > Lots/Serial Numbers, and open the
  Upstream Traceability report

The line corresponding to the outgoing move line is not linked to the
corresponding picking.

The field `picking_id` is empty on the `stock.move.line`, so the link is
not directly retrieved.

Even if the POS should set the `picking_id` field, the traceability
report should fallback on the picking of the move.

opw-1939413

closes odoo/odoo#31879

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-03-15 13:03:36 +00:00
Odoo Translation Bot 6b4a35facd [I18N] Update translation terms from Transifex 2019-03-17 03:13:11 +01:00
Cedric Snauwaert 1834b80bfa [FIX] account: error in concurrent update while reconciling
In reconciliation widget, when clicking reconcile with some existing line. if by any chance the transaction gets rolled back because of a concurrent update, the next replay attempt will use the modified parameters, and we will get a KeyError. Retrying the operation will succeed as soon as no other transaction conflicts again.
Altering mutable RPC parameters is a bit risky in a public RPC method, particularly when those altered parameters will modify the effect of the method. Making a deepcopy of the parameters before using them is an easy workaround. The framework does not do it by default because of the hard-to-foresee memory overhead it would have.

fixes #25403

closes odoo/odoo#31882

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-03-15 13:01:03 +00:00
Antoine Prieels f3ea68c909 [FIX] point_of_sale: Remove padding from customer display
closes odoo/odoo#31869

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-03-15 09:35:38 +00:00
Nans Lefebvre a26496b6e7 [FIX] mail: set message_main_attachment_id when the attachment is added via widget
Create a record.
Add an attachment, using the widget (aptly named 'add an attachment').
It is not set as message_main_attachment_id.
If you add the message through 'log note', then it is.

We add a hook to make sure that it is set as message_main_attachment_id
when added through the widget.

opw 1950403

closes odoo/odoo#31847

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-14 12:50:51 +00:00
Denis Vermylen a1fa9faa31 [FIX] server.py: FileNotFoundError doesn't exist in P2
Python2 uses IOError instead.

/!\ DO NOT FORWARD PORT AFTER 11.* /!\
2019-03-14 10:06:04 +00:00
Nans Lefebvre c68a97a255 [FIX] mail: set message_main_attachment_id to copy=False
Create a record.
Add an attachment set as message_main_attachment_id (e.g. through log note).
Duplicate that record.
The new record has the message_main_attachment_id of the old record,
while it has no attachments.

Since attachments security is linked to the record id, we shall not copy them.

opw 1950403

closes odoo/odoo#31846

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-14 09:40:11 +00:00
Christophe Simonis ac4ef455c4 [FIX] web: correct view definition in new test 2019-03-14 15:01:09 +01:00
Christophe Simonis 9a4e84ae66 [MERGE] forward port branch saas-11.3 up to f5ab04ce50 2019-03-14 14:13:47 +01:00
Nathan de Pryck 5625257991 [FIX] mrp: display quantities with UoM precision in wizard
Before this commit, the fields qty_reserved and
qty_done were displayed in the wizard with a
precision of two digits (for each case).

The problem is that the qty_to consume uses the
precision accuracy defined in 'Product Unit of Measure'.
It resulted that a quantity of 0.002 to consume
was translated to a qty_done of 0.0.

See opw-1949198

closes odoo/odoo#31822

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-03-14 09:40:38 +00:00
Arnold Moyaux 7e96d485c7 [FIX] stock: redundant move line on _set_quantity_done
Usecase to repdoduce:
BOM 1 final product F - 2 components C
- Create a MO of 2 units F
- Do not reserve
- Produce 1 units twice

You have 1 finished line with 0 quantity and another with 2 quantity.

It happens because _set_quantity_done expect reservation on
move line. It checks the reservation - quantity done on a move line
as quantity to add. Since you have no reservation in will result as
- quantity done and it will remove the quantity done on existing line.
Then it removes the quantity done added on move line on the total
quantity to add passed as an argument. It results as
qty_to_consume -(-move line quanity done). At the end of the method it
creates a new move line with the remaining quantity to consume (on which
was added the quantity done of not reserved move line).

Skip the move line update if the quantity reserved - quantity done is
negative.

closes odoo/odoo#31805

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-03-14 09:25:28 +00:00
Arnold Moyaux 20c6a65ce3 [FIX] mrp: produce too much
Usecase:
- Produce 1 product not tracked
- Produce 1 product not tracked
The total number of finished product is 3

It happens because _set_quantity_done will
add the quantity and not set it to the quantity
passed as argument. In produce wizard it pass
as argument the quantity of move line + the produced
quantity. It will result as twice the quantity of the
move line + the quantity producing
2019-03-14 09:25:28 +00:00
Arnold Moyaux c2f6e59811 [FIX] mrp: produce wizard negative reserved qty
Usecase to reproduce:
BOM 1 product final F -> 2 components C
- 1 units of C in stock
- MO of 2 units of F
- Reserve MO
- Produce wizard 2 units of F -> C 4 to consume 1 reserved
- Update quantity to 1

-> The produce line for C contains -1 reserved

It happens because the system remove the quantity to consume on
the reservation. However sometimes the quantity reserved is lower
than the quantity to consume and it will result in a negative quantity
reserved.
2019-03-14 09:25:28 +00:00
Arnold Moyaux 4ed25f56a2 [FIX] mrp: remove unreserved line first
Since the quantity producing could change on the produce
wizard. The first quantity to remove is the quantity not
reserved on the MO.
2019-03-14 09:25:28 +00:00
Arnold Moyaux ce355c9786 [FIX] mrp: wrong reserved quantity in produce wizard
Issue 1:
Usecase to reproduce:
BOM: 1 prod final F -> 2 unit of components C
- Create a MO of 2 units
- Reserve 4 units of C
- Produce 1 unit of F (produce wizard)
- Save
- Produce 1 unit of F
- Update quantity to 2
The reserved quantity in the wizard is 4 although there is 2 units
already done on the first operation. So it should remain 2.

It happens because the produce wizard did not take into account the
2 units already done on the first stock move line.

This commit fix by using ml.product_qty - ml.qty_done each time it's
needed.

Issue 2:
Usecase to reproduce:
SAME BOM
- Create a MO of 2 units
- Reserve
- update quantity to 3
- It creates a new line with to consume 2, reserved 0
- update quantity to 4
- It update the line 2 0 to  4 to consume 4 reserved
So we ended with 8 units of C reserved.

It happens because the system match the workorder line with the stock
move line one by one without a global view on what is reserved or not.
So the second workorder line found a move line with 4 reserved but 0
done and did not check the first workorder line that already use the
4 pieces reserved. So it considers it as available and take the
reservation a second time.

It's fixed by an iteration over workorder line instead of move line
and keep the used reserved quantity in a dict by lot.

Issue 3:
Usecase to reproduce:
SAME BOM
- Create a MO of 2
- Produce 2
- Update quantity to 3
New line with to consume 2 reserved 0
- Update quantity to 4
New line with to consume 2 reserved 0
It's bad since we would like a line 4 0 as in saas-12.1

It happens because _update_workorder_lines will always create a new
line with remaining quantity if it could'nt find one with reservation
to update. However the line could exist without reservation so it
should update it instead of creating a new one.

It's fixed by adding the remaining quantity in the first workorder line
without lot (if the tracking is serial it should continue to create a
new line).
2019-03-14 09:25:28 +00:00
Arnold Moyaux b0a6853020 [FIX] mrp: create extra move with the quant location
When the user consumed more raw materials than reserved. The system
was supposed to take the extra quantities from existing stock and so
their location. However the reserved quantity is always lower or equals
than the quant quantity. reserved - quantity is always negative or equal
0 and the float compare after will always return true and the code will
never be executed and will return the move location.
2019-03-14 09:25:28 +00:00
qmo-odoo add45ee470 [FIX] website_slides_survey: go to survey if only one slide certification
Purpose of this commit:
  In case there is only one slide in the course and that unique slide
  is of type certification, clicking on the link redirects the user
  to the survey page instead of the fullscreen view

Task-1946511

closes odoo/odoo#31843

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-03-15 20:38:58 +00:00