Commit Graph
142493 Commits
Author SHA1 Message Date
fw-bot 84fb0987f2 [FIX] stock, purchase: performance in Replenishement report
Forward port of #70351

closes odoo/odoo#70557

Related: odoo/enterprise#18215
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-05-10 08:54:32 +00:00
Romain Derie 0381ca4c7f [FIX] website: fix race condition on link popover tour
Attempt to fix race condition:
> Tour edit_link_popover failed at step Change the URL
  (trigger: #o_link_dialog_url_input)

According to the runbot build screenshot from the error [1], when clicking on
the navbar `Home` menu, the previously deleted link on the `<p/>` is not really
deleted.

According to the runbot logs, some extra calls are done to `/`, probably coming
from extra preview calls.
It might be coming from the fact we click on the link itself to exit the right
panel URL edition.

This commit click on a non-link element to exit the right panel URL edition,
avoiding to show a popover for nothing.

[1] See the image on pull request

closes odoo/odoo#70487

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-05-06 15:24:29 +00:00
Anjali 124ccac937 [FIX] mrp_subcontracting: added a missing separator in filter
Before this commit:
 There is no separator between "Subcontractors" and "Archived" in the filters of
'contacts' module, So on clicking on both filters thus executes a "OR" search,
which is incorrect.

After this commit:
 We have added a separator so that the search becomes
 "Subcontractors" AND "Archived"

Task-id:2524695

closes odoo/odoo#70464

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-07 11:29:58 +00:00
nounoubensebia 691838f308 [IMP] mail: improve external server wording
improve external server wording in settings by:

- adding a @ to the domain so that users won't add it themselves
- removing the .odoo since it's an external server domain
- making Alias Domain not take more then a single line

Task-2507856

closes odoo/odoo#69369

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-07 14:04:30 +00:00
Andrea Grazioso (agr-odoo) 34b7870f21 [FIX] repair: correctly group invoices
Have 2 repair records with the same partner_id, ready to be invoiced
In list view select both records and click Action>Create invoices
In the wizard check 'Group by partner invoice address', create invoices.

Separate invoices will be created, but while grouping 1 invoice should
be created joining the 2 repairs

opw-2476539

closes odoo/odoo#70434

X-original-commit: 8f6e2fa1096f57ace6c84ae6083ab77ee37a69a1
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-05-05 16:40:32 +00:00
Swapnesh Shah acb9e5fe49 [FIX] mrp: do now allow to select cancelled mo
Before this commit, User can select Cancelled MO before selecting Product.
but it is already blocking since we already have constrains to not allow ubnuilding
Cancelled MO.

With this commit, We are always showing Done MO.

closes odoo/odoo#70316

X-original-commit: 48c0efcc97e35e00ec5803235a89a2c18e821990
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-04 10:31:16 +00:00
Martin Trigaux bb96addbed [FIX] transifex: escape ' in urls
Translation "Let's go"
Makes a Transifex search text:'Let\'s go'
That should be converted to q=text%3A'Let%5C%27s+go' in the URL

Removing the ' works from time to time but not always

closes odoo/odoo#70561

X-original-commit: 5f6d6cf1b4c76a2f0031c269501054e816c65e97
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-07 16:33:26 +00:00
Valentino 958e6fdcc2 [IMP] l10n_ar: Update eCommerce module displayed name
Feedback received: change the name from 'Argentinean Website' to 'Argentinean eCommerce'  in order to stay consistent with the functional name of stadand Apps

closes odoo/odoo#70361

X-original-commit: 7afb8e3193615d54f9e1b40a453eaf7f6c456dad
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-05-04 17:50:41 +00:00
Lucas Perais (lpe) f576c96a88 [FIX] web: route /web/session/modules returns a list
Since the changing of assets (8cc066173d)
the /web/session/modules route returned a stringified set instead of a list

After this commit, the route returns a list

closes odoo/odoo#70545

X-original-commit: 54e4a48996826dd8ea16a84517b46a847d6daf3f
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-05-07 14:31:02 +00:00
Laurent Smet 5c1f28cce4 [FIX] account: Fix dashboard 'Oustanding' amounts with shared outstanding accounts
- Share outstanding accounts between multiple journals
- Create payment for each of them
- Go to dashboard
=> "Outstanding Payments/Receipts" amounts are wrong

closes odoo/odoo#70564

Ticket: 2517499
X-original-commit: 39fb6b2990e5d6fda0d5f12dbd64d26ef77b9d0c
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-05-07 17:06:02 +00:00
Achraf (abz) 4d4557b596 [FIX] account: Prevent user to change product via journal items after posting
What are the steps to reproduce your issue ?

    1. Go to Account/Journal Items
    2. Open a posted item
    3. Change product

What is currently happening ?

    The product is changed in the account move

What are you expecting to happen ?

    The account move lines cannot be changed when the status is posted

How to fix the bug ?

    Make the field read-only when the status is posted

opw-2517325

closes odoo/odoo#70533

X-original-commit: 1b8f7ad00e9274b4b8f82ef77864997286611593
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-05-07 11:59:20 +00:00
Ivan Yelizariev 5889baa345 [FIX] sale: fix search "invoices is not set" for sale.order
BEFORE this commit query "invoices is not set" was tranformed to
query "order_line.invoice_lines.invoice_id is False", which doesn't make sense,
because invoice_id is required fields and hence always set. Hence, result of
the query was always empty.

AFTER: just check that there is no invoice_lines. Strictly speacking, is not the
same as checking result of compute method, but because invoice_lines are
supposed to be lines for invoices of out_* type, the result should be the same.

---

opw-2516124

closes odoo/odoo#70526

X-original-commit: 4ed6527cb414ee11d9bfac43a78dcc68ce233d07
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-05-07 10:38:19 +00:00
Odoo's Mergebot 1ea99712f2 [REF] web,*: hide buttons that doesn't work in webviews
Some features of the PDF.js library doesn't work in the
webview of the mobile apps.

Initially 'window.print' is defined as an empty function in
webviews unlike browsers where it is already ready.
After that, PDF.js needs to monkey patch 'window.print' and
saves a reference to the original definition, which is not
yet fulfilled in by the mobile app (Java part).
So the print of PDF.js doesn't work in webviews and end
users will need to download the file before printing it.

Regarding the Download button, the 'download' attribute is
not supported by the webview as you can see in:
https://bugs.chromium.org/p/chromium/issues/detail?id=432414
As there's many ways to download a file in Odoo it's not
a big deal to simply hide it in PDF.js.

Because it's quite complicated to fix this, we decided
to hide the features that don't work (Download / Print)
or don't make sense (Open file).

Task-id: 2200168

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#70375

Related: odoo/enterprise#18134
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-05-07 14:01:44 +02:00
Romeo Fragomeli 8a755d5833 [REF] web,*: hide buttons that doesn't work in webviews
Some features of the PDF.js library doesn't work in the
webview of the mobile apps.

Initially 'window.print' is defined as an empty function in
webviews unlike browsers where it is already ready.
After that, PDF.js needs to monkey patch 'window.print' and
saves a reference to the original definition, which is not
yet fulfilled in by the mobile app (Java part).
So the print of PDF.js doesn't work in webviews and end
users will need to download the file before printing it.

Regarding the Download button, the 'download' attribute is
not supported by the webview as you can see in:
https://bugs.chromium.org/p/chromium/issues/detail?id=432414
As there's many ways to download a file in Odoo it's not
a big deal to simply hide it in PDF.js.

Because it's quite complicated to fix this, we decided
to hide the features that don't work (Download / Print)
or don't make sense (Open file).

Task-id: 2200168
2021-05-07 11:01:27 +00:00
Thibault Delavallée d978b9e1c0 [IMP] various: update query counters according to latest runbot run
Base: seems related fields take only 1 extra query instead of 3

Crm: assignment seems to have been slightly improved. Some randomness still
happens.

Hr Holidays: seems it was further improved beyond space frontier

Hr Work Entry Holidays: seems it was further improved

Test mail: those tests were a bit random, seems random is gone (hopefully)

Test mail full: updated local counters

Test mass mailing: seems we gained one query, updated local counters

closes odoo/odoo#70504

X-original-commit: 8c215b3d60929166b3e60e2a4dfb2a6c70439046
Related: odoo/enterprise#18194
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-07 08:18:04 +00:00
Swapnesh d7f24257b3 [FIX] mrp: display correct uom on by products
Before this commit, It was always showing all
Unit of Measures in By Product lines.

With this commit, We are showing UoMs based on Category
of Selected Product's UoM.

closes odoo/odoo#70367

Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-06 16:52:25 +00:00
abd-msyukyu-odoo a03c882a56 [FIX] web: fix kanban view progressbars related to records in another group (groupby:week)
* IMPACTED VERSIONS

  12.0+

* HOW TO REPRODUCE

locale :  Locale is en_US (or other SUNDAY based)
view:     CRM - My Pipeline - Kanban view
groupBy:  date_deadline:week (Expected closing)
records:  one record with a planned activity, on date_deadline = 2021-05-02 (SUNDAY)
          one record with no planned activity, on date_deadline = 2021-05-09 (SUNDAY)
remark:   don't keep any other record in MAY for better visibility

* PROBLEM

The progressbar of the week containing 2021-05-09 displays information about the record
from the week containing 2021-05-02

* CAUSE

1. PostgreSQL `date_trunc` function follows ISO8601 which essentially means that
  the start of a WEEK is always MONDAY. There is no argument to change this.

2. _read_group_format_result
  https://github.com/odoo/odoo/blob/27da86a138089c1838e4b94f8a6976995b9c1fff/odoo/models.py#L2210-L2219

  - Computes a label for a group of records.
  - Follows the locale for the label of the week, based on a date which is
    always a MONDAY because of `date_trunc`.

3. read_progress_bar
  https://github.com/odoo/odoo/blob/88957afca09662af7eaa19df1e40b3699e45e79e/addons/web/models/models.py#L167-L175

  - Associates a group label to a record.
  - Follows the locale for the label of the week, based on the date of a record
    which can be any day of the week. If the record is related to a SUNDAY and
    SUNDAY is the first day of the week, it would have been in a group with a
    different label in (2.) than in (3.) prior to this change.

* FIX

In 3., before associating a label to a record, we truncate the date to the
ISO start of the period, so that the label is determined for a record in the
same conditions than in 2. The locale is still used to get language-dependent
outputs with babel, but the grouping will always follows ISO8601 (date_trunc).

* TEST

Added a test for this problem case

TASK-ID : 2517848

closes odoo/odoo#70498

X-original-commit: 4560925b26fa79740b9618fd9241d3517b64f43f
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-06 17:56:20 +00:00
Xavier Morel 79a4d11e24 [FIX] *: bunch of mismarked translation specifiers
`_(xyz)` will wrap them in an underscore.js object, which when used in
a string context will just return the string. So it's basically a
no-op, but it certainly doesn't translate the terms.

closes odoo/odoo#70476

X-original-commit: 92352ed2b5524c97b0aeeba3193c6a8d93ed82a1
Related: odoo/enterprise#18172
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-06 12:06:22 +00:00
yhu-odoo edc372a04e [IMP] (sale_)stock, product: route for packaging
Route is now can be set to apply on packagings. Bravo!

Task-2357259
PR #68654

Related: odoo/upgrade#2444
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-05-06 13:36:34 +00:00
yhu-odoo 02bffa5f40 [IMP] stock: smart putaway for packaging
Apply smart putaway rules on move with packaging.

Task-2357259
PR #68654
2021-05-06 13:36:34 +00:00
yhu-odoo 688d655305 [IMP] {purchase, sale}_stock, product: packaging revamp
1. add packaging to PO lines
2. packaging on PO/SO lines can be propagate to MO
3. add package type to packaging
4. on picking types, we can choose to only reserve full packaging. That
means if you want 1 pallet(100 units) and you have 50 units in stock. It
won't be reserved.
5. suggest suitable packaging for PO/SO/MO line according to the product
qty

Task-2357259
PR #68654
UPG PR odoo/upgrade#2444
2021-05-06 13:36:28 +00:00
Romeo Fragomeli c1c225eff2 [IMP] web: add the detection of iPadOS
Before this commit, the iPad with iPadOS was not detected as
'isMobileDevice'.

Now the detection is more accurate.
2021-05-05 10:20:06 +00:00
Romeo Fragomeli e7d6a68a56 [REV][FIX] web: pdfjs: hide buttons that doesn't work in webviews
The commit odoo/odoo@7a40d528 is reverted as the following commit
will do same behaviour without "Monkey Patching" the lib PDF.js
2021-05-05 10:20:06 +00:00
yhu-odoo bf26c3c221 [FIX] stock: cleanup picking state
Cleanup unused "none" and "partailly_available" state for stock.picking.

Task-2357259
PR #68654
2021-05-04 15:05:52 +00:00
Nicolas Seinlet acf306e4fb [IMP] gamification: skip useless computations
- use real join
- skip useless join on res_users and gamification_challenge
- skip null end_date criteria to compute less reached goal

closes odoo/odoo#70503

X-original-commit: 091d20d314f8301f0cbec292ec7b6fca906fd39e
Signed-off-by: Christophe Simonis <chs@odoo.com>
2021-05-06 17:53:38 +00:00
oco-odoo 995f6fbb86 [FIX] account: reconciliation models: fix priorities when matching amls from payments
Since the payment refactoring, the structured reference of a payment is stored in its ref field, not payment_reference like for invoices. This caused payments never to be matched with highest priorities, as payment_reference_flag was always false, and only communication_flag could match.

To reproduce:

- Have a reconcile model with match_total_amount=False.
- Create a statement line with communication a1b2c3 for 1000
- Create 3 payments:
> 500, with memo a1b2c3
> 500, with memo a1b2c3 (so, the same one)
> 500, with memo d1e2f3
- Open the reconciliation widget for your statement line

===> The 3 payments are matched, while only the two first ones should have been, as they were exact matches for the communication, and should hence have received higher priority.

closes odoo/odoo#70394

X-original-commit: b5800c9d2088df2bb9c4fbe0fed91c7ef24299c5
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-05-06 15:17:32 +00:00
oco-odoo 255c63ff26 [FIX] account: cash basis taxes: generate correct exchange difference when using the same cash basis taxes on multiple lines
To reproduce the bug:
1) Create a cash basis tax for 42%
2) Make an invoice with two lines at 100$, each using this tax
3) Post and register full payment of the invoice

