Commit Graph
141473 Commits
Author SHA1 Message Date
Nicolas Lempereur 33fc445ae2 [FIX] web_editor: can set bg position on root editor
Scenario:

- go to /slides and start editing the page
- change the position of background banner
- save

=> traceback

Why:

The code for pan tool duplicates the target element in an overlay. In
the given use case, it means a node with .o_editable class is created
that will cause an error when saving because the code expect the cloned
element to be an editor (in `RTEWidget.save()`) but it is not (and is
eg. missing `.data('options')`).

opw-2427560

closes odoo/odoo#66643

X-original-commit: 96c22e816981d72c185520750167c514c6bded5b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-22 20:07:07 +00:00
Tiffany Chang (tic) 571ebf0b13 [FIX] stock: make package level package consistent v2
Commit e5ab8cf9623bc436f43706926bc6ee596c549244 missed a use case.

Steps to reproduce:

- Activiate "Packages" setting in Inventory
- Configure an operation type to "Move Entire Packages"
- Create a "Planned Transfer" picking with that operation type and add a
  package to be moved
- Turn off "Move Entire Packages" and try set the destination
  package of the move line to nothing (False).

Expected result:
Move line has no destination package + package level is deleted as
expected.

Another bug will still exist due to the design of package_level where if
in addition to the above use case, if a different package is used instead
of deleting it and "Move Entire Packages" is reactived => final package
shown in the Detailed Operations will show all move lines as being part
of the same package even though they are not. Data appears to be correct
in the database otherwise and a reasonable fix doesn't seem feasible for
now so we leave this bug as is.

Related to Task: 2418907

closes odoo/odoo#66638

Fixes: odoo/odoo#66542
Fixes: odoo/odoo#66517
X-original-commit: a73505ddafe9ce6f4f3e9896494900d419a815bd
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-22 17:28:14 +00:00
nie 3e1cea4373 [FIX] event_crm: prevent access rights issues on leads
Steps:
- Login as an admin user
- On a fresh branch install event_crm
- Give a "test" user access rights of "Own Document only" in the "Sales"
  app, nothing in "Events"
- Assign any lead to "test" user
- Login as "test" user and try to access your own leads

Bug:
Error: While parsing modifiers for button: for modifier "invisible":
Unknown field registration_count in domain

Explanation:
The button `event_registration_action_from_lead` tries to access event
registrations even if the user doesn't have access to events.

opw:2462127

closes odoo/odoo#66599

X-original-commit: 29be97615554337591f0b31ba34942c2d728cbef
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-22 12:17:07 +00:00
Adrien Dieudonne 67272fb97b [FIX] hr_work_entry: unit of period not aligned
Before this commit, 'hours' was on the next row instead of the same line.

closes odoo/odoo#66640

X-original-commit: 6820eef1e9dfe2695560ebcf265a5d69c38e4f91
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-02-22 17:53:16 +00:00
nie aac9fd5b80 [FIX] payment: link to order when not connected
Steps:
- Install sales,payment
- Go to Sales
- Create a quotation
- Click Actions > Generate a Payment Link
- Browse the link in a private window
- Pay

Bug:
The transaction is not linked to the sale order in the link table
`sale_order_transaction_rel`

Explanation:
When not connected, the user doesn't have the rights to read the order.
This leads `order_id` to be set to `None`:
https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/payment/controllers/portal.py#L177-L178
When paying without `order_id`, the app is not able to make a link
with the transactions:
https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/payment/controllers/portal.py#L276-L277
This raises problems such as not being able to capture an amount as seen
here:
https://github.com/odoo/odoo/blob/d2f3c9e7975188753fa17c06db3fc5c73c773944/addons/sale/views/sale_views.xml#L254-L257

If we ensure a `partner_id` is present, using `sudo` here shouldn't be a
problem as the data is protected by the token. Everything we get from
`order_id` should already be in the URL.

opw:2451564

closes odoo/odoo#66631

