Commit Graph
140847 Commits
Author SHA1 Message Date
Tiffany Chang (tic) bace7e66de [FIX] stock: enforce sn constraint when ml done
Prevent duplicate SN through python constraint (requires SN to be
attempted to be created) instead of assigning existing one (and
causing a duplication). Steps to reproduce:

- create a SN tracked product + activate "storage locations"
- assign a SN to tracked product
- create a planned receipt for the tracked product and assign same SN
  (i.e. same name).

Warning will pop up about repeat SN, but it is still possible to
validate the picking and create a duplicate SN.

Also add an extra `limit=1` to lot search for performance/safety.

Bug was discovered while working on related task: 1924758

closes odoo/odoo#64714

X-original-commit: cd81b7accad63ec433ff66e58f286626cfc1ac65
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-01-18 17:07:26 +00:00
Julien Castiaux c8f031ad77 [IMP] calendar: schedule reminders using triggers
The calendar reminders are emails or web notifications sent moments
before an event start. The mechanism to send web notifications is
controlled by the browser, it fetches all the future notifications and
uses `setTimeout()` to delay them. The mechanism to send emails was
controlled by a cron, every 30 minutes the cron would look for the
coming events and send the mail reminder.

The cron was running every 30 minutes even if there was no event. The
best precision was 30 minutes.

The new mechanism use cron triggers, every time one add email reminders,
triggers are created to call the cron at the precise moment the alarm is
set. The cron no longer send emails for events in the coming 30 minutes
as those will be triggered too.

closes odoo/odoo#64560

Task: 2416741
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-01-18 15:57:41 +00:00
Julien Castiaux cbf00ae8ee [REF] calendar: remove cron activation code
There is code that automatically enable or disable the cron whether it
exists alarms. As alarms are automatically added, the cron is actually
always enabled.
2021-01-15 18:58:12 +00:00
nie 5e9e93ca6c [FIX] point_of_sale: cannot close rescue session with Cash Control
Steps:
- Go to Point of Sale > Shop > Settings
- Activate "Advanced Cash Control"
- Start a new Shop session
- Once in the POS go offline
- Create some orders
- Close the POS UI in the top-right corner
- Go back online
- Close the session and post the entries
- Start a new session
- Create an order
- Close the POS UI
- Close the session and post the entries
- Go to Orders > Sessions
- Click the rescue session
- Click "Continue Selling"

Bug:
The user is redirected to the POS dashboard instead of opening the UI.

Explanation:
First, you cannot "Continue Selling" in a rescue session as seen here:
https://github.com/odoo/odoo/blob/b826c96ad39fc887a735c6ca839e3796aa18dac5/addons/point_of_sale/controllers/main.py#L17-L22
This commit removes the button from the UI in this case.

Then, after it has been created, the rescue session should be open and
not in the 'opening_control' state as seen here:
https://github.com/odoo/odoo/blob/9a8ebcc7cb05572681444ddb2511ccea4cee5565/addons/point_of_sale/models/pos_order.py#L98-L99
This is not the case anymore since https://github.com/odoo/odoo/commit/d21420d87ad8a269a0f30b3d9c0a3cee8c46cb14

opw:2427972

closes odoo/odoo#64705

X-original-commit: 71b342b8e16973eae9fdc3484b88ed135c5d2834
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-01-18 16:17:49 +00:00
nie f33550e3c1 [FIX] website: page visibility 'connected' leads to a 403 when connected
Steps:
- As admin, go to "Contact us" or any other page on the website (1)
- Go to Pages > Page Properties > Publish
- Change the visibility to Signed In
- Save
- As demo, go to (1)

Bug:
The user "demo" is signed in but is returned a 403 Forbidden

Explanation:
When landing on a page with visibility: 'connected', the only way to see
the page is to have a group matching the groups of the page as seen
here: https://github.com/odoo/odoo/blob/28b748a559e1ffb5fb7c3631bf77adba121b2ebf/odoo/addons/base/models/ir_ui_view.py#L625-L626
This fix lets any connected users see the page.