==> An exchange difference has been generated, doing +100 -100. One of its two line has tax_ids set, while the other does not. This makes the base amount shown in the generic tax report wrong: 100 instead of 200.

Actually, this exchange difference entry shouldn't have existed in the first place, as there is no rounding issue to compensate for here. It happens because the grouping keys computed for the two base lines are the same, and the second line overwrites the totals of the first one instead of adding them to its own.

closes odoo/odoo#70283

X-original-commit: 60770f0b99bedd3dcb695e2191dc83c45ef0b594
Related: odoo/enterprise#18107
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-05-06 15:10:28 +00:00
Swapnesh Shah 15e66f98f5 [FIX] stock: disable links on forecasted inventory report
Disable the link on the forecasted inventory report  graph view, as it leads us to a undesired list view with traceback on opening it.

closes odoo/odoo#70488

X-original-commit: 64afb484b9785a4d739fef1207405a502d668ab8
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-06 14:27:55 +00:00
Swapnesh Shah ac5590c7db [FIX] mrp: compute duration when needed
Before this commit there would be trackback (TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'NoneType') when you will try to remove field Start date as we are using the field to compute duration.

With this commit, we compute duration when Both fields are present.

closes odoo/odoo#70482

X-original-commit: f29597fce37350f1c05d98341b959809bbb160b2
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-06 12:58:03 +00:00
Laurent Stukkens (LTU) 7ec13efc67 [FIX] sale_timesheet: prevent multicompany issue on SOL
Steps to reproduce:

        - Create an SO for a prepaid service in company A and confirm it
        - Create a project and a task in company B and select the customer linked to the SO you previously created
        - Unselect company A from the multi-company widget; only display the records from company B
        - Timesheet on the task you previously created