X-original-commit: f1f73fd2f8efdbac18d33d4e0b866ca50a28d537
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-22 16:46:19 +00:00
Raphael Collet e6369c2535 [IMP] core: write x2many fields last
Writing on x2many field should be done last, because deleting x2many
lines causes pending computations and updates to be flushed.  Writing on
column fields after that inevitably adds extra update queries.

We introduce an attribute `write_sequence` on fields to order fields for
write.  The prescribed order is: all fields except monetary and x2many,
monetary fields, x2many fields.

closes odoo/odoo#65959

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-02-22 16:20:55 +00:00
Raphael ColletandVictor Feyens 840609975a [IMP] core: better way to set/update magic fields
The goal of this change is to simplify the code managing `create_date`
and `write_date` in methods `create()` and `write()`, and also to remove
weird behaviors caused by the way those fields were updated.

Assume we update a simple field on a record.  This adds pending updates
for the field and `write_date`.  However, the value of `write_date` is
not known yet: it will be updated as `NOW() AT TIME ZONE 'UTC'` in SQL.
So `write_date` is actually given a dummy value in pending updates, and
it is invalidated from cache, until its value is flushed to the database
and fetched again.

Now assume we access another field on the record, and that field is not
in cache.  The prefetching mechanism will read all column fields,
including `write_date`, and flush them first.

    # this adds pending updates foo: 42, write_uid: 1, write_date: False
    record.foo = 42

    # assume 'bar' is not in cache; this prefetches all column fields,
    # which flushes the pending updates above before reading them back
    result = record.bar

We can avoid flushing pending updates if the values read from database
do not overwrite existing values in cache.  If you assume that the value
of a pending update is in cache (in the example, `foo: 42`), you don't
need to flush the corresponding field.  Indeed, the value of `foo` will
remain 42 in cache, whatever its value in the database.  This assumption
(pending updates are in cache) is true for all fields *except* for
`write_date`: it is invalidated from cache, and given a dummy value in
pending updates.  This branch actually makes this assumption true for
all fields.  The avoidance of flushing pending updates will be done in
another commit.

In order to directly assign `write_date` its value, we use a cache for
the value `NOW() AT TIME ZONE 'UTC'` from the database.  This costs at
most one query per transaction, and potentially saves a few queries.

Co-authored-by: Victor Feyens <vfe@odoo.com>
2021-02-22 16:20:55 +00:00
Raphael Collet 75d2f995e2 [FIX] *: query counts
Adapt some query counts to their optimal value, in order to measure the
effect of the following commits on queries.

In module test_performance, some query counts were actually not correct:
the initial flush() done by the context manager assertQueryCount() may
prefetch some data to the cache, and that prefetching is not accounted
for in the query count.  This is very true when assertQueryCount() is
preceded by a cache invalidation.  We have to move the invalidation
inside the context manager, so that the prefetching is now counted.
2021-02-22 16:15:28 +00:00
Andrea Grazioso (agr-odoo) 371ae55a19 [FIX] website: show thumbnails for img gallery in tabs snippet
- Go to the website
- Drag a "Tabs" block on the page, you will have 3 example tabs
- Click on the tab "Contact" and drag in the block "Image Gallery"
- Add multiple images to the image gallery
- Click on one of the other tabs so that the image gallery is hidden
- Save

The image gallery do not have the thumbails anymore.
This occurs because when the carousel-indicator is hidden, jquery is not
able to fetch its real length, so no icons are added.

opw-2438513

closes odoo/odoo#66608

X-original-commit: eeb6eea90b9d44a42b1cc4f6b6f6c29cc7370d26
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-22 13:49:46 +00:00
Benjamin Frantzen (bfr) edc76b5f96 [FIX] l10n_be_edi: only add the pdf to the xml if it exists
Before this commit, in some cases the attachment of the Belgian EDI might not exist any longer when printing the pdf, which caused a crash when trying to embed it into the xml.

closes odoo/odoo#66605

