Commit Graph
151076 Commits
Author SHA1 Message Date
Kartik Chavda 75b9d95cb1 [FIX] project: fix search result for user_ids in task search view
Before this commit:
in task search view quick search on user_ids return active and
non-active tasks of user.

this commit remove active_test false from context of user_ids' quick
search so it should only return active tasks of user.

task-2758779

X-original-commit: 6148736215fe91d1eb1b19fd08809bdfe5a61fe2
Part-of: odoo/odoo#89329
2022-04-22 10:58:49 +02:00
Kartik Chavda c8deb68d84 [FIX] project: hide sub-task count in kanban view of task
before this commit,
in kanban view of task sub-task count of task is visible when
sub-task feature is disable from setting.

after this commit,
sub-task count of task will not be visible in kanban view of
task when sub-task feature is disable from setting.

task-2758779

X-original-commit: 1e45586c16443c3a19ae16f604882087dea3cc4e
Part-of: odoo/odoo#89329
2022-04-22 10:58:49 +02:00
David (dafr) bb2d6bd0d0 [FIX] mrp: fix double document creation on mrp.document copy
This PR fix the "This attachment is already a document" Error when clicking on the "Apply Changes" button of a mrp.eco (Engineering Change Orders) in the PLM App.
With the Documents App installed and the "Product: Centralize files attached to products" document setting activated, copying the attachment will also copy the document.
Then when we try to copy the current document and link it to the new attachment, the above mentioned error appear.
The context no_document=True prevent the document copy during the attachment copy.

OPW-2762448

closes odoo/odoo#89324

X-original-commit: ed306afc0e812c1e42984f1b6cb94e61409f0144
Signed-off-by: Simon Goffin <sig@odoo.com>
Signed-off-by: DavidFesquet <dafr@odoo.com>
2022-04-22 10:58:42 +02:00
Adrien Widart 18e6be5d08 [FIX] stock: apply putaway strategy on packages
The putaway strategies are not correctly working with packages

To reproduce the issue:
1. In Settings, enable:
    - Multi-Step Routes
    - Storage Categories
    - Packages
2. Create a Storage Category SC:
    - Allow New Product: mixed
    - Max Weight: 100 kg
    - Capacity by Package:
        - 1 x Pallet
3. Create two locations L1, L2:
    - Parent: WH/Stock
    - Type: Internal
    - Storage Category: SC
4. Create a putaway rule:
    - When in: WH/Stock
    - Package type: Pallet
    - Store to: WH/Stock
    - Having Category: SC
5. Edit the warehouse:
    - Incoming Shipments: 2 steps
6. Create a product P:
    - Type: Storable
    - Weight: 1 kg
7. Create a planned receipt R:
    - To: WH/Input
    - Operations:
        - 100 x P
8. Mark R as Todo
9. Create two packages:
    - 50 x P in PK01 (! PK01 must be a Pallet)
    - 50 x P in PK02 (! PK02 must be a Pallet)
10. Validate R
11. Open the related internal transfer T
    - Error [1]: Both packages are redirected to L01, but the capacity
by package is 1 x Pallet. PK01 should be redirected to L01 and PK02 to
L02
12. Set the done quantity of PK01
    - Note: PK01 is now redirected to L02
13. Set the done quantity of PK02
    - Error [2]: PK02 is also redirected to L02. Again, it violates the
package capacity constraint

**Context**

When validating the receipt (step 10), it creates a picking
Input->Stock. The module then tries to assign some quantities, which
leads to `_prepare_move_line_vals` for each package. In this method,
`_get_putaway_strategy` is called to define the best destination of each
stock move line:
https://github.com/odoo/odoo/blob/d55a99ff2d2f7b8d44cde1db3b6d48cdaac1cd3a/addons/stock/models/stock_move.py#L1313
The computation of the best location is in 3 phases:
- Phase 01: `_get_putaway_strategy` finds the relevant putaway rules and
computes the current and forecasted stock related to the current
package/product
- Phase 02: `_get_putaway_location` checks if, considering the putaway
rule and the current package/product, a location can be used
- Phase 03: `_check_can_be_used` checks if a location can receive a
package/product (considering the weight and the capacity constraints)