Observed behavior:

        - The SOL set by default belongs to company A, thus generating an access right error when trying to timesheet on the task

Expected behavior:

        - The SOL set by default should belong to the same company as the task

task-2515259

closes odoo/odoo#70451

X-original-commit: af3c0e1b273d83323a9428f5b369387993ae225f
Related: odoo/enterprise#18160
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-05-06 09:58:17 +00:00
Adrien Widart 2e95fda97d [IMP] stock_account: add hook for eligible for COGS
Let people be able to customize how to filter the condition

closes odoo/odoo#70418

Signed-off-by: Steve Van Essche <svs-odoo@users.noreply.github.com>
2021-05-06 13:22:18 +00:00
Swapnesh Shah f7e0787ae4 [FIX] mrp: set default product on unbuild order
Before this commit, Creating Unbuild order using
 Unbuild Button was resetting Bom as it was calling
`_onchange_product_id` after setting `mo_id` which was
resetting Bom on Unbuild order.

To Fix Issue, We setting `default_product_id` so It would not
reset `bom_id` when `_onchange_product_id` is called.

Fixes: #70216
Odoo Ticket: 2521788

closes odoo/odoo#70304

X-original-commit: 4de0ae434d1adc97fc1077b8d0f23c7e800ec161
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-04 09:23:17 +00:00
Rémy Voet (ryv) 37136f7149 [FIX] mrp: fix demo data for operation
Since df312153d4,
the `worksheet_type` default become 'text' instead of PDF. Then,
update the demo operation to show pdf instead of empty text.

