Commit Graph
139008 Commits
Author SHA1 Message Date
Joseph Caburnay bb565bcd0e [FIX] point_of_sale: add product on single search result
In this commit, we restore the following behavior from v13: when search
resulted to a single product and 'Enter' key is pressed, the product is
added to the order and the search field is cleared. This works for both
manual keyboard input and barcode input.

closes odoo/odoo#59770

X-original-commit: 225e3898f25ddac061be99c43501c99d4bd3226b
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-10-12 15:02:12 +00:00
wan a942e7561f [FIX] account: bill default invoice date context dependent
The date depends on the user's locale, and needs to be consistent with
the `date` field.

closes odoo/odoo#59580

X-original-commit: ed06aab626cb51b86b4178705b45bbcbfbf2c0f2
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-09 09:03:19 +00:00
IEL d07f540e30 [FIX] hr_expense: correct check for bank settings
TLDR: fix a mess in journal fields check

Steps:

* Create expense "paid by Company"
* Click Post

Before:

* AttributeError: 'account.journal' object has no attribute
'default_credit_account_id'

After:

* Either posted or shows user error about journal misconfiguration

Notes:

* Field ``default_credit_account_id`` is replaced in https://github.com/odoo/odoo/commit/41f119d5325dfbbf916d1d34e63946646ed4d44c
* The error is introduced during incorrect forward-port #58852

---

task-2355177

closes odoo/odoo#59780

X-original-commit: 5c0fca662279702115b5e61c8227f82086693e38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-10-12 15:20:23 +00:00
Laurent Stukkens (LTU) 0ef25d19bc [FIX] website,website_sale: HTML escape dynamic snippet
Issue
    To do on Community:
    - Install website_sale (eCommerce)
    - Go into Website app
    - Navigate through Product/Products
    - Edit 'Customizable Desk (CONFIG)' and add '&' and/or '<' and/or '>'
      characters into the name
    - Save
    - Go to the Website app Dashboard and click on 'Go to Website'
    - Click on 'Edit' button
    - Drag and drop the 'Dynamic Product' snippet into the website
    - Click on the block 'Your Dynamic Snippet wil be ...'
    - In the right panel, in the 'Dynamic Product' snippet options,
      chose a 'Template' and a 'Product Category'

    A traceback is shown

Cause
    the '&' character crashes lxml.etree.fromstring

Solution
    ensure no '&' is sent to lxmx.etree.fromstring by using
    odoo.tools.html_escape (in order to ensure no other problematic
    characters are sent to the front) on the field values except when
    not applicable (widget rendering with record_to_html should not be
    escaped).
    It is important to note here that this is applicable
    to action servers that are used by the dynamic filter.

opw-2357027

closes odoo/odoo#59805

X-original-commit: f91422115c09be484f2868347566b6392ed0effd
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-10-12 17:45:45 +00:00
David Beguin 26f4fc093c [FIX] survey: let Chart.js handle the session graph max height automatically
Before this commit, the graph y scale in the survey manager screen was based on
the attendees count. But is some attendees do not answer the question, the bars
never reach the maximum height of the graph, and bars can stay really small.

Example: 10 attendees - 4 answers - A: 1 / B: 1 / C: 2

10 |
   |
   |
   |       |
0  |_|__|__|_
     A  B  C

After this commit, the max height of the graph is not set on the graph. So the
chart lib will handle itself the height and will adapt automatically the bars
height in function of the data given to the graph. Bars will always take full
height space, relatively to the count of the most voted answer.

Example: 10 attendees - 4 answers - A: 1 / B: 1 / C: 2

2  |       |
   |       |
   | |  |  |
0  |_|__|__|_
     A  B  C

Task ID: 2351455

closes odoo/odoo#59777

X-original-commit: ac64af033f0bbaa698aee424a5cab85fd9b967d2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-12 15:18:48 +00:00
Jérémy Hennecart b6f6a0dacd [FIX] web: fix notification design
Fix the design of he notification which is sometimes broken
(if there are lists or buttons display in it for example)

task-2346462

closes odoo/odoo#59776