opw:2431700

closes odoo/odoo#64720

X-original-commit: b02a99bec709b5a6dc4dabb6cb81435dadc24e7e
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-01-18 17:55:30 +00:00
std-odoo fae4f323d7 [FIX] base: specify the charset the the SMTP headers
The emails sent via Odoo reveive a poor score on various spam tools,
the reason being the missing `MIME-Version` message header. This header
inform what MIME version is in use in the message. Even if there is only
one standardized version of MIME (1.0), the header is mandatory.

Citing [rfc2045] "MIME: Format of Internet Message Bodies" section 4:

> the MIME-Version header field is required at the top level of a message.

Setting the charset on the envelop forces the EmailMessage API to also
include the missing `MIME-Version` header.

[rfc2045]: https://tools.ietf.org/html/rfc2045#section-4

Task 2393865

closes odoo/odoo#64715

X-original-commit: 8663f1e20727c315924bb20fc1de1accf3014c61
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
2021-01-18 17:07:52 +00:00
qsm-odoo f7d9d8eaac [REF] doc: update theme & website tutorial + doc
This fixes some details and reorganize the order of the tutorial. It
also introduces a more detailed section for the SCSS customization. A
very detailed and updated version of this tutorial is being made for the
14.0 version and later.

task-2440442

closes odoo/odoo#64700