task-2523601

closes odoo/odoo#70463

X-original-commit: 722fba2313bae3f2825492a3822111bbb25332b7
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-06 10:34:11 +00:00
nounoubensebia fa0738dd7e [FIX] mail: display default name for followers for "other address" partner
Display the default name (the one displayed in the kanban view) for followers replacing
the False value for "other address" partners, this way the user won't get
confused, furthermore, this fix won't require the name to be mandatory for this
type of contacts.

Task-2514244

closes odoo/odoo#70445

X-original-commit: 338b84bd9d2d675af30ab19c6bb262d2f68546b9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-06 08:00:36 +00:00
William Henrotin dfb8c1b9e7 [FIX] mrp: print bom structure per variants
Commit 044c5c2c81 removed the context key
`variant` of the bom structure report. This implies to always print
every variant in case a BoM has no product_id.
This commit fix this issue to print only the variant selected in the
report. It also adds a new button to print the report with all variants
in case for some customers this behavior was "not a bug but a feature".

Task : 2504524

closes odoo/odoo#70444

X-original-commit: 8da349e785b5b461ea19874df9686f8cd26af8ad
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-05-06 07:57:05 +00:00
Romain Derie 77b00d94d2 [FIX] website: don't show advanced tree hierarchy if not debug
The page manager shows an advanced structure if the user has multi website
enabled. It will show specific pages as a child of its generic one.
It is useful to directly understand and figure which pages are 'overiden'.