X-original-commit: 238654ae53582d791154388c827f725c8d136612
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-12 15:18:22 +00:00
Raphael Collet f243b71dcb [FIX] core: optimize first snaphot in onchange
This patch speeds up the performance of method `onchange`.  Our use-case
is an invoice with 300 lines, where we modify the unit price or quantity
on several lines.  Each modification triggers a call to `onchange` on
the invoice itself.  The latter call went from 1.3 to 0.8 seconds, which
represents a speedup of 30% to 40%.

In the implementation of `onchange`, the first snapshot is preceded by a
"prefetching" phase, where the lines of x2many fields are read, so that
the fields of unmodified lines are in cache.  This is useful because the
fields of those lines are not sent by the client, which only sends ids.
This prefetching represents more than 40% of the duration of `onchange`,
in our use-case.

The prefetching is inefficient for several reasons.  First, it uses
`mapped`, which formats data that is actually never used.  Second, it
accesses new records that have the actual lines as origin.  And on those
records, computed stored fields are not taken from the origin record,
but are (uselessly) computed instead.

We have optimized the prefetching in the following way.  It now reads
stored fields on the actual lines (using `_read` to avoid formatting),
then copies the cache of those fields on the corresponding new lines (to
avoid useless computations).  This makes the prefetching about 10 times
faster!

closes odoo/odoo#59781

X-original-commit: ec50c426d7c2a17c7b72e64adab65eda6328e163
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-10-12 15:20:47 +00:00
Samuel Degueldre 2fbb4cc9f2 [FIX] web_editor: fix background-images not being auto-optimized on drop
Previously, background-images were not properly optimized when inserted,
whereas they should be just like regular images. This commit fixes that.
It also changes the default quality (used for automatic optimization) to
75 as the difference is not usually very noticeable but can bring a big
decrease in image size.

task-2357332

closes odoo/odoo#59779

X-original-commit: 5d8c0aa0f7678f51e0a0931b0410a0273c7c7d1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-12 15:19:39 +00:00
Antoine Prieels b86ef518f0 [FIX] payment_odoo_by_adyen: Disable test mode
No test mode is available for Odoo Payments

closes odoo/odoo#59778

X-original-commit: 118e52b748a9e0faec45be0ddf1a9e4a94a3f37c
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-10-12 15:19:12 +00:00
Antoine Prieels f52c9fa1c0 [FIX] adyen_platforms: Sync KYC status on update
The response we get after updating data contains the new KYC status,
we then update it on the adyen account so that we don't have to wait
for the cron.

X-original-commit: 59fdb24527e6073cb3c4de5662d25d4d0cea08eb
2020-10-12 15:19:12 +00:00
xO-Tx b8ed38d816 [FIX] web_editor: fix background-sizing preview
with background-sizing option, user drags background image to adjust its
position using an overlay with the same content from snippet (cloned element).

Some CSS child selector rules will not be applied since the clone element has
a different container from the snippet content.

The CSS "background-attachment" property should be the same in
both parallax snippet & its copy, this will keep the preview more "wysiwyg"
instead of getting different result when bg position saved.

This can be improved by copying all style from snippet content and
override it with overlay related style (copying all css into overlay will
not work since it will change the style of its content too)

task-2327025

closes odoo/odoo#59775

X-original-commit: aaa3e63985789ea07464a5957eb18481e70a383f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-12 15:14:37 +00:00
Swapnesh Shah 6ba24a4137 [FIX] sale_stock: inventory widget visibility
Before this commit there would be crash on Removing `Unit` field from Sale order lines list view due to missing `product_uom`, Which is necessary for `QtyAtDateWidget` widget.

Now we hide the Widget if `product_uom` is not selected.

Fixes #59492

closes odoo/odoo#59724

X-original-commit: ea798c07d31fd186af4bf851966f791a96cb13fd
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-10-12 09:29:09 +00:00
Siddarth Gajjar 0fa5fe59a2 [FIX] website_slides: fix concurrency traceback
- Prior to this commit, slide content of type document or presentation is
  having src as '/slides/embed' and that controller tries to set slide as
  viewed. Along with this, for few slide types (including document and
  presentation) and for logged in user, it will try to set slide as completed
  once slide rendering is done with help of method `_setCompleted`, without
  waiting for the iframe to be loaded. This means, the controller called from
  the src of iFrame and the above method both tries to update same 'slide_slide'
  table at the same time, resulting into concurrency error.