X-original-commit: 08d44d444490713ca39618a67f441bbd84b8b900
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-18 15:34:48 +00:00
Nasreddin (bon) b86207a418 [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#64692

X-original-commit: 31bc04afc3ed4ea74cd20f71ea10943b1026629c
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-01-18 13:29:17 +00:00
ioFilippo f7407ab2df [CLA] Signed CLA for Rapsodoo
closes odoo/odoo#64685

X-original-commit: 70fd8f68da90b4b66674c56988c0cd73ed4f769c
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-18 12:41:17 +00:00
Adrien Widart f6f6a7dedb [FIX] stock: prevent from deleting reserved lines
When using a tracked product in a MO, the lot/serial number reservation
disappears even if the product is still reserved.

To reproduce the error:
(Need mrp)
1. Create two products P and P_compo
	- Both are storable
	- P_compo is tracked by lots
2. Update P_compo's quantity
	- Set the on hand quantity of lot L to 5
3. Create a MO
	- Product: P
	- Quantity: 5
	- Add a line: (Product: P_compo, To Consume: 5)
4. Confirm
5. Check availability
	- The P_compo's reserved quantity has been updated to 5. If you
click on the line's details, you can see that 5 P_compo has been
reserved from lot L
6. Back to the MO, in edit mode, change the done quantity: 3/5
	- There are still 5 reserved P_compo
7. Click on the P_compo's line details

ERR: the line we saw on step 5 disappeared. The MO says that 5 P_compo
are reserved, but when checking which lot is reserved, the latter is
no more visible. Moreover, if you click on "Confirm" (so you leave the
"Detailed Operations" pop-up), the "Reserved" field of the line will be
reset.

The lot reservation should stay so the user can complete the "Done"
field.

OPW-2420347

closes odoo/odoo#64684

X-original-commit: 8dfee8cb2d60942641b73eaa6489b02aa378c5ac
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-01-18 12:40:52 +00:00
Aaron Bohy ce3c743299 [FIX] web, purchase_product_matrix: can open twice the matrix
Let's assume the following scenario with 'purchase_product_matrix'
module installed:
 - create a new Purchase Order
 - add a line in the one2many
 - select "Customizable desk" as product
 - [the desk matrix opens]
 - close the matrix
 - select "Conference chair" instead
 - [the desk matrix opens, whereas it should be the chair one]

It didn't work because of a small bug in the FieldOne2Many. This
field is configured to be reset when any other field in the view
changes. The product configurator feature relies on that. However,
when another field changes, the One2Many didn't update its internal
state with the new record (and it skipped the rendering, which is
fine). The matrix product configurator thus read an obsolete value
in the internal of the one2many.

Since the internal state is now always up-to-date, we can directly
read there the grid information, instead of looking inside other
fields that have been updated (attempt done in [1])

It would be nice to rethink the whole product configurator stuff
in master, to make it more robust, maybe when converting it to owl?

[1] https://github.com/odoo/odoo/commit/21bcafc053be7f80eed7a684fee2dc1e3caaafa5

opw~2421798

closes odoo/odoo#64683

X-original-commit: 69cadbe1be6320d96fe9bc5bf8dd808f87d735c0
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-01-18 12:39:24 +00:00
Ivan Yelizariev 090b7f1153 [FIX] account: make group_id readonly
WHY: it's computed field that is not supposed to be editable. In previous task
it was asked to make it visible, not editable.

closes odoo/odoo#64676

X-original-commit: f7788fdf03bcf81710f5b01fbf67a90aa30e1e58
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-01-18 11:54:44 +00:00
oco-odoo 88b5491c2f [FIX] account: fix typo
closes odoo/odoo#64675

X-original-commit: 00d69cdaf755271d954c3102dfd49ddcdaae112b
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-01-18 11:53:13 +00:00
jev 4f45e5ea2e [FIX] point_of_sale: already reconciled stock_account_move_line
When the customer use Anglo-Saxon stock valuation and have already
reconciled some `account.move.line` related to an open `pos.session`,
closing the session will fail.
(You are trying to reconcile some entries that are already reconciled)

Now, the reconciled lines are ignored.
The inventory valuation is still correct as these lines were already
reconciled.

opws:
2374559
2376187
2377958
2391395
2425197

closes odoo/odoo#64668

X-original-commit: 3f939af62df65dcb9c8cdd2ecc3ac3d4c2983a2f
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-18 10:53:23 +00:00
Jannik Becher bd9c96e188 [CLA] Sign CLA for Jannik Becher
closes odoo/odoo#64662

X-original-commit: ce4335547aa60ddfe74c1e8247b6d07864ac0088
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-18 10:18:21 +00:00
Ivan Yelizariev fc5607c4d2 [FIX] calendar_sms,hr_presence: add security rules for sms.templates
BEFORE: sms templates from these modules become inaccessible if any module from
the list below is installed

* crm_sms
* event_sms
* stock_sms
* enterprise/account_followup
* enterprise/marketing_automation_sms
* enterprise/sale_subscription

those modules add security rules for sms.templates, which adds additional
conditions to get access: at least one security rule has to be passed. So, we
need to add such rules to give access not only to Superuser

closes odoo/odoo#64661

X-original-commit: 23c82340c1cbd3d5a25d5c2ecec6c7d0f988cd90
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-01-18 10:11:11 +00:00
Swapnesh Shah 7f7db991d6 [FIX] sale_project: use correct variable on validation
`product_name` is correct variable name.

Followup on https://github.com/odoo/odoo/blame/755bdbeb04a769bf1fcf9157f74d6a5deb4ad48d/addons/sale_project/models/project.py#L68

Fixes #64097

closes odoo/odoo#64653

X-original-commit: 9ffd6a62366ce75d125bcab8e1858a05b7c34c74
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-18 08:52:27 +00:00
Laurent Smet 5af64d1758 [FIX] account: Fix statement line rounding issue multi-currency
When reconciling a statement line with multiple lines in a multi-currency environment, it could lead to a rounding issue due to the currency rates. It could lead to an auto-generated open-balance of 0.01 amount to auto-balance the journal entry but the result is wrong since the partner has an open amount left on the receivable/payable account.

closes odoo/odoo#64636

X-original-commit: 4d4e6e588d14742f153a1c6b67d510e0c21e5d64
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-01-15 17:21:20 +00:00
Francois (fge) 568fe91341 [FIX] project: fix various bugs
Restore Project Kanban view for mobile.
Added a name for the default stage of the tasks in the Internal project
Removal of redundancy for the creation of the Internal project and its tasks
Fix task_reccurrence for the type 'after'. (too much task created or bad task created)

Task-2326258

closes odoo/odoo#64607

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-15 12:20:54 +00:00
Nicolas (vin) 069488257c [IMP] account_lock: Update the module description
In order to clarify the purpose of the account_lock module, slightly
update its description.

Task id #2382740

closes odoo/odoo#64559

X-original-commit: f15188907a63d3f50c80c8254e60b9f31a666c55
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-01-14 15:13:37 +00:00
Andrea Grazioso (agr-odoo) 543ccf2efd [FIX] account: compute composition mode before changing template
From Invoice list view select 2+ invoices (A, B), click Action>send and print
In each invoice 2 invoices will be sent:
- In A, you'll find A and A
- In B, you'll find A and B

This occur because the composition_mode of the composer is computed
after the attachment has been generated.
When the composer has an attachment, it is included into
the sent mail along the relevant one, generated on the fly for each record.

opw-2428544

closes odoo/odoo#64445

X-original-commit: 9b585963a4b4f53b856b219004322232c2acf318
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-01-12 17:34:12 +00:00
Laurent Stukkens (LTU) fe5a6cc5e8 [IMP] base, website_crm_partner_assign: increase geoloc precision
Before this commit:

    - The precision on geolocalisation fields were set to (16,5) which
      caused rounding when data was comming from Goolge.

After this commit:

    - The precision on geolocalisation fields are set to (10,7) which is
      aligned with what Google does.

This precision of (10,7) is actually already used in the Sign App.

task-2426985

closes odoo/odoo#64401

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-12 12:11:29 +00:00
Jorge Luis Alfonso 71afa2863e [CLA] signature for jlalfonso21
closes odoo/odoo#64292

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-18 09:03:50 +00:00
Florent de Labarre f239cd546e [FIX] sale_coupon : wrong decorator
closes odoo/odoo#64316

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-01-11 10:31:25 +00:00
Kamesh Patel 3b487088aa [IMP] base: Change default signature for admin demo data
PURPOSE

Currently, the signature of the admin defaults to 'administrator'. Odoo
does not take into account the actual name of the user.  The onboarding
experience would be better if the signature was personalized
for the user.

SPECIFICATIONS

The default signature of the admin is his name (Mitchell Admin) instead of 'Administrator'.

Task-2416715

closes odoo/odoo#63914

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-05 10:24:43 +00:00
Nisha patel 09aa28c0d0 [IMP] various: generic improvements of the various module
Purpose of this task is to improve the various modules like crm_iap_lead, hr,
hr_timesheet, product, project, web.

So in this commit done the below changes:
- timesheet: project is open in the form view insted of the quick view
- earlier the popup window notification is sticky so after this commit it will
  disappear automatically after a few seconds
- product form view: 'extra prices'  display as a link
- project sample data: move the helper a bit higher in mobile view
- CRM > Generate leads > industries > search more: rename 'tag name' into
 'Industry'
- preferred_role_id: 'ceo' written in all caps
- employees kanban view: the chat icon  aligned to the bottom of the card
- move the project tour droplet to the right of the add button.

closes odoo/odoo#63693

Task-id: 2374726
Related: odoo/enterprise#15426
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-01-07 10:34:36 +00:00
William Henrotin 7fa9ec2638 [IMP] stock_account: create account moves in batch
This commit groups creation and posting of account moves related to
stock valuation in case of automatic valuation product.

Previously, the account move were created one by one and posted right at
the creation. Which can really slow (for instance running
_run_fifo_vaccum with a large amount of remaining quantity layer)

closes odoo/odoo#62700

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2020-12-08 13:40:54 +00:00
Ibrahima Gueye e95b9c068f [CLA] update optesis CCLA
Remove Abdel Rahaman TOUKOUROU

closes odoo/odoo#64407

X-original-commit: 802ee59a8d458ffb85455c547ceb89c185a5fb64
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-12 13:16:18 +00:00
Christophe Monniez 2949138a7d [IMP] various: use the barcode qweb widget whenever possible
When using the route `/report/barcode/...` in a report, wkhtmltopdf
makes htpps requests on the server to retrieve the barcode image.
If a lot of barcodes have to be printed, this can overload the server
with too much requests and makes wkhtml crashes.

With this commit, the qweb barcode widget is used to include the barcode
as an img tag with inline barcode image as base64 data.

closes odoo/odoo#64211

Related: odoo/enterprise#15619
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-01-12 12:50:23 +00:00
Christophe Monniez db8b3f1dbf [IMP] base: improve qweb barcode widget
When printing barcodes for a large amount of records, wkhtmltopdf will
make the same amount of http requests to the server in order to retrieve
barcodes. This can lead to performance issues or wkhtml to crash.

Fortunately, an already existsing qweb widget exists that include
barcodes images as inline base64.

With this commit, the web widget is a bit improved to accept attributes
for the generated image tag. Each option dictionary key starting with
`img_` will be converted into a tag attribute with the corresponding
value.

e.g.: `'img_alt': 'Barcode'` will result in `<img alt="Barcode"...`

The `alt` img attribute now defaults to `'Barcode %s' % value` with the
barcode value.

Also, the `quiet` reportlab option is also avalaible in the widget
options, as well as the `mask` option.

Finally, if the `symbology` option is not given, the widget defaults to
`Code128`. If `symbology` is set to `auto`, the action report will try
to guess the barcode type, based on the len of the value.
2021-01-12 12:50:23 +00:00
qsm-odoo 5ab2771d30 [FIX] website_form: adapt editor list widget design
The design was not properly adapted to the last changes before the 14.0
release and still contained some invalid properties. Now the list inputs
match the design of the normal inputs.

closes odoo/odoo#64400

X-original-commit: fe102c04c0526cb7aa547f146974cdfb80629723
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-12 12:03:30 +00:00
Martin Trigaux ade40f9028 [I18n] *: export saas-14.1 source terms
closes odoo/odoo#64393

X-original-commit: eaf7ec38b2f13b044768ccb457c5523cd24753f6
Related: odoo/enterprise#15693
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-12 10:38:54 +00:00
Samuel Degueldre 2f2ea71301 [FIX] web: fix colorpicker "unknown CORS error" on safari
Previously, when opening a colorpicker in safari, the crash manager
would open with the message "An unknown CORS error occured [...]". This
is actually odoo's default message when an error has no file, line or
column, which is usually the case for security reasons on CORS error.
This is however not a true CORS error, but a "ResizeObserver loop
completed with undelivered notifications" error, which also does not
report file, line and col for the error.

This error is caused by the fact that in webkit, the baseline of an
empty input is considered to be at the bottom of the input element,
rather than at the baseline of the text of the input once it has some
content. (see https://bugs.webkit.org/show_bug.cgi?id=142968 )

In the case of the colorpicker, it uses a ResizeObserver to update its
UI, including updating the content of its inputs. This will cause the
first _updateUI to fill the empty inputs, which changes the layout of
the widget content and changes its size. Changing the size of an element
inside of a handler of a ResizeObserver on that same element will cause
an error and not call the callback again, so as to prevent infinite
loop.

This commit fixes that by filling the inputs before attaching the
ResizeObserver, so that it has its final size from the get-go, and
_updateUI will no longer change the layout/size, causing this error.

opw-2419296

closes odoo/odoo#64389

X-original-commit: 5e9e35ef0d7b0cdecc5c25dc4db04925ed0408a6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-12 10:09:31 +00:00
Goffin Simon a767c5155b [FIX] payment_stripe: Bancontact with mobile
Steps to reproduce the bug:

- Let's make a bancontact payment with Stripe on mobile from the web shop
- Stripe redirects you to Odoo
- Your phone asks on which browser you wanted to redirected to Odoo
- Choose one

Bug:

An internal error was raised.

When you clicked on a browser (the same you were using or a new one, whatever)
Odoo will resend a request to Stripe. But this request will have wrong data in it.

Stripe will answer with:

Stripe: entering form_feedback with post data {'error': {'code': 'resource_missing',
'doc_url': 'https://stripe.com/docs/error-codes/resource-missing',
'message': "No such payment_intent: 'py_1I6c4UKhH8RhRq18TJs2CP0z'",
'param': 'intent',
'type': 'invalid_request_error'},
'reference': 'S00002-1'}

opw:2422031

closes odoo/odoo#64385

X-original-commit: a42075c9f913f4a20b28f97f0f6786f5a7b2968a
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-12 09:52:08 +00:00
Goffin Simon 14a1c6b21c [FIX] hr_fleet: mobility card on employee not repercuted on vehicle
Steps to reproduce the bug:

- Let's consider a partner P linked to an employee E and a vehicle V
- Let's change the mobility card of E with 12345

Bug:

The mobility card on V was not changed.

opw:2431316

closes odoo/odoo#64343

X-original-commit: 81e574aae3059844179dd9f54a241cd51a2474fd
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-11 14:54:51 +00:00
erik-bzcl 90e721d9af [CLA] Corporate signature for Bizi Software SRL
closes odoo/odoo#64374

X-original-commit: f29c6b1ffcbcfdf12d848df8ee427cc11d2df123
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-12 08:28:51 +00:00
Samuel Degueldre 3bb892cfab [FIX] web_editor: fix icons losing classes when modifying them
Previously, when double clicking and image, video, icon, or document in
the web-editor and replacing it with a different media type, it would
lose its custom classes. This means among other things, that it would
lose margins and paddings from bootstrap classes, or in the case of the
three columns snippet, that the new media would not be properly rounded
in its top corner, or not show up at all in the case of the video. The
only exception was when changing any media type to an icon, but in that
case it would also keep some of the media-specific classes that are
supposed to be removed (eg img-fluid or media_iframe_video).

This commit fixes that as well as some _clear behaviour that didn't
remove all classes that had to be removed, eg some fa-classes would
linger depending on their order, and the o_image class from documents
would always remain

Part of https://github.com/odoo/odoo/pull/64234
task-2282542

closes odoo/odoo#64234

X-original-commit: 99531f5dd8966fc4ad89d1e9c2886ad701527f3a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-12 06:52:14 +00:00
Samuel Degueldre 398259c93f [FIX] web_editor: fix replacing media leaving unexpected elements
Previously, changing a media from a video/icon/document to a different
type would leave empty elements in the DOM, this is because summernote's
range API `range.insertNode` function deletes the content but not the
structure (HTML elements).

This commit fixes that by using jQuery's replaceWith method instead of
summernote's insertNode when a media was found, and only using
summernote in case no media was found (eg. a text range).

Part of https://github.com/odoo/odoo/pull/64234

X-original-commit: 63f80995a05eeab1061b769c7733a1cfa98c726e
2021-01-12 06:52:14 +00:00
David James a2cb36e854 [CLA] signed by davejames
closes odoo/odoo#64289

X-original-commit: 30a0a5ced3a90c73fbec322a447e741b4b677ca2
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-08 17:36:18 +00:00
张文广 44ca035641 [CLA] Zhang WenGuang signs personal CLA
closes odoo/odoo#64287

X-original-commit: 640610a39b7acc6a2840443e895266e8a64320a6
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-08 17:31:11 +00:00
Romain Derie ec132b530f [FIX] web_editor, website: prevent multiple click on save
Clicking on save on html editor is taking quite some time. The user might think
something is not happening and need to click again.
If he does click again, 2 write RPC will be sent, making the COW business code
being triggered twice, ultimately leading to create 2 COW.

Instead of
  A
 / \
B   B'

It will be
    A
  / | \
B   B' B'
With as many B' than there is click on save.

This commit adds a generic helper to make a button load/spin.

closes odoo/odoo#64366

X-original-commit: 80592abda266ef3f9f463854c3101eb3f728087b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-01-11 18:41:32 +00:00
Ivan Yelizariev d20f10c0c1 [FIX] point_of_sale: respect setting only_round_cash_method
STEPS:
* configure rounding:
  - cash_rounding=True
  - only_round_cash_method=True
  - round method: 1.0 Down

* open a session
* add products with subtotal in decimals (such as 6.35)
* select Bank payment method and process the order

BEFORE: error "You have to round your payments lines"

AFTER: order is processed and marked as paid

---

https://github.com/odoo/odoo/commit/42425996e36d9cb1fc1391402cf6d00df4aea019
opw-2426027

closes odoo/odoo#64351

X-original-commit: db0b65e547defe3d49c1a31c4671f546aa5156e8
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-01-11 15:45:33 +00:00
Sébastien Theys 508a2bbc96 [FIX] mail: adapt useStore test to OWL v1.2.1
The intent of the test was to count renders but it counted calls to `onUpdate`
which was the same "by luck", but the function was changed to be called more
often than renders to fix another bug.

Proper way to count renders (after the initial mount) is just to use `patched`.

closes odoo/odoo#64352

X-original-commit: c7375ebaf8d4baa6e02534425ed634c7264ce90f
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-01-11 15:46:39 +00:00
Aaron Bohy 9fc79bbf14 [FIX] web: update owl to last version
This commit updates owl from v1.2.0 to v1.2.1

See [1] for the list of changes.

[1] https://github.com/odoo/owl/commit/25738a1bf08ff47b2d8cb7b7c57d3bf4a7e1caa7

X-original-commit: 1e87d7b65bdfef323a6cdae3a54b3beb6aacf3b4
2021-01-11 15:46:37 +00:00
Adrien Widart fa2837b924 [FIX] account: sending several invoices at one
When sending several invoices, customers also receive those that do not
concern them.

To reproduce the error:
(Need mailcatcher)
1. Go to Invoicing
2. Select two invoices
    - Status must be "Posted"
    - Customers must be different
3. Action > Send & Print
4. Uncheck "Print", then click on "Send"
5. Repeat 2-4

Err: Each customer receives both invoices. (In some cases, a third mail
is event sent). Each customer must receive his own invoices.

The mail composer wasn't correctly configured.

OPW-2422117

closes odoo/odoo#64340

X-original-commit: 603752df5444f60ac7282758c7e6596940747889
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-01-11 14:04:28 +00:00
William HenrotinandJuppe 2d0a413f82 [FIX] stock: from from_date domain
Commit c2c9d6d143 changed the inequality sign unintentionally.
This commit change it to the right value

closes odoo/odoo#64334

X-original-commit: 217d9201deea06d36a7417f54360cb695f70212d
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Co-authored-by: Juppe <johan.totterman@sprintit.fi>
2021-01-11 12:35:16 +00:00
Arnold Moyaux 49be9e4904 [FIX] stock: Add index for free reservation
Free reservation is called each time an extra quantity is
used on a move (and for each immediate transfer). It means
that the function is called many times on a database with an
inventoy activity. Also _free_reservation method do a search
on fields that are not indexed, and is slow on large database.

This index is specific to _free_reservation.
On a live database with an important stock, the queries dropped from 265ms
to 1.5ms.

closes odoo/odoo#64327

X-original-commit: 74ea87d0a354b7414afb76d98ed39ecde45a8fb1
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-01-11 11:46:29 +00:00
Adrien Widart 31bf2fd446 [FIX] mrp: reordering rules for BoM product
When running the scheduler, if one of the concerned product  is a
kit, it will always generate a RfQ for the components, even if there
are already enough of them.

To reproduce the error:
(Need purchase)
1. Create 2 products P and P_compo
	- Both must be storable products
	- P_compo must have at least one vendor
2. Go on P-product page
3. Add a reordering rule (e.g., min: 5 and max: 10)
4. Add a BoM
	- Must be a Kit
	- Add P_compo to components
5. Inventory > Operations > Run Scheduler
6. Go to Purchase, find the generated RfQ
7. Confirm the order, Receive Products, Validate
8. Go on P-product's page
	- As you can see, you have enough P-products on hand
9. Repeat steps 5-6

=> You should not find any RfQ since you already have enough P-products.

When checking the P-product's page, you can see the correct quantity on
hand because it uses the `_compute_quantities` method and this one has been
overridden in the mrp-module so a kit will be correctly computed.

However, when running the scheduler, it uses another method to get the
current quantities: `_compute_quantities_dict`. Since this method has
not been overridden in mrp-module, it will use the basic implementation
and this one does not consider the possibility for a product to be a
kit.

This fix creates an override of `_compute_quantities_dict` so it can
compute the correct quantities of products with 'phantom' as BoM type.
Moreover, for the code to be simpler and clearer, thix fix also merges
`_compute_quantities` and the new `_compute_quantities_dict`.

OPW-2421841

closes odoo/odoo#64326

X-original-commit: 609e2f4427082431b56aa8f999d74ed9d39db653
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-01-11 11:46:01 +00:00
nie 23233a7051 [FIX] tools: try decrypting PDF with empty password
Steps:
- Install accounting
- On the dashboard, try to upload an "encrypted" PDF like this one https://launchpadlibrarian.net/24827090/DS-0157.pdf

Bug:
Traceback:
PyPDF2.utils.PdfReadError: file has not been decrypted

Explanation:
In 13.0, these errors were caught in a catch all `except` as shown here: https://github.com/odoo/odoo/blob/4e089041252c25cc197a30f9e285d82f7162d809/addons/account_facturx/models/account_move.py#L303-L328

From this SO comment: https://stackoverflow.com/questions/52047944/pdfbox-extracting-blanks-from-pdf-encrypted-with-no-password#comment91054285_52047944

> A PDF can be encrypted with two passwords: a user password and an owner password. When a PDF is encrypted with a user password, you can't open the document in a PDF viewer without entering that password. When a PDF is encrypted with an owner password only, everyone can open a PDF without that password, but some restrictions may be in place.

From time to time, we get a PDF encrypted with an owner password. The
content is still readable, but PyPDF2 fails because it thinks the PDF is
encrypted. With this fix, we try to unwrap the PDF by providing an empty
user password. This way, PyPDF2 thinks the content is now decrypted.

However, PyPDF2 only supports decrypting versions 1 and 2 of the
encryption implementation. If the version is different, we skip reading
the attachments and carry on to allow the user to upload the document.

opw:2375993

closes odoo/odoo#64320

X-original-commit: 851fe64f7789bb398383c22e3ebbaebb051791f6
Signed-off-by: backspac <backspac@users.noreply.github.com>
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-01-11 10:56:43 +00:00
wan d9ab32fef8 [FIX] account: dashboard view cash statements
Fine tuning of 78286851034b8f3ef4dcab78e50b7220c0bdd213

The link to view Cash Statements on the dashboard openned the wrong
action.
Also in some cases, removing the context key `search_default_journal`
was not enough so we set it to `False` instead.

closes #64118

closes odoo/odoo#64279

X-original-commit: 95ffa9fd122eae82d12d40db3cb7364cf3d3c919
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: wan <william-andre@users.noreply.github.com>
2021-01-08 16:42:38 +00:00