But it doesn't really makes sense for an end user, which doesn't know there is
actually generic and/or specific pages.

It makes more sense to show that behavior only in debug and not in multi
websites, even more since pages are overiden even in mono website.

closes odoo/odoo#68902

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-05-05 11:56:13 +00:00
Swapnesh Shah f84d090643 [IMP] stock: limit visibility of location fields
Before this commit, Fields `location_id` and `location_dest_id` were visible on the List while they are already restricted for `stock.group_stock_multi_locations` group on other views.

In this commit, We add a group on these fields on the list view as well.

closes odoo/odoo#48467

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-03-26 18:07:39 +00:00
Benjamin Frantzen (bfr) 5c3707832c [FIX] account_edi_facturx: fix filename in pdf embedding
When embedding to pdf, the name of the attached file should be 'factur-x.xml' (official specifications, section 6.2)

closes odoo/odoo#70442

X-original-commit: 04f4633d15f0a0824bd07f56a0f99491584f1a12
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-05-06 07:03:48 +00:00
Ivan Yelizariev 03a11f5cf7 [FIX] mail: allow duplicate records with alias for non-admin
ALIAS_WRITEABLE_FIELDS is used to write alias fields with sudo

Steps to reproduce:

1. Create a user
1.1. Give rights Services -> Project-> Administartor
1.2. Not given rights Administration-> administartor
2. Project app -> open any project -> Action -> duplicate -> it give validation error.