- This commit fixes the issue by marking the slide as completed (with help
  of method `_setCompleted`) only after the iFrame is loaded, avoiding the
  concurrent updation of 'slide.slide' table.

TaskID 2265863
Closes https://github.com/odoo/odoo/pull/52918

closes odoo/odoo#59391

X-original-commit: c5f406c8cbf43c56939cee054f9b911fe3933b3b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-12 11:25:22 +00:00
Thanh Dodeur a4975d8a4a [IMP] website: improves the menu edition
This commit allows user to edit other menus by clicking on them
the same way the global menu is edited.

task-2272226

closes odoo/odoo#55881

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-08 09:14:24 +00:00
Thanh Dodeur d339342bed [IMP] website: adds video suggestions
This commit adds video suggestions to the media dialog

task-2308019

closes odoo/odoo#55293

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-09 12:11:14 +00:00
808343dab9 [REF] *: owl graph renderer
The main purpose of this PR is to convert the GraphRenderer widget into an OWL component.

Along the main changes brought to the module "web", some other changes have been brought:
- the modules "board" and "stock" have been adapted accordingly;
- the function "utils.sortBy" has been given an extra optional parameter "order" (with value 'asc' or 'desc');
- a helper "owlCompatibilityExtraNextTick" has been added. It has the same effect as the "nextTick" helper but should
  be used in a specific situation (see the corresponding documentation for more information).

Task ID: 2090967

closes odoo/odoo#54009

Related: odoo/enterprise#12710
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Florimond Husquinet <fhu@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-10-12 15:52:01 +02:00
Benjamin Frantzen (bfr) 25023e59e2 [FIX]account_edi: set PdfFileReader to strict=False
Determines whether user should be warned of all problems and also causes some correctable problems to be fatal. Since we just want the widest compatibility when reading PDF, strict=False seems acceptable.

TASK ID: 2358822

closes odoo/odoo#59736

X-original-commit: 9fb637577e0c13778e253b4f1329f59459ab0824
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2020-10-12 11:04:33 +00:00
Sébastien Theys 5af18fbd9e [FIX] mail: ensure discuss composer at the bottom if no message list
task-2358093

closes odoo/odoo#59735

X-original-commit: 07159984999b14d1566706a62d54594753ad9f93
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-12 11:04:07 +00:00
Jorge Pinna Puissant 811444829f [FIX] project: access token on task
- Create a new Project with 'Portal user and all employees' as
  visibility;
- Add a portal user as customer;
- Create a new task in the Project, without assigning the task to
  anybody;
- Connect to the portal as the portal user;
- Send a message on the task.

Before this commit, an Error 403 forbidden was raised, this error occurs
because the task don't have an access token created, this token will be
created when an internal user send a message on the task.

Now, the access token is created if the project has a 'Portal user and
all employees' visibility, and the portal user can post a message on
the task.

opw-2345070

closes odoo/odoo#59733

X-original-commit: 64e93794efb4193b3dfa7aa43360a1ef274e623d
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-10-12 11:00:37 +00:00
yhu-odoo 6424025b65 [FIX] purchase: don't send preview email when PO not saved
When PO not saved, no mail can be send. Sending a reminder preview will
get traceback. In this commit, we check if the PO is saved before
sending the mail.

Also clean some useless code in the send_reminder_preview() and fix the
issue when no json object is return to the widget because of on mail
send.

Task 2339431
PR #57961

closes odoo/odoo#59399

X-original-commit: 83f2cac4b8ba101d6a7736a8ff408a3fdb5422fe
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2020-10-12 09:48:24 +00:00
Rémy Voet (ryv) 89a597761f [FIX] purchase: fix state of extra product
As explained in issues-59664, the commit
f18bdc4fcf2b6b0bdb7699c3b2aa38d332301a84 add
readonly attribute in the `purchase.order.line` state field
to avoid to save bad `state` in the server (then the state of the
PO line != PO line).
But it breaks the feature to add product
when the PO is already confirm (the state will be 'purchase' and the
`product_id` is readonly when state == 'purchase').