X-original-commit: ec72e3f02f4854870faccdbbb1048e5be62fa6af
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-02-22 12:59:30 +00:00
Aaron Bohy c14622fcd3 [FIX] web: correctly close confirm dialog
Let's assume the following scenario:
 - have an action in target new (e.g. a form view)
 - in the dialog, have an action/object button with confirm
   attribute
 - when clicking on that button, a confirm dialog opens
 - if validated, the following action returned by the server
   is again an action in target new

Before this commit, the confirm dialog remained in the DOM.

This issue occurred because it's parent wasn't correctly set (wrong
use of `this`), so when the first dialog was destroyed, the confirm
dialog wasn't automatically destroyed in turn.

OPW~2440712

closes odoo/odoo#66597

X-original-commit: 98f9cb4f692a15494cd8ef298673fe1c949c423c
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2021-02-22 12:13:22 +00:00
Nicolas (vin) 7c9c9e391a [IMP] account: add mail template for send&print credit note
There is only a single mail template for invoices at the moment.
To make things easier to work with, this will add a new template for
credit notes.

Task id #2343331

closes odoo/odoo#58244

Signed-off-by: William André (wan) <wan@odoo.com>
2021-02-22 12:51:48 +00:00
Mohammed Shekha 43ada22177 [FIX] web: fix issue of notebook page with invisiblity modifier
before this commit: when there is only one page in the notebook tag and
there is a boolean field in form to show/hide that notebook page based on
invisibility attrs, if we toggle boolean field notebook hides, that's OK
but when we toggle boolean field again then notebook page is displayed but
it is not active and due to that content of notebook page is not displayed.

after this commit: when there is only one page in notebook and it has attrs
for invisibilty, when we toggle boolean field to hide/show notebook page
then notebook page as well as content is toggled.

task-2449053

closes odoo/odoo#66582

X-original-commit: a0b5ecd344d6ac79d8e4d194cfabf3d639259c73
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-22 08:16:18 +00:00
Andrea Grazioso (agr-odoo) 559e9f3e76 [FIX] point_of_sale: fix doubleclick of validate button
Open POS, add something to the order, go to checkout, add payment,
double click on validate

js error will popup

opw-2429523

closes odoo/odoo#66571

X-original-commit: c3aea6783b8bfb3af383ae881af247fa5507e99f
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-02-19 17:55:39 +00:00
Géry Debongnie 02a75a560c [FIX] web: race condition in crash manager test
Since commit 2716828f25, the error dialog
has an additional JS lib dependency, which means that it may needs to
perform a request before it opens up. However, a test in the
crashmanager was only waiting for a next tick, which is possibly too
short for a network request.

So, depending on the network speed (and on the test order), this test
could fail. To fix it, we simply make sure that the test also wait for
the library to be loaded

closes odoo/odoo#66546

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-22 08:25:45 +00:00
yhu-odoo 9691190ecc [FIX] stock: disable auto-reserve with ir.config_parameter
Currently we always auto-reserve products for moves when other incoming
picking makes the product available. This is unwanted for some users.
In this commit, we allow to disable this by add a parameter to
ir.config_parameter. To disable it, set a parameter with name
"stock.picking_no_auto_reserve".

PR #66373

closes odoo/odoo#66436

X-original-commit: 04424cddf1e28a52fd7df3ad954d2d484b52972e
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-18 10:10:11 +00:00
sofiagvaladze babd7c2948 [IMP] hr_payroll: add color picker to hr.work.entry.type form and list
Task - 2452036

closes odoo/odoo#65622

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-02-09 13:35:47 +00:00
Laurent Smet 98156d0eb8 [FIX] account: Fix missing dependencies of '_compute_is_reconciled'
closes odoo/odoo#66572

X-original-commit: 367ffd7757cf892c2ad08cc0bf35f23d78083ccc
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-02-19 17:55:59 +00:00
Laurent Smet 62dc50bf7e [FIX] account: Fix use_in_tax_closing on 'base' lines
This field shouldn't be visible on the view for 'base' repartition lines.

closes odoo/odoo#66570