---

opw-2506566

closes odoo/odoo#70414

X-original-commit: 7ae1b4622c6743e28deca12476d6e70375c9417e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-05-05 13:49:06 +00:00
Goffin Simon 3e9f516b8a [FIX] stock: Running scheduler doesn't update
When running the scheduler, the informations in the inventory dashbord were not updated.

opw:2486591

closes odoo/odoo#68604

X-original-commit: 0d15ee3c9c5ebf98d604c331b8c97d01ced58f49
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-03-31 14:05:26 +00:00
Luis González fcfc83b66c [FIX] web: Aria attributes on buttons Export All & optional columns
Some aria attributes were missing or incorrectly set on these new
buttons:
- The button "Export All" was missing an `aria-label` attribute
- The button to show/hide optional columns was also missing an
  `aria-label` attribute, and its menu items (checkboxes to show/hide
  columns) were missing a proper role
- Ever since the debug manager was added in frontend on 73327db065,
  the `aria-label` attribute was not being rendered correctly on the
  button to open developer tools

closes odoo/odoo#70433

X-original-commit: ac3e0fcd32d66d6e0bacfabd2d224805d92dbfd1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-05-05 16:37:04 +00:00
Joseph Caburnay fdc3b42554 [FIX] point_of_sale: restore feature that closes open pos from other tabs
After the pos owl refactoring, the feature that closes pos from other
browser tabs was removed. Having multiple open pos for the same session
in the same browser session may cause issues when syncing orders because
the tabs share the same localStorage, and the localStorage is the source
of data when syncing orders to the backend.

closes odoo/odoo#70427

X-original-commit: 51b2c7fad08354499503c5c444dd1a3ae1f26fc1
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-05-05 15:47:16 +00:00
nouraellm 43d539dc5a [FIX] stock, mrp: Fix precision overflow in forecasted report
- Fix tends to prevent precision overflow in forecasted report

Current behavior before PR:
- If there are 2 units in stock and product_uom_qty is set to 0.66 the free_stock will be equal to 1.3399999999999999

Desired behavior after PR is merged:
- If there are 2 units in stock and product_uom_qty is set to 0.66 the free_stock should be equal to 1.34

opw-2425473
opw-2459650
opw-2448443
opw-2446985
opw-2440853
opw-2464507

closes odoo/odoo#70321

X-original-commit: c69fb8ec6828676a1900c56f1e87df809b6b70c2
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-05-05 15:14:38 +00:00
Nicolas Seinlet 9a01a2953f [IMP] mail, im_livechat: inline sql instead of long id list
using inselect operator to inline sql in the search method and avoid ORM
to fetch multiple useless messages to check if there's one

closes odoo/odoo#70410

X-original-commit: 505c7b0946689d3ac1ac4dd2f59cf4d535c36cbb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-05-05 12:40:29 +00:00
Adrien Widart c4f9d83c25 [FIX] account: prevent creation of JE on analytic line creation
When the user creates a new account analytic line, he should not be able
to create a new journal item.

To reproduce the error:
(Use demo data)
1. In Settings, enable "Analytic Accounting"
2. Accounting > Configuration > Analytic Accounts > Administrative >
Cost/Revenue
3. Create a new one
4. Click on "Journal Item" list

Error: the list contains the "Create and Edit..." option. Such an action
should not be possible.

OPW-2481197

closes #69881

closes odoo/odoo#70399