To fix both issues, add a `default_state` in the context.
It will "bypass" the attrs of `product_id` and the state of PO
('draft') line won't be save because it is readonly.

resolve #59664

closes odoo/odoo#59729

X-original-commit: 74780e95a2a3db9d9875aea7e644bf064ecf6b46
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2020-10-12 10:16:04 +00:00
Pierre Paridans a84e37bb8a [FIX] mail: plain-text messages word-wrap in Discuss UI
When a user sends a plaintext email to a mail-enabled channel, the
rendering of this message in Discuss have present a horizontal scroll
when the text contains long sentences.

This commit fixes it by enabling wrapping of the line's word to fit its
container size and prevent horizontal scrolling.

Note: the required CSS rules were already present since odoo/odoo@0e7e18ff71
but a wrapper element (with the class `.o_thread_message_content`) was
introduced in odoo/odoo@4685e4bc7f and
merged between the testing of the fix above and its actual merging in the
Odoo codebase, making it ineffective. We only have to properly re-enable
it.

opw-2341485

Related task ID: 34931

closes odoo/odoo#59719

X-original-commit: 5e66ca8d2c970eed999782bdd59e9082f3967833
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-10-12 08:42:49 +00:00
Joseph Caburnay ae83889da4 [FIX] point_of_sale: pos User can't close a session
Starting this commit: 8f57863707
regular pos User now don't have a read access to ir.property model.
Because of this, if a user opens a session, he won't be able to close
it. We sudo the search to stock.move (because the query parameters
requires reading from ir.property) to make sure that closing a session
will succeed.

closes odoo/odoo#59712

X-original-commit: 5e2763fdc94b63eee637f9679f8ea3a07beb74ce
Related: odoo/enterprise#13981
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-10-12 07:55:15 +00:00
Joseph Caburnay be9c8fa303 [FIX] pos_restaurant: table and guests in the receipt
X-original-commit: b87e210d87e71e40d88b0d9f4ca824651651bd8b
2020-10-12 07:55:15 +00:00
Luis González 6430ca499f [FIX] tools/safe_eval: Add missing builtin sorted
Before this commit, the function `sorted` wasn't available on
`safe_eval`, even though it's a Python built-in, which mades it
unavailable for Python-code evaluation, e.g. server actions.

After this commit, the above function is now accessible.

closes odoo/odoo#59715

X-original-commit: a725c8927963848c3f8ada3b71897a54b740cce6
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-10-12 08:12:19 +00:00
Julien Mougenot db41d41739 [REF] board,stock: adaptation to graph Owl
To reflect the changes on the graph renderer, some class names have been
adapted and the graph views in stock reports are now properly
instantiated.
2020-10-12 07:43:43 +00:00
db39211b46 [REF] web: owl graph renderer
We convert the GraphRenderer widget to an OWL component.

Task ID: 2090967

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Florimond Husquinet <fhu@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-10-12 07:43:43 +00:00
Julien Mougenot 3041d81135 [IMP] web: Allow asc/desc order in utils.sortBy
A string parameter 'order' has been added to the "sortBy" function of
the utils module to decide in which order the array should be sorted.
The default is 'asc'.
2020-10-12 07:43:43 +00:00
Mathieu Duckerts-Antoine 12ae5ef8e3 [IMP] web: owlCompatibilityExtraNextTick
Introduced a function that awaits for an additionnal rendering frame
initiated by the Owl compatibility layer processing.

By default a simple "nextTick" will handle the rendering of any widget/
component stuctures having at most 1 switch between the type of
entities (Component > Widget or Widget > Component). However more time
must be spent rendering in case we have additionnal switches. In such
cases this function must be used (1 call for each additionnal switch)
since it will be removed along with the compatiblity layer once the
framework has been entirely converted, and using this helper will make
it easier to wipe it from the code base.
2020-10-12 07:43:43 +00:00
Xavier Dubuc ec3f5cdaf8 [FIX] mail: ask for confirmation before attachment deletion
also hide all messages with empty body and no attachments

task-2282322