X-original-commit: 69ba2db0cb480c298400fa0bbcbb1a7aa9a0a96b
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-02-19 17:54:11 +00:00
Mohammed Shekha 8aecb15970 [FIX] web: do not display cover images in sample data
Before this commit, in sample mode, cover images might be displayed
in kanban views. It isn't what we want as those images are real
images from the database, not sample ones, but randomly linked to
the sample records (the id of many2one fields is randomly generated).

This commit tweaks the SampleServer to always set many2one fields
pointing to model 'ir.attachment' to false.

task-2368505

closes odoo/odoo#66381

X-original-commit: f7b2a5825e3786be53d04276af4c4c403b7a293e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-17 15:00:12 +00:00
Adrien Widart 649eedaa2e [FIX] account: set main attachment only for posted invoices
When printing a draft invoice, it raises an error.

The error comes from fix #65320: the latter registers the printed
invoice as main attachment, but this needs to be done only with posted
invoices.

OPW-2427247

closes odoo/odoo#66563

X-original-commit: 49a57dd5b34b66733564b31ed861fe9bfcbda2b3
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-02-19 17:03:10 +00:00
xO-Tx 2d58bbece6 [FIX] web_editor: fix anchor click on submit button
Context:
1) Edit mode
2) Click on anchor edition button of website form submit button
3) Traceback occurs

The "focus" triggered on $editable element in editor's 'getLinkInfo()'
discards user's text selection on submit button, as a result,
'range.create()' method returns null since no selection is found.

Note: the bug only occurred in Chrome.

Note 2: [1] apparently tried to solve the same issue but the fix was not
        solving it correctly, at least not in all cases.

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

opw-2443441

closes odoo/odoo#66574

X-original-commit: adf3d039acbac60b7ea7e6ab0ea8fdd9f940c3b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-19 18:45:16 +00:00
Nicolas Lempereur 2aa2ab1fb2 [FIX] web_editor: no error background position + ctrl Z
Scenario:

- start editing background position
- press TAB key
- press CTRL + Z

=> traceback

Why:

Restoring a snapshot with CTRL Z can send a click event with target not
wrapped in a jQuery object which was not expected by the code.

reported in https://github.com/odoo/odoo/pull/66462#issuecomment-782025417

opw-2423445

closes odoo/odoo#66564

X-original-commit: 2c0aa825ee54ed674ff9f43722031df8e2f35ca6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-19 17:10:14 +00:00
Laurent Smet ec396230d4 [FIX] account: Set memo to ref if not payment_reference
Issue

	- Install "Accounting" module
	- Create a new bill :
	- Set vendor
	- Set no payment reference
	- Set a bill reference
	- Add products to bill
	- Confirm and click on Register Payment

	Memo field has no value.

Cause

	The memo field is based on lines name.
	Lines name is computed in `_onchange_payment_reference`
	and depends only on payment_referecence.

Solution

	If no `payment_reference`, fallback on `ref` to set line name.

opw-2440389

closes odoo/odoo#66491

Co-author: nboulif <bon@odoo.com>
X-original-commit: 7a7dc212af7279544cffba362bce7daa4fc00865
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-02-18 16:05:57 +00:00
Lucas Lefèvre bf0e340309 [FIX] web: mock active_test for search and search_read
The support for "active_test" context key has been introduced in c2918c1
However, the context key is ignored in many mocked ORM methods (if not all).

This commit adds support for the `search` and `search_read` methods.

Note: this is done to easily write some tests in odoo/enterprise#16363
and it might be usefull to test futures features (or fixes) using this
context key.

closes odoo/odoo#66393

X-original-commit: 0ad1c1631eb233b3e8f98b40f8c0813d0ad7acbe
Related: odoo/enterprise#16447
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2021-02-17 16:17:07 +00:00
JordiMForgeFlow cf2e73c402 [CLA] Update ForgeFlow
closes odoo/odoo#66535

X-original-commit: 7f8ff150992cd09ad4fe6e1259b3206cb99e2c23
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-19 13:12:10 +00:00
JordiMForgeFlow f2055ad33c [FIX] sale: truncate quotation amount in kanban view
Currently, the quotation amount field added in the CRM Sales Teams Kanban view is overflowing the kanban card once the number is too large.