X-original-commit: f3ef533ed18c996f7f87c9596135e450479a8c19
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-05-05 11:11:38 +00:00
Romain Derie 2c8c079c05 [FIX] http_routing, website: prevent crash when using fw in url
Before this commit, the routing map generated and used would be the one from
the website the request is performed, instead of the one from the `fw` website
ID which will be the one we redirect the user to.

This issue was introduced with the routing map by website, be8fc2296b and is
restricted to a single case: a publisher using the website switcher, and it
won't happen on next page naviguation/refresh as the `fw` website id will be
the same as the current website's ID. Thus there won't be any routing map
mismatch.

Step to reproduce:
  - Create a page on website 2, set it as homepage
  - Naviguate to website 1 on '/' url
  - Naviguate to website 2 on '/' url
This will raise a werkzeug error about `EndPoint not iterable`.

----- Technical analysis ------

This is the current flow:
1. `_dispatch()` is setting `website_routing` to `get_current_website()` -> 2
2. `_dispatch()` is calling `_match()`
3. `_match()` is calling `routing_map()` with key = `website_routing`, which
   was set to 2 in step 1.
4. `routing_map()` is calling `_generate_routing_rules()` which generate the
   rules based on `website_routing`, which was set to 2 in step 1.
5. `_dispatch()` authenticate the user by calling `_authenticate()`
6. `_dispatch()` is calling `_add_dispatch_parameter()`, where URL param `fw`
   is forced in session, so `get_current_website()` now return the correct
   `website_id` -> 1

The issue: in order to handle the `fw` URL parameter (step 6.), we need to
check the rights to ensure we can allow the website switch.
To check rights, user need to be authenticated (step 5.), which is done after
generating the routing map (2. & 3. & 4.).
The routing map is generated based on the current website (step 1.)

Step 6 depends of steps 5 which depends of steps 2/3/4 which depend of step 1,
but step 1 should depend of step 6, which is an impossible cycle.

closes odoo/odoo#70397

X-original-commit: 4eb26497a774e934d7e1a6be9f505400fd9e2cdb
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-05-05 11:01:15 +00:00
Urvi Soni c3c8ee09cb [FIX] project: open the task form on clicking of task title from kanban
Currently, in the kanban view of the tasks when you click on title of
the task, it will not open the task in the form view.

so in this commit, Removed click event handlers on this widget for
kanban view to ensure that the kanban 'global click' opens the clicked
record, even if the click is done on a title of task.

closes odoo/odoo#70387

Taskid: 2510169
X-original-commit: d64b19d42ae70fa5a33a93e92cde8854ed2e0ab9
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-05-05 09:46:17 +00:00
Philémon van Helden 542618db8e [FIX] website_slides: correctly shows 0 XP on completed unpublished quiz
In 13.0 and above, when looking at a quiz that was completed while not published, it would incorrectly show 2 XP awarded, when 0 XP should be awarded.
With this commit, we show instead the correct 0 XP awarded.
opw-2480343

closes odoo/odoo#70349

X-original-commit: 26f047633b919bd8f2a260305bfd80e15bf259b6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-05-04 15:41:09 +00:00
Andrea Grazioso (agr-odoo) 61581c51d4 [FIX] *: avoid cutting 0.0 value in first row
Have in a purchase order a first row with unit price 0
Export the PO adding unit price in the list of fields to export
The unit price is not reported

This occur because the first line of the order lines is meld with the
purchase order line but in the process the 0.0 values is discarded

opw-2510917

closes odoo/odoo#70368

X-original-commit: 242bf5024ce6ae9c32176cd1a65a4f57a242dd45
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-05-04 18:55:42 +00:00
Goffin Simon de75260ba6 [FIX] hr_holidays: Leaves for partial time are wrongly counted
Steps to reproduce the bug:

- Let's consider an employee E that doesn't work on Monday morning
- Create a half day leave request LR for E on a Monday afternoon
- Save

Bug:

The duration of LR was counted as one day instead of 0.5

opw:2491784

closes odoo/odoo#70366

X-original-commit: b088abb95d9dac0a66c429f258a5e4f4e3a58501
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-05-04 20:44:52 +00:00