**Error 01**

During the first phase, in case of a package, the forecasted quantities
are computed by searching all SML that have the same package type:
https://github.com/odoo/odoo/blob/4bae10e0d960e5b80055e0e44056493238e552d3/addons/stock/models/stock_location.py#L258-L263
This can not work. The SML used to move the product in PK01 (from Input
to Stock) is created but its field `result_package_id` is not yet
defined. This operation will be done at the of the assign process,
thanks to:
https://github.com/odoo/odoo/blob/d55a99ff2d2f7b8d44cde1db3b6d48cdaac1cd3a/addons/stock/models/stock_move.py#L1547
So, during the first phase, when searching a location for PK02, the
computations are not aware that PK01 is already sent to L01. This
explains the error [1].

**Error 01 (Other examples)**

Considering how it is currently working, we could imagine another
problematic use case: 2 different products on the same package. Since
there is one SML per product, `_prepare_move_line_vals` will be called
twice (as well as the putaway strategy process). It may lead to two
different locations while the product are on the same package.

**Error 02**

When setting the done quantity, an onchange method is triggered:
https://github.com/odoo/odoo/blob/4202e46a8313fa9f1487d372ef0cb771f769be8d/addons/stock/models/stock_move_line.py#L200-L208
and tries to find the best location, considering the done quantity. As
said before, during the first phase, it looks for the current and
forecasted stock of a location. Since it will find the SML we are
writing on, the parameter `additional_qty` is used to subtract the
quantity of this SML (we need to ignore the current SML's quantity). But
here is a new issue:
https://github.com/odoo/odoo/blob/4202e46a8313fa9f1487d372ef0cb771f769be8d/addons/stock/models/stock_move_line.py#L217-L222
`_get_putaway_additional_qty` returns the quantity of products while the
first phase is looking for the quantity of packages. As a result, we do
some operations between products and packages:
https://github.com/odoo/odoo/blob/4bae10e0d960e5b80055e0e44056493238e552d3/addons/stock/models/stock_location.py#L290-L292
`qty_by_location[location_id]` is 2 (i.e. PK01 and PK02) for L01 while
`qty` is `-50` (i.e. the 50 products of the current SML), so the value
becomes `-48`. This can not work properly because the value doesn't have
sense anymore. Later on, during the third phase:
https://github.com/odoo/odoo/blob/4bae10e0d960e5b80055e0e44056493238e552d3/addons/stock/models/stock_location.py#L340-L346
The forecasted weight is not subtracted by the quantity of the current
SML. So the weight is exceeded, this is the reason why the destination
of PK01 becomes L02 on step 12 (it will be the same on step 13)

**Additional error**

Suppose the user is receiving a tracked product (suppose qty > 1). When
confirming the picking, several SMLs are generated to "reserve" the
quantity from the customer:
https://github.com/odoo/odoo/blob/d55a99ff2d2f7b8d44cde1db3b6d48cdaac1cd3a/addons/stock/models/stock_move.py#L1469-L1471
Later on, thanks to the wizard `stock.assign.serial`, the user generates
all USN. However, because the option `show_reserved` is disabled, the
wizard creates some new SMLs. But here is the issue, the SMLs created
during the assign process are already existing. Therefore, when looking
for the best location (for the new SMLs), the existing SMLs will disturb
the result (`_get_putaway_strategy` will find these SMLs and think that
some products are already incoming in some locations)

**Solutions**

- We should compute the best locations once all SMLs are created (and
linked with their package)
- In case of a package with a type, we should try to find the best
location for the package itself, not for each product of the package
- When calling the putaway strategy process, we should provide the
SML(s) to exclude instead of providing some quantities. This will
prevent subtracting products with packages and allow the correct
calculation of the forecasted weight for each location
- When creating a putaway rule, we ensure that the option
`show_reserved` of the destination location is enabled

OPW-2746169

closes odoo/odoo#89350

X-original-commit: 98169b391f4610545b7f4745b729ad95eac3696a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-04-22 09:58:03 +02:00
Tom De Caluwé ded49ccc48 [FIX] sale_management: copy sequence from quotation template
When selecting a quotation template for a quotation all the template lines are
copied into the quotation. However, the sequence field is omitted when adding
the lines. As a result all quotation lines have, by default, the same sequence
number.

This should not be a problem, since the lines are still shown in order in the
frontend quotation view. Once the lines are shown, the user can freely reorder
the lines, while the frontend takes care of reordering the sequence numbers.

However, there is an interaction with an existing problem in One2Many and
Many2Many fields. When these fields are paginated a sequence update will only
update the sequence numbers on the first page. This means that, before this
commit, when we move around a line on the first page, all the lines on the
second page will be inserted at the second position on the first page (because
of the way _onResequenceRecords is implemented).

This commit does include the sequence number in the copied quotation lines,
resolving the problem described above.

Note: It is still possible to insert new lines in the first page, extending
the sequence numbers at the end of the page. Since the sequence numbers on the
second page still remain the same, there are now lines on the first and second
page having the same sequence numbers, resulting in a similar bug.

opw-2730746

closes odoo/odoo#89344

X-original-commit: 6f11060d6afd9edce904dd34a2d415a2a2461108
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: De Caluwé Tom (tdc) <tdc@odoo.com>
2022-04-22 09:57:59 +02:00
Alexandre Kühn 5149aa8cb6 [FIX] mail:tests: skips non-deterministic scroll tests
These tests fail non-deterministically.
The underlying problem is currently being fixed.
But to fix runbot issues, the tests are skipped in the meantime.

Note that the failure in tests show very rare buggy behaviour,
but the buggy feature is very minor. So it's reasonable to not
obstruct mergebot by just skipping tests while a fix is being
prepared.

closes odoo/odoo#89384

X-original-commit: a51a636bc3acdab3700323a825c77ba4572e942f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-22 09:03:08 +02:00
Kevin Baptiste 1078226f9f [IMP] fleet: add tracking on fields
closes odoo/odoo#89102

Taskid: 2826804
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-04-22 09:03:04 +02:00
Sébastien Geelen (sge) 77178fe5ae [FIX] web_editor: fix onChange event
Ensure the `onChange()` callback is called
after each history steps in the editor.

Call the `_doAction()` directly, to avoid using the
disabled `_doDebouncedAction()`.

task-2760436

closes odoo/odoo#89339

X-original-commit: 18eaabcb4dab4682e3a94e16dbe66ff3c6f35a77
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2022-04-22 08:03:38 +02:00
Cedric Prieels (cpr) ebf29ba6ee [FIX] sale_timesheet: hide the costs/revenues stat button
The costs and revenues stat button on the project form view
should not be present since the saas 15.1, so we hide it.

closes odoo/odoo#89359

Related: #75269
X-original-commit: 6a508b351419a7edbc8276a8174ea60859b24dda
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-04-22 02:07:14 +02:00
Paolo (pgi) 514a692b86 [FIX] l10n_it_edi: traceback when line has 0 qty (anyway wrong)
In case there is an AML with 0 qty, the generation of the FatturaPA e-invoice
tracebacked. Even if it's a functional error on the invoice, this also impeded
the EDI cron to run, and this is solved by avoiding the case in the
computation.

closes odoo/odoo#89348

X-original-commit: 79cbea8b9241c1fa98db1bb575ea430360d630e3
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2022-04-21 20:38:47 +02:00
Alexandre Kühn f75b7d19a8 [IMP] mail: turn props into model fields (step 1)
This commit moves some business logic from components to models,
as a step to move further to having essentially all business code in models.

Having code in models is desirable to have very maintainable code, thanks to
robust and declarative code with an ORM-like architecture.

Task-2826823

closes odoo/odoo#89323

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-21 19:42:04 +02:00
dbkosky 27686d0b0a [FIX] l10n_it_edi_sdicoop: add tests for price included taxes and discounted
lines

Create test directory for l10n_it_edi_sdcioop, and relevant tests for
the exported xml. These tests are run in l10n_it_edi_sdicoop because
there is different behaviour when l10n_it_edi_sdicoop is
installed (different checks are run on the invoice).This module should
eventually be merged with l10n_it_edi in master.

closes odoo/odoo#89207

X-original-commit: dffb205dad9ce29288c82c4b51011b77ddf33580
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Daniel Kosky (dako) <dako@odoo.com>
2022-04-21 19:41:58 +02:00
Adam Heinz aafe2e35e7 [IMP] sale: simplify API of create_product_variant method
### Current behavior before PR:

The `product.template` model has a nice function `create_product_variant` that unfortunately expects its input to be in JSON.

### Desired behavior after PR is merged:

JSON decoding is moved into the controller, such that the function can be called as expected.

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

closes odoo/odoo#88989

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-04-21 18:45:22 +02:00
Pierre-Yves Dufays daae6063cd [FIX] mass_mailing: fixes save filter glitch
In the mass mailing form, when clicking on the filter save button, the screen
was unexpectedly scrolling down. This fixes this problem.

Task-2793090

closes odoo/odoo#86789

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-21 17:41:41 +02:00
Touati Djamel (otd) 40c2ae4053 [FIX] sale_stock: display only outgoing transfers to portal users
Steps to reproduce the bug:
- Create a storable product with routes: MTO + Buy
- Create a Portal user “pu1”
- Create a SO > select the “pu1” as customer
- Validate and confirm the created PO
- Connect as “pu1”:
    - Go to the sales order view:

Problem:
The client can see outgoing and receipt(PO picking) transfers, this is a problem because then the customer can see information from the vendor

Solution:
A portal user should only see outgoing type transfers in the sale order view

opw-2816719

closes odoo/odoo#89285

X-original-commit: 91cfdf997dd210f2cbc684674745ab0b251088d2
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-04-21 16:11:50 +02:00
Xavier BOL (xbo) f50bf9b959 [FIX] project: avoid filtering burndown chart records for project manager
Before this commit, when the Project Manager wants to see the burndown
chart report, he cannot see all the tasks if the project visibility is
follower and he do not follow the project. Indeed, he can only see the
ones in which he is assigned or follower. This behaviour is not expected
for a project manager but only expected for a project user.

This commit adds a rule to avoid filtering the records from burndown
chart report when the current user is a Project Manager.

Related PR: #82634

closes odoo/odoo#89284

X-original-commit: f045bd78d562ec48762479138bc8388af252d06a
Related: odoo/enterprise#26457
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-04-21 16:11:42 +02:00
mafo-odoo eda9903173 [FIX] l10n_eg: Correction of account types
The accounts Furniture and Equipment, Computer Hardware &
Software and  Motor Vehicles had the wrong type (Current assets)
we changed it to match egyptian fiscal law (Fixed assets).

opw-2821715

closes odoo/odoo#89280

X-original-commit: 315b3b13644dcad007ae9efd1a22bb32f64da143
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-04-21 16:11:38 +02:00
Nicolas Bayet 54f499cc86 [FIX] web_editor: make HR element not editable
task-2778511

closes odoo/odoo#89267

X-original-commit: af23ab272fcf9c33980679b0215be2fff0ea1a86
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-21 15:06:48 +02:00
root d256f9de23 [IMP] partner_autocomplete: use same author name as all other apps
closes odoo/odoo#89092

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-04-21 15:06:41 +02:00
std-odoo 5dd6c1f1d3 [FIX] *_mail_plugin: hide modules if the user doesn't have access
Bug
===
If the user doesn't have access to the project / CRM module, those
menus were visible on the addin side.

Now, the sections are not visible if the user doesn't have access to.

Task-2765323

closes odoo/odoo#89260

X-original-commit: 7b7aa72ecdc7e69e425ae08c28e1e7827e423548
Related: odoo/enterprise#26446
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-04-21 13:55:08 +02:00
std-odoo 598fe1c45b [FIX] mail_plugin: allow to re-use the mock method
Purpose
=======
Allow to re-use the method `mock_auth_method` used to mock the Outlook
authentication, to be able to write tests in other sub-modules.

Task-2782150

X-original-commit: 6932f05bfc4b2beabaf7c6390f1d241fff73bd38
Part-of: odoo/odoo#89260
2022-04-21 13:55:08 +02:00
Victor Feyens 9eb68e4c99 [FIX] sale_management: do not reset lines on company change
Finetuning of 970904b06f6872aadf69d64c7bc82072a16f1596

Only update the template (& reset the lines if change done through UX) if
the SO wasn't saved already to make sure existing setup is not reset.

This commit restores even more of the previous behavior when the template
was only defaulted to the current company one.  Now the default is only
modified if you change the company before saving the record.

In all other cases, the template can only be modified manually/programmatically,
but won't be reset/updated by the compute method.

Task ID - 2798588

closes odoo/odoo#89255

X-original-commit: 7209e391789be6a807bd4eac22257e888cbaf1a6
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-04-21 13:55:00 +02:00
Adrien Widart ff7322ed43 [IMP] mrp: select BoM based on rule
Add test for use case fixed by d43e9cb9ad8d1c0c020209de0e8f6ffdcbc960a1

closes odoo/odoo#89237

X-original-commit: 21be0d8e96b9fb6e9fd6476a664ce89b017a7767
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-04-21 13:54:57 +02:00
Dossogne Bertrand b9b2fd8f4e [FIX] hr_holidays: fix new time off error
This commit aims to fix an error created in task 2658415 which prevent to create a new time off.

taskID 2829472

closes odoo/odoo#89221

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-04-21 13:54:53 +02:00
Xavier BOL (xbo)andWilliam Braeckman 68ad5504b4 [FIX] project_timesheet_holidays: remove timesheets when time off is canceled
Before this commit, when the user cancels his validated time off planned
in the future, the timesheets generated for this time off are not
deleted. The problem is since the timesheets are not removed we could
have duplicated timesheets if the user adds a new time off in the same days
for instance, because the newest timesheets are generated and thus we have
duplicated timesheets generated instead of having only timesheets generated
for the newest time off.

This commit removes the timesheets generated for the time off when this
time off is canceled (=archived). Also, It also prevent the user to
manually unarchive the time off since this operation is not really
managed and could introduced eventual problems.

Related PR: #76722

Part of task-2791386

closes odoo/odoo#89246

X-original-commit: a9e63ebe32079e2215acafcd4bca15b371ee9bc2
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
Co-authored-by: William Braeckman <wbr@odoo.com>
2022-04-21 12:50:12 +02:00
Alexandre Kühn 4c21dbee29 [IMP] mail: move component handlers to models (step 7)
This commit moves some handler methods from components to models,
as a step closer to having most of business code in models.

Having business code in models is desirable so that the code is much more maintainable:
easier to change and more robust code.

Task-2579306

closes odoo/odoo#89123

Related: odoo/enterprise#26379
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-21 12:50:05 +02:00
Sébastien Theys ccdda4450c [IMP] mail: remove uuid from channel_fold
Unnecessary param.

task-2827807

closes odoo/odoo#89115

Related: odoo/enterprise#26388
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-21 12:49:58 +02:00
Sébastien Theys 870eb515eb [IMP] mail, *: remove uuid from channel_pin
* = im_livechat, website_livechat

Unnecessary param.

task-2827807

Part-of: odoo/odoo#89115
2022-04-21 12:49:58 +02:00
Kartik Chavda d67e1e4b8f [FIX] project: fix rating stat button UX in project update
before this commit,
in project update right side panel view rating stat button's icon is
static it does not update depending on rating percentage and percentage
not showing properly.

This commit display rating average percentage in project update right
side panel view's rating stat button instead of just displaying
rating_avg_percentange field's value and rating stat button's icon will
update depending on rating percentage.

task-2758779

closes odoo/odoo#89209

X-original-commit: 549e1750cf51f27befe6278a71250cca0c720139
Related: odoo/enterprise#26423
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-04-21 11:34:04 +02:00
Tom De Caluwé 7b1ffd6315 [FIX] website, base: allow modify_image calls on svg for designers
SVG images are considered an xml like format, as a consequence restrictions
apply for manipulating svg type attachments. This poses a problem when a
website designer tries to save a page containing images with svg shapes. This
commit allows writing attachments with an xml like mimetype to anyone with
write access rights on views.

opw-2806930

closes odoo/odoo#89185

X-original-commit: d5aa54ca108eb99c7eb855a7d456bfe2f208a8eb
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-04-21 11:33:56 +02:00
Didier (did) ed2c2a234e [FIX] mail: enforce scroll position when shifting chat windows
Before this PR, chat window scroll position was reset to top when it was
switched to the left.
This PR introduce a component hit that restore the position saved inside the
models when a chatwindow is switched.

task-2746500

closes odoo/odoo#89134

X-original-commit: 0f11abaf09f08fc9643dac5ee8d4df6d1ef5686b
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-04-21 11:33:53 +02:00
Jigar Vaghela fbc7c7cd05 [FIX] l10n_in_edi: fix token_validity time convert to utc, fix groups name
we find some bug when backporting to v15 so we fix this in fw-port

value of token_validity is not converted to UTC so fix it,
And groups in the field are wrong like ```account.group_system``` so set right one ```base.group_system```
Also, fix IAP buy credits message where set URL out of the Markup

Task 2179664

closes odoo/odoo#89110

X-original-commit: 1191abca6aa863cbb4a70c0329fd2271547049fa
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-04-21 10:29:43 +02:00
Merlin (megu) b7bbb7b21f [FIX] survey: send survey invite in partner's language
Survey invites sent to contacts are in the user's language and they
should be in the partner's language

Steps to reproduce:
1. Install Surveys and Contacts
2. Install another language (eg. fr_FR) but keep English as the
application language
3. Create a contact with the different language (fr_FR)
4. Create a survey and share it with the french contact (the template
used should have translations in both language)
5. Check the mail sent (Settings > Technical > Email > Emails)
6. The email is written in English but it should be in the contact's
language

Solution:
If all the recipients of the invite use the same language, display the
invite in the recipients' language to the sender so he can modify it or
send it directly
If they use different languages, use the template in the sender's
language

opw-2760489

closes odoo/odoo#89214

X-original-commit: 52f37c061015f5425587d46ff54973f18c0223eb
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-04-21 09:28:57 +02:00
jlzhou 9ddbefe9df [FIX] add missing help content translation for stock.quant view
closes odoo/odoo#89097

X-original-commit: b50f90cdae28b315d6a715b5444cec820dca45e1
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-04-21 09:28:50 +02:00
Sébastien Geelen (sge) 9b022bf2ff [FIX] web_editor : fix url transform & embed in paste
* Avoid auto-transforming an valid url inside an existing <a> tag.
* Ensure the current selection range is deleted
  before embedding an image or video.

task-2604627

closes odoo/odoo#89210

X-original-commit: 070bceeadd16e0b5643b91ad583449d31c48313d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-21 07:59:44 +02:00
Sébastien Geelen (sge) a538919bad [FIX] web_editor : fix html paste
We change the way we handle paste of html data :

The basic flow is :
1. if any range => deleteRange and continue from here
2. if the paste data has only one root <p> :
    > we unwrap its content in place
2. if the paste data has two root <p> :
    > we unwrap the content of the two p in place
    > we force a oEnter between the two contents
3. if the paste data has more than two root <p> :
    > we unwrap the content of the first and last p
    > we force a oEnter between the two contents
    > we insert the rest in between, out of focus block element

@see unit tests in `test/spec/copyPaste.test.js`

task-2604627

X-original-commit: 4dde6d37f30c35714c52e7e28f7011414fed7b6a
Part-of: odoo/odoo#89210
2022-04-21 07:59:44 +02:00
Sébastien Geelen (sge) b17cdad276 [FIX] web_editor : fix whitelist of html pasted elements
whitelist of html element was not designed to keep the style
set by our own editor ( style on <span>).

We add a system to keep the spans when they meet some requirements.
Requirements are basically having one of the few allowed inline styling css rule.

@see tests in `test/spec/copyPaste.test.js` section 'Html Paste cleaning'

task-2604627

X-original-commit: da92c2335a1241ec9f3974d3bac1c4b7227b2d28
Part-of: odoo/odoo#89210
2022-04-21 07:59:44 +02:00
Sébastien Geelen (sge) fcc035bcaa [FIX] web_editor : ensure break line consistency on delete
When delete backward/forward OR deleteRange,
we need to ensure the break lines stay consistent with the user action.

Some cases where not handled correctly.

Mainly when a <p> tags was removed and not directly adjacent to another block element.
In those case we kept too much or too little break lines.

@see tests added in `test/spec/editor.test.js`

task-2604627

X-original-commit: 9f14422ffceadd48b76ff460e4080e0cf5bc6fa2
Part-of: odoo/odoo#89210
2022-04-21 07:59:43 +02:00
Sébastien Geelen (sge) 4bd57e41a4 [FIX] web_editor : fix element merge on deleteBackward
Ensure we never move nodes that were not initially in the deleted element.

When deleting an element and merging its content with its sibling,
the nodes contained in the removed element will temporary be hosted
in the common parent, beside possible other nodes.
We don't ever want to touch those others nodes when merging.

This change fix some instances where nodes would wrongly be carry
into another element.

@see new "merge node" tests in `test/spec/editor.test.js`

task-2604627

X-original-commit: 0af6e15ba9d15f20ec74144fd3069e6f409ef802
Part-of: odoo/odoo#89210
2022-04-21 07:59:43 +02:00
Sébastien Geelen (sge) 7aaa481ee6 [FIX] web_editor : initialize powerbox property
Ensure the `_active` property on the PowerBox object is always a boolean.

@see test/spec/copyPaste.test.js

task-2604627

X-original-commit: 124298546cfbc129eb9ae934923a5e4e47392797
Part-of: odoo/odoo#89210
2022-04-21 07:59:43 +02:00
Sébastien Geelen (sge) d41bf197d1 [FIX] web_editor : fix some linting errors
task-2604627

X-original-commit: df980347f8c8953c2c938343b1558d1a395c716c
Part-of: odoo/odoo#89210
2022-04-21 07:59:43 +02:00
Sébastien Geelen (sge) f75b0635e2 [FIX] web_editor : add and change unit tests
ADD load of units tests covering :
  * text paste
  * html paste
  * image url embed on paste
  * url embed on paste
  * video url embed on paste

  * better coverage on some delete backward and forward

CHANGE some others unit tests :
  * tests about merging of block elements that where not accurate
  * test about insert HTML ( spec change )

task-2604627

X-original-commit: 378e8d1bd64e3758eb0202be33cb2d8c5bf97eea
Part-of: odoo/odoo#89210
2022-04-21 07:59:42 +02:00
Tommy (tong) 7a83e91319 [IMP] l10n_hk: Update chart of account
- Reason: Due to Hong Kong companies must contribute employees MPF funding by law. Therefore it is better to include MPF in the CoA. Also, Short-term Borrowing is a common used CoA among Hong Kong companies.

task-2777305

closes odoo/odoo#89208

X-original-commit: b4f6cf56b999a42c09ac41ae1449618f2877a9e6
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-04-21 07:59:30 +02:00
Don Kendall d42d0d656e [CLA] signature for dnplkndll
closes odoo/odoo#89157

X-original-commit: 0e344e2b185d4b362288f765d427e016dd956bed
Signed-off-by: Florian Gilbert <flg@odoo.com>
2022-04-21 07:59:26 +02:00
Don Kendall 7e85404a4f [14.0][fix] ambiguous error due to missing column prefix
X-original-commit: 8ad018ca6050435247ae284444108def3828572f
Part-of: odoo/odoo#89157
2022-04-21 07:59:26 +02:00
Aurélien Warnon afecca5e48 [FIX] im_livechat: avoid using bootstrap for chatbot blocks
Currently, the block showing that the conversation with the chatbot has ended
is hidden/displayed using bootstrap classes (d-none).

This is an issue because when embedding the livechat in a third-party website,
bootstrap classes are not available and the block is displayed when it should
not be ('d-none' is not available).

To fix the issue, we use standard "display: none" style and jQuery show/hide.

Task-2822240

closes odoo/odoo#89158

X-original-commit: bee70eb3bf1cb5c9069340891b250c8c443dbf55
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-04-21 07:02:57 +02:00
Romain Derie 346360cc27 [FIX] website: give unlink access right on assets to website editor
Commit [1] was not enough, expecting that the unlink right was not
needed. But it is.

A recent test highlighted that issue.

[1]: https://github.com/odoo/odoo/commit/e3515a7b73c3e173a3ddf0bc48e4a888024c8817

closes odoo/odoo#89211

X-original-commit: 19a97fcaf1fd2f762522d171e98d9942fb45e9d1
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-04-20 22:56:12 +02:00
Romain Derieandroen-odoo b8bd897fe4 [FIX] website: allow user to access HTML/CSS editor
Current behavior:
When an admin user modified a file with the HTML/CSS/JS editor in a
website, users that had "editor and designer" right couldn't access
the HTML/CSS/JS editor anymore.

Steps to reproduce:
- Have user 1 (U1) admin
- Have user 2 (U2) with website access set to "Editor and Designer"
- U1 modify the css user_custom_rules.scss with the HTML/CSS Editor
- U2 can't open the editor of that website because he is not in the
setting groups or the one that created it

opw-2733109

X-original-commit: d20468c3463927a54c34688769a22b3949c5c465
Part-of: odoo/odoo#89211
Co-authored-by: roen-odoo <roen@odoo.com>
2022-04-20 22:56:11 +02:00
Yolann Sabaux 7f081cffaa [FIX] hr_holidays: set correct default date
Steps to reproduce:
- Go to time off - >New Time Off-> in the list you will see the all the times that are possible to take(that require allocation and not)
- Go to time off->My time off->create
- Select Sick Time Off

Issue:
If you want to select "Paid Time Off" it won't be displayed anymore

Cause:
When selecting a leave_type that does not require allocation the "default_date_from" is False. And so the get(key, default) does not return the default.

opw-2813263

closes odoo/odoo#89196

X-original-commit: ee6e6cb26528f42de9652b88fe022ebae2cfacfc
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: yosa-odoo <yosa@odoo.com>
2022-04-20 22:56:07 +02:00
roen-odoo e9bf6c6364 [FIX] point_of_sale: prevent showing downpayment as discount on receipt
Current behavior:
When applying a discount and a downpayment on a product in the PoS
the discount line on the receipt would be the sum of the discount
and the downpayment. But the downpayment is not a discount.

Steps to reproduce:
- Install PoS
- Change discount policy to Show public price & discount to the
  customer, in the public pricelist
- Create a promotion program that applies 10% discount
- Use this promotion program in the PoS
- Create a quotation for any product (e.g with a product that cost
  1000$)
- In the PoS go in the quotation/order and apply a downpayment to
  this quotation.
- Pay the downpayment, and go in the quotation/order again. But this
  time settle the order.
- After the payment on the receipt you will see the discount line
  value is not correct. It's the sum of the discount + the downpayment

opw-2792417

closes odoo/odoo#89213

X-original-commit: fc546e0481ae0159e67791240833bc1e38a4440f
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-04-20 21:57:15 +02:00