The fix adds the class text-truncate in the corresponding div to avoid the overflow. Notice that this class is the one already used in the parent view implemented in the CRM module, for the other amount fields.

X-original-commit: 14915f4b6a12bbd4882db5af229fb97be3dd52e9
2021-02-19 13:12:10 +00:00
Francois (fge) 4627c224ef [IMP] base: add sourcemap support for CSS files.
Improve the development experience in debug=assets mode by reducing the
number of requests to the server. We are adapting the solution used for
the JS files to the CSS files. This solution consists of no longer
sending all the files separately, but sending only the bundles
associated with their sourcemap. This allows us to keep the same
debugging experience while drastically reducing the number of requests
to the server.

Benchmark:
saas 14.2                   917 requests    domcontentloaded after 3.76s
master (bundling du js)     299 requests    domcontentloaded after 2.03s
branch (bundling js+css)    36  requests    domcontentloaded after 1.01s

Task id : 2463840

closes odoo/odoo#66169

Related: odoo/design-themes#453
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-18 08:51:02 +00:00
Nicolas Seinlet b9c776129a [FIX] website: decorate create method
When method isn't decorated, create a view trigger a traceback
"create() missing 1 required positional argument: 'vals_list'".

Handle create_multi use case.

closes odoo/odoo#66527

X-original-commit: 16a5a0ed278679b25b8b30677c2c0d4da59526aa
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-19 11:13:23 +00:00
luz paz c9e29e5917 [FIX] *: correct typos
Various user facing an non-user-facing typos
Found via `codespell`

Closes odoo/odoo#65648

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-19 13:20:48 +00:00
luz paz a03af96193 [CLA] signature for luzpaz 2021-02-19 13:20:23 +00:00
Martin Trigaux 116ed844d9 [I18N] website_gengo: remove leftover files
Were not removed when the module was removed (bad forward port?)

closes odoo/odoo#66528

X-original-commit: 4d4555b2c6ba352107b0173c792fd4d43fa9be9e
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-19 11:29:33 +00:00
wan 5783642ee4 [FIX] base_vat: not called at all
The function was wrongly imported and used, and it was hidden by a
generic catching of all exceptions.
The return value and some legit exceptions were also badly handled:
* The return value was always thruthy as it returns an object containing
information about the check.
* Exceptions can be raised if the format is not correct. In that case,
we don't want to go to the simple vat check.

Fixes #64897
opw-2451951

closes odoo/odoo#66522

X-original-commit: e711f359fef7ed4c37cb26d3946744e140bf00e0
Signed-off-by: William André (wan) <wan@odoo.com>
2021-02-19 09:50:24 +00:00
Martin Trigaux 9741ef5ee6 [I18N] *: export saas-14.2 source terms
For odoo-master Transifex project, no demo data

closes odoo/odoo#66500

X-original-commit: 813931ac850e5ba4181259a5957ec72226fb670c
Related: odoo/enterprise#16510
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-19 08:02:58 +00:00
qsm-odoo 4b2f5975fa [FIX] website_form: fix norecaptcha behavior
Adapt [1] to be a bit more robust.

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

closes odoo/odoo#66508

X-original-commit: 028ae76f3b53132ae5c1510a4285cc21fc120c76
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-18 20:29:14 +00:00
Nicolas Lempereur d10d0b2da4 [FIX] web_editor: don't save cropping tool on CTRL+Z
Scenario:

- start cropping of an image
- press TAB key
- do CTRL + Z

=> now the image cropping tool are inside the page and there is no way
to remove them.

Why:

The image crop tool was added inside the editable elemnt, so if we did
an action that changed history the cropping tools are saved in the
snapshot and going back to it will add them without any code handling
their removal.

opw-2394877
opw-2423445

closes odoo/odoo#66499