closes odoo/odoo#59675

X-original-commit: 60ae42dcda777cd66e4e421dbc02f9ef12a430ef
Related: odoo/enterprise#13974
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-10-09 17:28:17 +00:00
Paul Morelle 30036759e8 [FIX] hr_holidays: add explicit domain on action
In odoo/odoo@d2238de576 the domain of the
action hr_holidays.hr_leave_action_action_approve_department has been
removed, as the addon was reworked and no domain is needed any more.

However, during a migration from a previous version, the older domain is
not overwritten with an empty value.

With this commit, the domain is set to an empty one, which allows the
migration to correctly update the record.

closes odoo/odoo#59673

X-original-commit: 76c2f412c09ef1169b5cf936f0770cd4200f29e2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-09 16:55:16 +00:00
David Beguin 4c9e39cfbd [FIX] website: get visitor tz directly from cookie
Since tz is now (from 6eb4762fee) added to the client cookie,
visitor timezone can directly be set when creating the visitor, using the
request.

Jstz can be removed as even for module in ENT that used this lib,
we can get the timezone using Intl lib instead.

This will also reduce the number of request made only to get visitor's
timezone.

This commit reverts part of 17e8402523
Linked ENT PR: 12963

Task ID: 2333825

closes odoo/odoo#59501

X-original-commit: 3d9a2de3575777c87327691319d89f9de6b8eada
Related: odoo/enterprise#13918
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-08 11:45:39 +00:00
Andrea Grazioso (agr-odoo) b439ee1022 [FIX] stock_landed_costs: fix account for non-anglosaxon accounting companies
Steps to reproduce:
1. Activate landed costs
2. Create a product that in the purchase tab has active 'Is a landed
cost'
3. Add this product to a purchase order
4. Confirm the PO, create the bill and create landed costs entry

Since they don't use anglosaxon accounting they expect the
invoice line account to be used for the landed cost. It will come in
empty as it is looking at the stock input account.

opw-2332763

closes odoo/odoo#59626

X-original-commit: f500bec7c1a2de799c0d4deb9b7ee43a69b3b46a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-10-09 11:56:03 +00:00
Andrea Grazioso (agr-odoo) 1126e6614b [FIX] stock_landed_costs: propagate landed costs line from po to bill
Steps to reproduce:
1. Activate landed costs
2. Create a product that in the purchase tab has active 'Is a landed
cost'
3. Add this product to a purchase order
4. Confirm the PO and create the bill

is Landed costs checkbox is not enabled when this product is
being invoiced. Any time you add this product to an invoice manually it
will have it on. They want that same behavior when the invoice line
comes from Purchase Order

opw-2332763

X-original-commit: d8f5ed417deb82151abf7a25ad16ce0720e90780
2020-10-09 11:56:03 +00:00
Achraf (abz) d4d354e3cf [FIX] sale_coupon: promotion program with several identical products
Issue

    - Create promotion program with product_x
    - Create new quotation
    - Add product_x on the first line
    - Add another product_x on the second line
    - Press "Promotions" button

Cause

    The attribut reward_product_qty except singleton but order_line contain more than one element

Solution

    Take the order line with the higher quantity

opw-2350574

closes odoo/odoo#59637

X-original-commit: 30d66b17ea1829e30de176774c7511aab19851a0
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: Achraf <macadelic80@users.noreply.github.com>
2020-10-09 12:40:21 +00:00
Nicolas Martinelli 9d36b03cbe [FIX] web: report controller in multi-company
- Create 2 companies A & B
- Set a website on company A
- Switch to company B
- Open a done MO
- Open the cost analysis

An AccessError is displayed.

The error arises in:
https://github.com/odoo/enterprise/blob/923cbffe4e60572a5c17ee962d571c037e9cff44/mrp_account_enterprise/reports/mrp_cost_structure.py#L90

The root cause is coming from the call to `/report/html/`, which is
called without any `data`. In this situation, the following adds an
incorrect `allowed_company_ids` in the context:

https://github.com/odoo/odoo/blob/d1413a2f06bcb44b1fbb6dba8658e698c8da4018/addons/website/models/ir_http.py#L196-L205

Indeed, the `allowed_company_ids` is the one from the website, in this
case company A.

The issue doesn't occur when downloading a PDF from the interface since
in this case the `data` dictionary contains the appropriate context
which is set in:

https://github.com/odoo/odoo/blob/d1413a2f06bcb44b1fbb6dba8658e698c8da4018/addons/web/controllers/main.py#L1958

As a solution, we add the `user_context` in the `/report/html` route.

opw-2341747

closes odoo/odoo#59663

X-original-commit: 932e347a90bfd4bf025e4e8e54ef9c66cc49c5d0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-09 14:31:20 +00:00
Raphael Collet 0ee01beebe [FIX] core: preferably flush() with an env with a real uid
This fixes a crash in some controllers with `auth='None'` where some
updates are flushed with an environment where `uid=None`.  When there is
an environment with a real uid, preferably use it.

closes odoo/odoo#59658

X-original-commit: 2795c86df54389b858a454cbc1782b1f34f3ba4f
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-10-09 14:06:29 +00:00
qsm-odoo f05866aef3 [FIX] website: solve long dropdown menu problems in navbar
Following [1]. The mentioned commit selectors were to be simplified and
actually did not solve the problem in mobile affixed menu. Also,
targeting "o_affix_enabled" to target the non-affix menu was wrong since
when there is no affix menu, no header has the "o_affix_enabled" class
as its names indicates it. So the mentioned commit fixed half of the
problem and only when the website used the affix menu feature... Let's
hope this new commit fixes everything.

[1]: https://github.com/odoo/odoo/commit/21959599d1c25321865afabe7f70191efdda154e

closes odoo/odoo#59652

X-original-commit: 533a4db8efdf2b16f012e3c9253ae2abc88a344c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-09 13:54:53 +00:00
Thibault Delavallée 131cc12227 [REV] Revert "[FIX] web: add access group to the pdf js template."
This reverts commit odoo/odoo@681306d4e7.

Adding groups on assets parts is not a good idea. Indeed as assets are
compiled and optimized we do not want to serve different assets to different
users.

For example if you have several users in parallel on several workers those
could try to regenerate assets for their users. As each user has different
assets this could lead to big performance issue.

As original commit tried to solve a race condition we can safely remove the
assets fix to avoid issues and work on a cleaner solution.

See original ref odoo/odoo#51804 and odoo/enterprise#10737

This also solves an issue notably in website_slides where access to pdfjs
library was depending on connected users, due to assets mismatch. See
task ID-2352391 .

closes odoo/odoo#59610

X-original-commit: 000af2688e32d19b1874df2e909ccf0ddf636b91
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-09 11:17:29 +00:00
DramixDw d2e6015ce0 [IMP] website: make rvp and countdown closer to wysiwyg
Replacing 'in page' message for the "RVP" and the
countdown snippets so that we avoid to display some element that won't
be there on the saved page.

task-2261649

closes odoo/odoo#51632

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-09 15:22:05 +00:00
Anh Thao Pham (pta) 45eb9f0503 [FIX] account: fix email onchange on invoice template
- Activate debug mode
- Go to Settings > Technical > Templates
- Duplicate "Invoice: Send by email" and edit the copy (Name & Content)
- Go to Accounting > Customers > Invoices and create an Invoice
- Post it
- Send & Print
- In the wizard, select the duplicated template (the content will be updated)
- Uncheck "Email" option, the re-check it
The selected template is still the duplicated one, but the content is the one from the default template.

opw-2345200

closes odoo/odoo#59628

X-original-commit: cd6c54b15ce328b58888a4f33a64ae61c7744a90
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2020-10-09 11:57:38 +00:00
Benjamin Vray 69a942d363 [FIX] website: fix option to open mega menu dropdown on hover
Before this commit, the option to open dropdown on hover did not work
with mega menu.

task-2312878

closes odoo/odoo#59625

X-original-commit: 9b3b1c623867d3618220d8bd8a729701ae46448b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-09 11:54:10 +00:00
Olivier Dony cfa20f3eff [FIX] hr_work_entry: stop shadowing concurrent updates
The `_error_checking()` context manager is used to perform validation
and cleanup after changes on work entries, and is implemented using a
try/finally clause.