X-original-commit: ce93cbd78e282e6957aaeba6f06945f94bfffb26
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-18 16:52:29 +00:00
Francois (fge) f22cf20b71 [FIX] base: properly renegerate assets in debug=assets
Recently, the debug=assets mode was changed to use a bundle with
sourcemap instead of serving static files.  Therefore, when someone
modifies a javascript file, refreshing the browser does not load the new
code anymore.

We did not notice that because this is only an issue when the server is
not started in dev mode.  In dev=all (or xml), the assets code does not
use a cache and checks everytime the file checksum number to determine
if a new bundle needs to be done.

It is probably not common for developers to modify source code
without restarting the server and/or using dev=all, but it is a case
that is easy to handle anyway: we just need to make sure that in
debug=assets, the assets code does not use the cache and checks directly
the files checksum.

closes odoo/odoo#66460

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-19 09:15:29 +00:00
Martin Trigaux 7124d7012d [FIX] mail: translate report name field
When genrating an attachment in a mail message (e.g. the pdf attached
to a confirmation email), the filename was not translated into the
language of the recipient (unlink the email content).

The variable `template` has the contact language in the context while
`self` contains the language of the user executing the action.

Fixes odoo/odoo#66420

closes odoo/odoo#66498

X-original-commit: 6001e7584c28f8d028c782692caa644015c33e9c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-18 16:51:12 +00:00
Xavier Morel 1f1da0508d [IMP] base: properly handle API keys on inactive users
closes odoo/odoo#66512

X-original-commit: baebf5814425cce6a9481b4efec5248bbba3ea64
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-02-19 01:00:16 +00:00
Anh Thao Pham (pta) 99101cbd8b [FIX] sale_timesheet: fix (re-)invoiced amount computed as other revenue
- Install sale_timesheet and hr_expense
- Create a Service Product with "Create a task in sales order's project" as Service Tracking (i.e. Service X)
- Create a Product with "Can be Expensed" and "At cost" as "Re-Invoice Expenses" (i.e. Expense X)
- Create a SO with Service X (i.e. Unit Price: 50.0) and confirm it
- Go to Expenses and create an Expense:
  * Product: Expense Y
  * Unit Price: 25.0
  * Customer to Reinvoice: [select the created SO]
- Create Report, Approve and Post journal entries
- From SO, create an Invoice (Service Y + Expense Y) and confirm it
In Project Overview, the expense is computed in Other Revenues and
Re-invoiced costs. Therefore, the amount of the expense is added twice
in the Profitability total.
In Project > Reporting > Project Costs and Revenues, for Project linked
to SO, Untaxed Amount Invoiced and Untaxed Amount Re-Invoiced are also
computed in Other Revenues.

opw-2444237

closes odoo/odoo#66490

X-original-commit: 4d9305d122f79792db780bbd97ae6732bf06ff9f
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-02-18 16:05:34 +00:00
Romeo Fragomeli d85f5ddeac [FIX] web: client report action mounted called twice
Before this commit, the 'mounted' method of the ControlPanel in
the client report action  was called twice.

It happened because the client report action updated the ControlPanel
before being actually mounted, so mounted was called once when the
traceability report was mounted, and once when the update was applied.

Ideally, this should not be an issue (this isn't an issue with owl).
However, in Odoo, we mix layers of Owl Components and legacy
widgets. In these situations, the above scenario isn't properly
handled (and can't be).

As a consequence, in mobile (enterprise), it crashed because an
handler bound in mounted (thus twice) was only unbound once.

This commit avoids the issue as the update was actually useless.

Steps to reproduces (Mobile):
* Go to Inventory (Stock)
* Open the "burger menu"
* Select "Products" -> "Products"
* Select one product in the list
* Click on the "Forecasted" ("stat button")
* Select one "SO line" (sale order) to go to the form view
* Go back to the previous view using breadcrumb
* Optional: Go to another app if the screen can't scroll (e.g. go to Sales)
* Scroll the view => Bug

closes odoo/odoo#66497

X-original-commit: d3854dbf7a6e0c0f9ac00c11716908bc175808d7
Related: odoo/enterprise#16507
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-02-18 16:46:57 +00:00
Romeo Fragomeli 9de025b410 [FIX] stock: traceability report mounted called twice
Before this commit, the 'mounted' method of the ControlPanel in
the traceability report was called twice.

It happened because the traceability report updated the ControlPanel
before being actually mounted, so mounted was called once when the
traceability report was mounted, and once when the update was applied.

Ideally, this should not be an issue (this isn't an issue with owl).
However, in Odoo, we mix layers of Owl Components and legacy
widgets. In these situations, the above scenario isn't properly
handled (and can't be).

As a consequence, in mobile (enterprise), it crashed because an
handler bound in mounted (thus twice) was only unbound once.

This commit avoids the issue as the update was actually useless.

Steps to reproduces (Mobile):
* Go to Manufacturing (MRP)
* Open the "burger menu"
* Select "Products" -> "Lots/Serial Numbers"
* Select one product in the list (unfold group first)
* Click on the "Traceability" ("stat button")
* Select one line to go to the form view
* Go back to the previous view using breadcrumb
* Optional: Go to another app if the screen can't scroll (e.g. go to Sales)
* Scroll the view => Bug

X-original-commit: bbcd8ce097e62bd1d9ba3a61608324a80a111c24
2021-02-18 16:46:55 +00:00
Christophe Monniez 9fce3f83cb [IMP] tests: add data_dir support in test_module_operations
In some situations, like during tests on runbot, the data-dir location
may vary.

With this commit, the `data-dir` CLI argument is added to the
test_module_operations script.

closes odoo/odoo#66492

X-original-commit: 781c91784a0a997967a0152dca2c59a0cb2bab74
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2021-02-18 16:09:03 +00:00
Nasreddin (bon) 3f1a31c498 [FIX] website_sale, *: display error message in "Extra Info" step
*: google_recaptcha, website_form

Issue

        - Install 'Ecommerce' module
        - In settings, fill the "reCAPTCHA: Easy on Humans, Hard
          on Bots" option with random wrong site key and secret key
        - Open your ecommerce (go to /shop )
        - Add any product to cart and and open cart
        - Activate "Customize -> Extra Step Option"
        - Process to "Extra Info" step
        - Click on next

        Stuck at this step since next button does not react.

Cause

        There is an error due to re-captcha feature that
        does not allowed to go to next step.

        The second issue is that the error is not displayed
        because missing message area in form.

Solution

        Do not check recaptcha if 's_website_form_no_recaptcha' class
        present in form.
        Add span 's_website_form_result' to display error messages.
        Replace 'public' by 'site' in error message to fit google
        'field' name.

opw-2456098

closes odoo/odoo#66493

X-original-commit: eb9373522628fa01c3503fa802ded23adc1cbe1f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-02-18 16:09:24 +00:00
Nasreddin (bon) 8d3950d8d7 [FIX] sale: Display color tootlip in product configurator
Issue

	- Install "Sales" module
	- Go to settings and activate "Product Configurator" feature
	- Create a product X with mutilple color (variants)
	- Create a quotation
	- Add product X (Product Configurator should open)
	- Hover any color

	Popup with color name does not appear.

Cause

	'title' attribute value is removed.

Solution

	if element have 'value_name' data attribute, set it back as title else set no title.

opw-2438704

closes odoo/odoo#66479

X-original-commit: fc7ef284915641472722a7be06a75b1df3b8ca93
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-02-18 15:00:13 +00:00
Nasreddin (bon) f234b4fba4 [FIX] account_facturx: Parse pdf attachment
Solution is different in the case of the foward-port, see bellow.

Issue

	- Init an instances of Odoo v13.0 'A' and v14.0 'B'.
	- Install "Accounting" app on instance A & B.
	- Set your email server on instance A & B.
	- Activate 'External email server' in settings of instance A.
	- Set an email alias for "Vendor Bills" on instance A.
	- Send a "Customer Invoice" from instance B to alias of instance A.
	- Fetch for new mail (in case new vendor bill don't appear) on instance A.
	- Open the new Vendor bill on instance A.

	Data are not parsed from pdf attachment.

Cause

	No managing all attachements types:
	- list(tuple(str,str), tuple(str,str, dict) or int) attachments : list of attachment tuples in the form
          ``(name,content)`` or ``(name,content, info)``, where content is NOT base64 encoded
	- list id attachment_ids: list of existing attachement to link to this message
          - Should only be setted by chatter
          - Attachement object attached to mail.compose.message(0) will be attached
            to the related document.

Solution

	In this fw-port, we override `_message_post_after_hook` instead of
	`_message_post_process_attachments` because the later is also called
	from portal and with sudo rights. We don't want to update invoices with
	files coming from portal, since it could cause a security issue.
	Also, because of the way attachments are parsed for invoice, this could
	cause the OCR not to work any longer because at the time
	`_message_post_process_attachments` is called,`move.message_main_attachment_id`
	is not set yet, and OCR relies on it.
	The solution is rather to override `_message_post_after_hook` because
	it ensures that all the attachments have been properly treated and are
	present in `new_message.attachment_ids`, and `message_main_attachment_id`
	is properly set.

opw-2411002

closes odoo/odoo#66458

X-original-commit: 0f6ad2a690f76d6bbbe92106fc8360f99eaac6c2
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-02-18 12:48:34 +00:00
Goffin Simon d4b6ee53f9 [FIX] account: Printing journal entries"
This commit ba32244c10396ff8605e5533e08675a64fbf9d88 introduced an error when
validating pickings or reconciling

closes odoo/odoo#66366

X-original-commit: b20e689659a3e1c89279caf028592bf18a17c4f7
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-02-17 13:25:03 +00:00
Adrien Dieudonne b92ec789e2 [FIX] web: m2o extra button misaligned on mobile
Before this fix, the extra button was out of the right edge of the
screen.

On desktop, m2o external buttons have to overflow over the right padding
of the parent element. This is done to avoid to reduce the size of the
input when the button appears (when a value is set).

But on mobile, there is not enough padding and we therefore prefer to
reduce the size of the field if an extra button should appear.

To fix this, we simply ignore these rules on mobile.
Note that the css selector that really cause this issue was the one
related to '.o_row' and the second one has no effect.

Steps to reproduce:
- Go to "Inventory / Operations / Scrap"
- Click on "Create"
- Choose a product and set UOM field

Related task-ID: 1929043

closes odoo/odoo#66463

X-original-commit: 2fc36e91d95b81f79d0a23f3958011c55a7ff105
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-02-18 13:07:23 +00:00
Nicolas Lempereur 03f8dffebd [FIX] web_editor: shift+enter in editor add direct newline
Enter keypress browser event were removed in 3c372d1da8.

It was reintroduced in text fields with d2f024d254 and in source mode
of html field with b10ca1f6094b.

When doing ENTER in the editor, we do our special case of ENTER (eg. it
will split the container in two and have other custom behavior) but when
doing SHIFT+ENTER we let the browser handle it and add a normal newline.

With the "Enter" prevention, SHIFT+ENTER did not work.

opw-2463746

closes odoo/odoo#66455

X-original-commit: 27b84138b422f0dbb3e01c83bb817d0880e3eab3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-02-18 12:34:23 +00:00
std-odoo 83e22fd063 [IMP] portal: improve the "grant access wizard" usability
Purpose
=======
Improve the "grant access wizard" usability, allow to re-invite the
partners and grant / access per partner and not in batch.

Specifications
==============
Add 3 buttons to grant / revoke the access and to re-invite the partner.
When the partner has an internal user linked, do not allow to manage
him in the view (disable the button) because we do not want to remove
the "internal user group" in the wizard, but only the "portal user
group".

When we revoke the access to a partner, if the corresponding user
belong only to the portal group, we archive it instead of deleting it.
So if we re-grant the portal access, he will have the same user as
before and keep his preference, etc.

Task 2381921

closes odoo/odoo#63024

Related: odoo/upgrade#2011
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-18 08:37:04 +00:00