This mechanism fails to take into account that the alteration operation
can fail due to a concurrent update (in another transaction). In such a
situation the db cursor becomes instantly invalid, and any attempt to
use it will fail with:
  `psycopg2.InternalError: current transaction is aborted`.
This exception will be raised in the `finally` block, and will therefore
discard the original TransactionRollbackException.

The result: instead of being silently retried as expected,
the transaction fails and the user receives a cryptic error message.

Steps to repro: repeatedly click on the button to validate a leave

Solution: specifically handle PostgreSQL `OperationalError` exceptions
and do not attempt to use the cursor when they occur - just let the
exception bubble up.

closes odoo/odoo#59612

X-original-commit: 7ba47e7215df69b6556a848532e4f33ef4243e83
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-09 11:18:21 +00:00
Sébastien Theys a8dad56d6b [FIX] mail: fix discuss search filters and related issues
- don't reset `stringifiedDomain` when changing thread (this led to the
  control panel displaying obsolete filters)
- refresh non-main cache that are currently displayed when there is a known
  change of messages in the same thread's main cache
- refresh non-main-cache on displaying them, to fetch potentially new messages
- fix discuss "select all" conditions

task-2171873
task-2282374

closes odoo/odoo#59644

X-original-commit: b89dc5f949b3ad062fc4197a4152066c207e1bf9
Related: odoo/enterprise#13962
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2020-10-09 12:56:24 +00:00
Nicolas Galler 4c2a03aa8f [FIX] mrp: validate BOM lines with same product as BOM
Current behavior before PR:

It is possible to create a BOM that has a BOM line that reference the
same product as the BOM itself.  This is undesirable as when we create a
manufacturing order for this product we will have an error.

It is a regression bug that was introduced in commit
575353e251a0cce3bbff759edaeb56b5718beb11 between v12 and v13.

Behavior after PR is merged:

When saving a BOM it will validate that no product line references the
same product, or the same product variant, as the BOM itself.  Note that
it is allowed to have a BOM for a product variant that references
another variant of the same product.

opw-2347941

closes odoo/odoo#59633

X-original-commit: 917e4c67b4aa14ca71ec6cba4bc6d20a86459f42
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-09 12:05:27 +00:00
Rémy Baranx (bar) 75f21637de [FIX] stock_dropshipping: create dropship rules
Same issue than for commit 203bb4d9c11 but for dropship rules instead of
missing dropship types.

closes odoo/odoo#59629

X-original-commit: 1372cc427e9946b3f6ba81b4e895b145468092a2
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-10-09 11:58:53 +00:00
alt-odoo 2a4b0ede52 [FIX] account: wrong default bank journal returned
If no bank journal with no account set can be found, we should return False
instead of an empty record.

closes odoo/odoo#59609

X-original-commit: ececa74b96accd86bf9e9448d18526a905fed4c9
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2020-10-09 11:17:02 +00:00
Susana d3faba84ea [FIX] l10n_cl: remove placeholder of l10n_cl_sii_taxpayer_type field from res_partner view
closes odoo/odoo#59562

Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-10-08 20:27:23 +00:00
Lavish Chhatwani 61ed99d56e [ADD] sale_sms: ease sms use in sales application
Purpose of this commit is to add a bridge between sales and sms, notably to
add capability to edit sale order SMS templates for sales managers.

Task ID-2319841
PR odoo/odoo#56297
Upgrade PR odoo/upgrade#1829
Closes #55432

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-10-09 07:35:59 +00:00
Nicolas Martinelli 31f8af4598 [FIX] point_of_sale: check session in right company
- Create companies A & B
- Switch to company B
- Open a POS session in company B, but do not close it
- Switch to company A
- Set a Lock Date for Non-Advisers

The error message 'Please close all the point of sale sessions...' is
raised.

The message shouldn't be raised since the session is not in the company
we are setting a lock date.

We filter the session based on the company.

opw-2351930

closes odoo/odoo#59529

X-original-commit: a1445bf45fadf21a4af5dd2791efda4a4450a825
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-08 14:55:10 +00:00