Commit Graph
140847 Commits
Author SHA1 Message Date
Rémy Voet (ryv) 19c94935b4 [REF] stock: remove index on date of stock.picking
The `date` fields is only used in the `_accumulate_amounts`  of
point_of_sale and is set at now or by the `_prepare_picking` of purchase
(maybe will be remove in the futur).
In all case, and for now, the index is not
used (expected by at a custom search) and should be remove.

task-2389380
2020-12-22 12:43:00 +00:00
Rémy Voet (ryv) 876c2c33e8 [REF] mrp: remove indexes of mrp.production (date_x)
Remove index on fields `date_start` and `date_finished`. Both
has not used expected in the gantt view `view_production_gantt`
which not used anymore (and have no sense because it should use
`date_planned_start` and `date_planned_finished` instead.
Remove this old gantt view too.

task-2389380
2020-12-22 12:42:59 +00:00
Rémy Voet (ryv) e74ecbbd6c [REF] mrp: remove index on state (mrp.unbuild)
The state of `mrp.unbuild` is a boolean value (`draft` or `done`) which
is already quite useless in the most of the case. Also this state is
never used explicitly in the code (in a search), then it seems legit to
remove it.

task-2389380
2020-12-22 12:42:59 +00:00
Rémy Voet (ryv) cb51c179d2 [REF] stock: remove index on auto of stock.rule
A index of a 2 values columns is quite useless, and it is a
lost of storage for nothing. Also, in this
case it will be never used (expected in manual search).

task-2389380
2020-12-22 12:42:59 +00:00
Rémy Voet (ryv) 58fc9e2733 [REF] stock: remove index on name of stock_move
The `name` fields of `stock.move` is use differently (sometimes it is
contains info of related product, other time the parent document, ...).
But in all case we never search directly on the name of the move, then
we remove the index related to.
Also remove useless keyword `index=True` for the `backorder_id`

task-2389380
2020-12-22 12:42:59 +00:00
Rémy Voet (ryv) e3423d3f28 [REF] stock,mrp: remove index of priority fields
Indexed of boolean values is quite useless and the one of `priority`
(MO/Pickings) can be only used in filter search view (`starred`).
Then remove priority indexes from `stock_move`, `stock_picking` and
`mrp_production`.

task-2389380
2020-12-22 12:42:59 +00:00
Rémy Voet (ryv) e874a1e3de [REF] stock: remove index in create_date of stock_move.
The index on `create_date` was never used in standard expect in
the group_by of the search but onlu visible in debug. Then
remove the index related too (implies to remove the custom definition
in stock_move). Remove invisible create_date fields in views.

task-2389380
2020-12-22 12:42:59 +00:00
Rémy Voet (ryv) 5389259579 [IMP] stock,mrp: improve populate
- Add BoM byproduct populate
- small improvement for populate of stock location
2020-12-22 12:42:59 +00:00
Nidhi Patel f3725a3dde [FIX] hr_holidays: Fix display of a wrong warning message
Currently, when we create time off and does not add 'Start Date' or
'End Date', it displays a wrong warning.
Issue is occur because date_from is required field at db level and it's
value computed based on visible field request_date_from which is
non-required field and when you keep that empty it will raisse the
contraint instead of required error.

So in this commit, we make request_date_field field required from view
and also make request_date_to visible based on condition so it should
fill the proper value inside the date_from and date_to.

closes odoo/odoo#63222

Taskid: 2352360
X-original-commit: c54f445ceae72518f787f43213ec78a9a7e1b1eb
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-11 11:00:42 +00:00
Goffin Simon a6fd6d499c [FIX] point_of_sale, pos_sale: Field crm_team_id not defined
Fine tuning of https://github.com/odoo/odoo/commit/61e5389236ad767827ef2fe039aa78b20848298e

opw:2418806

closes odoo/odoo#63959

X-original-commit: 277c24599c8a9d6e9af2075d16c505c200643163
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-12-31 18:01:23 +00:00
Andrea Grazioso (agr-odoo) 63e8c3066a [FIX] hr_recruitment: be able to see archived applications
- create 2 applications in Odoo Recruitments with the same email
- Notice how they both have a stat button that indicates that this
applicant has another application.
- Refuse one of the 2 applications

The stat button disappear because it ignores archived records, while it
should indicate if someone has already applied in the past

opw-2423158

closes odoo/odoo#63926

X-original-commit: caaef5829b51f7e5862a6d730ea978e19deadd42
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-12-30 16:58:47 +00:00
Andrea Grazioso (agr-odoo) b3a23aa0e8 [FIX] mrp: avoid traceback on company reset
- Create a new MO
- Remove the company name

The user see a traceback

This occur because the compute method does not check if the company is
set

opw-2422441

closes odoo/odoo#63917

X-original-commit: b7fa0cfad03a8319f03c1aa89eb67635e1200f67
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-12-30 14:30:16 +00:00
Nasreddin (bon) e0305dee9c [FIX] web: calendar_controller: Adapt date to server format on update
Issue

	- Install "Time-Off" module
	- Set user language to "Arabic"
	- Open "Time-Off"

	Traceback raised.

Cause

	On update, JS send to backend date in arabic.
	Python 'datetime' library does not manage arabic date.

Solution

	Convert date format for the "server" on js-side.
	In this case, it will also translate arabic numbers.

	Also, adapt "dateToServer" to handle any format.

opw-2421268

closes odoo/odoo#63928

X-original-commit: c11e0fe2673fd18e6db45fd18a153042d525990a
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2020-12-30 17:39:42 +00:00
xO-Tx 01dd2ffc11 [FIX] website_mail_channel: fix discussion group snippet without group
Prevent crash while trying to subscribe to a non existing channel from
a misconfigured snippet.

Also now let the user create the channel linked to the discussion group
directly on snippet drop if no channel is available to select
automatically.

task-2356955

closes odoo/odoo#63854

X-original-commit: 5bb8821c0a78df5c03458a2c902e1a9c7a12f2f9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-30 16:00:56 +00:00
Ivan Yelizariev f0eb701360 [FIX] base_data.sql: remove obsolete field size
those field sizes were deleted from orm definition in 2014 https://github.com/odoo/odoo/commit/026e38b48f3963aed08bba4e76a0a796d662f6a4

STEPS:
* set manifest's summary attribute to a long string
* create empty database

BEFORE: error

```
2020-12-28 10:44:51,325 1 ERROR ? odoo.sql_db: bad query: UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')
ERROR: relation "ir_module_module" does not exist
LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
               ^

2020-12-28 10:44:51,325 1 ERROR ? odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 338, in load_modules
    odoo.modules.db.initialize(cr)
  File "/opt/odoo/custom/src/odoo/odoo/modules/db.py", line 63, in initialize
    info['sequence'], info['summary']))
  File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 173, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 250, in execute
    res = self._obj.execute(query, params)
psycopg2.DataError: value too long for type character varying(256)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/odoo/custom/src/odoo/odoo/modules/registry.py", line 88, in new
    odoo.modules.reset_modules_state(db_name)
  File "/opt/odoo/custom/src/odoo/odoo/modules/loading.py", line 558, in reset_modules_state
    "UPDATE ir_module_module SET state='installed' WHERE state IN ('to remove', 'to upgrade')"
  File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 173, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/odoo/custom/src/odoo/odoo/sql_db.py", line 250, in execute
    res = self._obj.execute(query, params)
psycopg2.ProgrammingError: relation "ir_module_module" does not exist
LINE 1: UPDATE ir_module_module SET state='installed' WHERE state IN...
```

AFTER: database successfully created

---

opw-2415057

closes odoo/odoo#63912

X-original-commit: 2a44e233deffd17460e0e9a8f8225602a28c24a6
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-12-30 11:50:07 +00:00
qsm-odoo 923ae6415c [FIX] web_editor: fix post-JW revert button edition
Failed to remove a line at conflict resolution during JW revert at [1].

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

task-2424849

closes odoo/odoo#63908

X-original-commit: 15fd0b765d38199961d4210f362770216af23a42
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-30 11:09:20 +00:00
Goffin Simon 0cb2c0ebbf [FIX] point_of_sale: Sales Team set on POS didn't appear on invoice
Steps to reproduce the bug:

- Let's consider a sales team ST and a POS session PS
- Set ST on PS
- Open PS and make an invoice I from an order

Bug:

The sales team set on I was not ST

opw:2418806

closes odoo/odoo#63898

X-original-commit: 61e5389236ad767827ef2fe039aa78b20848298e
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-12-29 19:15:13 +00:00
Florent de Labarre 6ec916bc74 [FIX] sale_stock : widget wrong value
closes odoo/odoo#63896

X-original-commit: 257cfeeda708cade0bd19b64eb8a95b3f61a063d
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-12-29 18:29:33 +00:00
Rémy Voet (ryv) 5199fb34f0 [FIX] mrp: avoid write product_tmpl_id from BoM line model
`product_tmpl_id` of BoM line should be readonly,
there is no sense to change the product template from
the BoM line model. Also it avoids useless write on product
and inverse recomputation.

opw-2420830
closes #63631

closes odoo/odoo#63890

Issue: odoo/odoo#63631
X-original-commit: 5a4746141670bdd241d85c7908a57ee9efa56c3f
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2020-12-29 15:58:07 +00:00
Adrien Dieudonne 89beb798ff [REF] *: o_button_import doesn't exist anymore
closes odoo/odoo#42082

Related: odoo/enterprise#15492
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-12-29 13:41:25 +00:00
shreya thakrar 3b63b3a4d7 [IMP] account: add kanban view for the 'Generated Documents'
This commits adds kanban view for the 'Generated Documents' for better
readability on mobile devices. Also, for consistency, this commit
adds 'Upload' button on the invoice kanban view as well.

Task-ID: 2152183
2020-12-29 13:39:37 +00:00
Adrien Dieudonne 04ed2dec6f [FIX] account: open form view when single invoice generated
Before this commit, there was no difference whether multiple invoices
were uploaded or not. The list view was always opened.

Now, the form view is automatically opened when a single bill
is uploaded.

Task-ID: 2152183
2020-12-29 13:32:55 +00:00
nie d118d8ff50 [FIX] hr_holidays: untranslated 'Hours' in hr_leave
This translates 'Hours' when displaying the number of unpaid hours.

closes odoo/odoo#63876

X-original-commit: 09d1e18eb401990a14d850e07a55cff498b30ac5
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-12-29 11:24:22 +00:00
nie 37bc6b52a7 [FIX] hr_holidays: float representation issues with 38 hours schedule
Steps:
- Install Time Off
- Go to Employees
- Click an employee (A)
- Change Work Information > Schedule > Working Hours to "Standard 38 hours/week"
- Go to Time Off > Managers > Time Off
- Click Create
- Select employee (A)
- In the title, select Unpaid
- From 2020-12-20 to 2020-12-24

Bug:
Float representation issue: 4.00 Days (30.400000000000002 Hours)

Explanation:
Changing formatting of `number_of_hours_text` from '%s' to '%g'. This affects the way this value is displayed: 0.0 Hours is now 0 Hours.

opw:2418740

X-original-commit: 0bbd31ca0a2c24fac55e2f6277d727a1d0c58c54
2020-12-29 11:24:20 +00:00
Achraf (abz) 7c7822bd7d [FIX] website_slides: Complete courses with video
What are the steps to reproduce your issue ?

    1. Install ELearning
    2. Create a course
    3. Add a video from youtube
    4. Attempt to do the course from a user that is invited

What is currently happening ?

    You cannot complete a video (turn the checkmark green) if there is not a quiz. Therefore you cannot complete the course

What are you expecting to happen ?

    Turn the checkmark green to signify that video is completed after watching the video and then have the ability to complete the course

Why is this happening ?

    Because of this commit https://github.com/odoo/odoo/pull/61581/files
    that changes 'youtube.com' to 'youtube-nocookie.com'

How to fix the bug ?

    Remove host

opw-2418545

closes odoo/odoo#63878

X-original-commit: 484957caf89e0f324dffda6f2ac0a1ca543b969b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-12-29 11:29:08 +00:00
Krupa Patel 03c3996ef5 [FIX] website: fix edit mode shadow effect on images
Fix box-shadow effect to fit perfectly on the product shop grid layout
and product carousel.

task-2206930

closes odoo/odoo#63877

X-original-commit: 90585878cfd68ab258eb38c2c7622a5e88d6396a
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-29 11:25:32 +00:00
nie 231b367d16 [FIX] l10n_multilang: COA translations overwritten with new company
Steps:
- Install "Belgium - Accounting" and "Accounting"
- Add the Dutch language in settings
- Select a Belgian company
- Go to Accounting > Configuration > Chart of Account
- Select an account like "755000 Financial income - Foreign currency translation differences"
- Change the translation of the account name in English and Dutch
- Create a new company in Settings > Companies
- Select this new company
- Go to Accounting > Configuration > Settings, set the Fiscal Localization to Belgian PCMN and save
- Return in the first company
- Go to Accounting > Configuration > Chart of Account and check the translations you previously set

Bug:
The Dutch translation has been reset and the English one remains the same.

Explanation:
`process_coa_translations()` uses `spoken_languages` as seen here:
https://github.com/odoo/odoo/blob/bb31ce3bc6c0c7e1e101d93924eccea995206733/addons/l10n_multilang/models/l10n_multilang.py#L67
The spoken languages are defined here: https://github.com/odoo/odoo/blob/f4e7e06a1ff9756471d55138575c758f456b5905/addons/l10n_be/data/account_chart_template_data.xml#L10
This is why English is not affected.

The bug appeared with https://github.com/odoo/odoo/commit/c346e7af3314ce504fe3add9e9f6a4839bcad64a
It was meant to apply Chart of Account translations on the current company but applied it on all the companies. This reset edited translations on the other companies.

This commit refactors `process_coa_translations()` so that we can use the same logic on a single company while keeping the definition of the original function intact.

opw:2376334

closes odoo/odoo#63866

X-original-commit: 45e6309aa1d79d06c7110c86205781874ab44e30
Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-12-29 09:25:50 +00:00
Goffin Simon a6a1d52b4e [FIX] sale: Product with a blocking warning raises a traceback
Steps to reproduce the bug:

- Let's consider a product P with a blocking message BM
- Create a quotation Q and set P on it

Bug:

A traceback was raised.

opw:2421946

closes odoo/odoo#63853

X-original-commit: e0af10ccc92cb3b07f0eea6fa44ebf5a1bdc86aa
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-12-28 16:59:10 +00:00
Samuel DegueldreandKishan Gajjar 0015426708 [FIX] web_editor: show currently active aspect ratio in crop widget
When changing the crop widget from being inside of a modal window to
using an inline crop widget, the functionality to show the currently
active aspect ratio was lost. This commit restores that behaviour.

Linked to https://github.com/odoo/odoo/issues/57604

closes odoo/odoo#63859

X-original-commit: df339cd0d65913548646abe6ca8182f06554333c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Kishan Gajjar <kishanegajjar@gmail.com>
2020-12-28 19:18:09 +00:00
Samuel Degueldre 89d70f198f [FIX] web_editor: fix shape transparency colorpicker appearing on parent
Previously, when adding a shape to a child element of a snippet, the
colorpicker to configure the shape's transparency color would also
appear on the snippet itself. This was caused by the selector for the
option not being specific enough, and finding the shape of the child as
a target, and thus showing up in the snippet menu.

This commit fixes the selector so that it only finds the current snippet
own shape, and not shapes of its children.

task-2390341

closes odoo/odoo#63857

X-original-commit: 26abfd452dac2a778e4e2ba4c1c26a0896e82565
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-28 18:30:15 +00:00
Adrien Widart acd8e09666 [FIX] website_jitsi: participant count after last leave
When leaving the Jitsi meeting, if the participant is the last one, the
meeting participant count will still be 1.

To reproduce the error:
1. Go to Events
2. Create and Save an event
3. Go to associated Rooms
4. Create and Save room R
5. "Go to Website" (on R's form)
6. Join the meeting
7. Leave the meeting
	- Use the "Leave" icon
8. Go back to R's form

=> "Participant count" is still set to 1.

This fix ensures the participant count will be 0 when nobody is in the
room. However, it will only work if the participant uses the "Leave"
button. So, for instance, if the last participant directly closes the window
to leave the meeting, the participant count will be incorrect. This is a
consequence of Jitsi which does not provide a way to get the number of
participants in a meeting (see file for more details, L119-142).

OPW-2416995

closes odoo/odoo#63852

X-original-commit: 07bb73f133db661f3061c679af15293dbcf8ba38
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2020-12-28 16:58:47 +00:00
Adrien Widart fa68c23276 [FIX] account: read invoice of archived partner
If a user has the portal access, when going to his documents, if one of
them belongs to an archived partner, it will raise a 403 error.

To reproduce the error:
1. Go to Settings > Invoicing > Customer Payments
2. Enable "Invoice Online Payment"
3. Create a customer C
	- Set a name
	- In Contacts & Addresses, add two contacts C_01 and C_02
		- Both are "Invoice Address"
		- Add a valid email for C_01
4. Go to Customers > C_01, Action, Grand portal acess
	- Check "In Portal", Apply
5. Go to Settings > Users & Companies > Users
6. Remove the search filter, Select C_01, Add a password
7. Create an invoice INV
	- Customer: C_02
8. Connect to C_01's account
9. Click on "Invoices & Bills"
	- The invoice INV is listed
10. Connect to admin's account
11. Go to Customers, Archive C_02
12. Repeat steps 8-9

=> A 403-Forbidden page is displayed with a traceback.

For a user to have access to the "Invoices & Bills", one of the
followers of each invoice must be part of the same commercial partner:
`('message_partner_ids','child_of',[user.commercial_partner_id.id])`.
Here is the issue: if archived, the partner will not be in the
`message_partner_ids` list. This is the reason why, in our case, C_01
can no longer access the documents.

This commit allows the archived partners to be listed when getting the
portal transactions.

OPW-2417275

closes odoo/odoo#63790

X-original-commit: ad36feae0a1ee6fe0bdfbb622685a6b143ea4f2a
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2020-12-24 16:25:09 +00:00
Benjamin Vray bf2f9e20df [FIX] website: fix top action buttons padding
Before this commit, the padding of the top action buttons in the editor
(save, discard and undo buttons) was related to the buttons padding
options of the theme.

After this commit, the padding of those buttons doesnt change with the
theme padding value.

task-2349723

closes odoo/odoo#63851

X-original-commit: 5f9a6eb80697dbfd0649c8be946b8cb9d7c0f893
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-28 16:57:40 +00:00
xO-Tx 86f0b53797 [IMP] website: update default theme tour
The goal of this commit is to update the default theme
tour (steps, changes on snippets...) as in other themes tours.

The url was changed in "registerThemeHomepageTour" function since
the homepage tours are supposed to start in edit mode.

task-2375011

closes odoo/odoo#63850

X-original-commit: b8b394f3824a1f07d76bed5f277b935f619dacbf
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-28 16:53:13 +00:00
Achraf (abz) fa5af20ba7 [FIX] odoo_tools/mail.py: Crash at html2plaintext if no tree
What are the steps to reproduce your issue ?

    1. Install website_blog
    2. Go to website and add a new blog post
    3. Remove the block content
    4. Save and go to Blog page

What is currently happening ?

    Crash:
    Template fallback
    An error occured while rendering the template website_blog.post_teaser

opw-241937

closes odoo/odoo#63844

X-original-commit: d9097c2b6244154ea64142b5e8fd31cfdd34e66e
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-12-28 16:03:40 +00:00
Benoit Socias 28f0853a2d [FIX] web_editor, test_website: will fix the deletion of custom snippets
This commit is a manual forward port of #62555. The tour test needed to
be adapted because the navigation flow is slightly different: upon
custom snippet creation, the editor page used to be saved and reloaded
in 14.0 but this is not the case anymore.

Before this commit the deletion of custom snippets failed because the
button click event got intercepted by the drag'n'drop mechanism.
The currentTarget of the event was used in an asynchronous call where it
had already been replaced by the jQuery's event bubbling mechanism when
invoking the other handler.

After this commit the deletion of custom snippets works again and a test
tour is introduced to make sure it does not get broken again

task-2405854

closes odoo/odoo#63108

X-original-commit: 4de0519d5b54634604e22b32d91a099695378088
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-10 08:28:14 +00:00
Antoine Vandevenne (anv) 5355ef5f92 [IMP] doc: add link to tutorial in client actions reference doc
The doc for client actions is currently too minimalistic to be of much
use. This commit adds a seealso linking to the related tutorial.

task-2423824

closes odoo/odoo#63830

X-original-commit: 386e57cf48298162cd4c3bedfa6eb83d6ba4f6bd
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
2020-12-28 13:09:45 +00:00
qsm-odoo d624a4f4f5 [FIX] web_editor: stop suggesting shapes for model-related images
Those kind of images use a specific route (/web_editor/shape/...) to
be fetched. While waiting for a more complete solution to maybe handle
them for model-related images, this commit only allows their use for
images in views and HTML fields.

closes odoo/odoo#63825

X-original-commit: dca6d7382e5d84997648952d442ad77df5d6ee82
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-28 11:54:19 +00:00
Wolfgang Taferner 1e6dce9d4e [FIX] account: onchange of product and uom should not use currency rounding
As the price_unit and the uom rounding can be more detailed than the currency/accounting rounding (2 decimals as a standard) to cut the number before subtotal is wrong.

closes odoo/odoo#63817

X-original-commit: 1b4005f50ac45b53a73e0b95cfb661e8ccf040cd
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-12-28 10:21:46 +00:00
nie a47143ed6e [FIX] coupon: public user cannot use promo code with edited rule
Steps:
- Install eCommerce
- Go to Website > Products > Promotion Programs
- Create a promotion program with a filter Based on Customers and a promotion code
- Save
- Edit the new program and clear the filter Based on Customers
- Save again
- Log out and go to the shop
- Add an article to your cart and click "View Cart"
- Click "I have a promo code"
- Apply the promo code you created earlier

Bug:
The promo code is not accepted.

Explanation:
When the filter Based on Customers is cleared, `[]` is written on the program rule. This makes the app search for a partner with id = 4 (Public User). Since this user is not active, the search returns no results and, therefore, forbids the user from using the promo code.
This works flawlessly when you create a promotion program with no filters as they are initialized with `NULL` and a `NULL` filter always returns `True`.

opw:2419796

closes odoo/odoo#63822

X-original-commit: d31a86cead03623c375f4162324a6d1872cad6a3
Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-12-28 11:09:22 +00:00
Andrea Grazioso (agr-odoo) 2af6d498e7 [FIX] website_sale: Check last sale order ship address before use
1. Create a shipping address
2. Place a SO through backend, and choose that specific delivery
address.
3. Archive that address
4. Place an Order through the website

It is defaulting to the previously archived address, and not to the active one.

opw-2411438

closes odoo/odoo#63668

X-original-commit: 3963e5f6d133eb367e5b24976aa4aff1bdd5d066
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-12-21 18:33:53 +00:00
qsm-odoo e5572c317a [REV] web_editor, *: remove Jabberwock
*: barcodes, mail, mass_mailing, note, test_website, web, web_tour,
   website, website_blog, website_event, website_form, website_forum,
   website_mail_channel, website_mass_mailing, website_profile,
   website_sale, website_twitter, doc

New solutions are being investigated in master. For the moment, it seems
better to remove Jabberwock to unlock difficult forward-port between
14.0 and 14.1/master, until we decide what to do once and for all in
a later master. We may un-revert this later but that would be way easier
than reverting Jabberwock in a few months.

This was done as safely as possible by removing any commit related to
Jabberwock, then resolving conflicts, then reforcing commits from 14.0
that were hugely adapted for 14.1/master, then forcing the whole diff
over a rebased 14.1/master. The only possible miss (other than me making
a mistake) would be commits that were not forward-ported to 14.1 thanks
to Jabberwock handling the issue on its own (I know we had such commits
in website, which I manually included in this revert, see below).

For reference:

Commits which were reforced to their 14.0 version:
- https://github.com/odoo/odoo/commit/1a916fc2362c0b006460d94a219366ade1cce058
- https://github.com/odoo/odoo/commit/fd9e58a675bb7ec1bf97cb77b21b3c65369d51fe
- https://github.com/odoo/odoo/commit/bdfddace29b16404c06a7ebfc0cc242463a0e768
- https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566
- https://github.com/odoo/odoo/commit/710784da1f02d45cbe898da426ba7e2ac63dc711
- https://github.com/odoo/odoo/commit/597585c9b8b1350bcfd84e8433ea6c82060bcc3d
- https://github.com/odoo/odoo/commit/333a9124608ff655bd9ad5e63044a5cb7ef9c636

Commits that were not forward-ported to 14.1/master and now are:
- https://github.com/odoo/odoo/commit/55ff2d971b672dec5f103215be39101c88856b6c
- https://github.com/odoo/odoo/commit/ebbb3de1e5f363689a5ba1647bb4c26416e42d5b

+ Adapt this forward-port: https://github.com/odoo/odoo/pull/60976 (as
  it was simplified for non-stable master version relying to the
  Jabberwock implementation and now needed to be adapted to the
  summernote implementation).
  See `!$el.data('oe-expression') && $el.data('oe-xpath')`

+ Revert https://github.com/odoo/odoo/pull/60477 and reforce original
  14.0 fix https://github.com/odoo/odoo/commit/746bf53b4aecfc601f0581a948d7cb7153812c82

Note: this also means that any good refactoring that was done by the
Jabberwock-related commits is lost for now. Once the revert reaches
master, I'll try and restore what we want from those commits. Here
are their references (but obviously they have the opposite conflicts
than those resolved during this revert):

e766842a92b6 [REM] web_editor,website: empty summernote files
08c94c986e09 [REF] web_editor,web: adapt to new jabberwock editor
1546c1b74713 [REF] mass_mailing: adapt to new jabberwock editor
fd0b963c6028 [REF] website: adapt to new jabberwock editor
0113d05c6c94 [ADD] web_editor: add new Jabberwock editor lib
d0c88a396493 [FIX] web_editor: don't change background color out of the website editor
d52d3d67d4e1 [FIX] web_editor : better icon in text style dropdown
61cb2f0d21da [FIX] web_editor: should not ask if want to leave the page twice
c42012b863b5 [FIX] web_editor: trigger a resize when use the mobile preview
d934d05d6e39 [FIX] web_editor: need to build the snippet before commit it into vDom
495bea924745 [FIX] web_editor: remove box shadow on the #wrap container
bffb5612e689 [ADD] field_html: add resizer in most field_html
f3c94e40cccf [IMP] web_editor: update Jabberwock library to commit 41e4063
cc87dea3ef32 [FIX] web_editor: update header change position to work with JW
5d9b25f66704 [FIX] web_editor: do not insert chars around step icon on click
70d3f0e4630c [IMP] web_editor: update Jabberwock library to commit 0bd94881
a57f13891f82 [FIX] web_editor: open media modal in appropriate tab on dblclick media
5b7537397e08 [IMP] web_editor: update Jabberwock library to commit a7ba7c34
a8d7ec235eeb [FIX] web_editor: adapt iframe Qunit test to new editor
5f794eac7209 [FIX] mass_mailing: hide all panels on show themes
551d45641d19 [IMP] website: remove unused reference
10580e1c102f [IMP] wesbite: add comment in tour
c17049f6b764 [FIX] web_editor: Fix description toggle in pricelist snippet
18a428e854b1 [IMP] web_editor: update Jabberwock library to commit 43a10003
58a161c645a5 [REF] web_editor, website: use editor helper setClass
62dd0bd3bc66 [FIX] web_editor: properly deactivate snippets and reactivate the last
99eebcaa34cb [FIX] web_editor: disable snippet in preview mode on mouse leave options
a84216932958 [FIX] web_editor: fix the image gallery snippet
f8dd4ea3e7d5 [FIX] web_editor: fix shadow selector for Safari
e50a4f3a16de [IMP] web_editor: update Jabberwock library to commit de13ed7e
4a2718f7a5ba [FIX] web_editor: ensure dom is properly cleaned at end of save test
03684c004a4e [FIX] website: ensure reset of bg-image on add bg-video
d63397159708 [FIX] web_editor: fix image remove from images wall
82fa5142f1a5 [IMP] note: restyle note without sheet or resizer
8b9f1ce603d5 [FIX] web_editor: properly mock createWysiwygIntance (sic) in tests
fc2183b66305 [FIX] web_editor: image overlay did not update with changes
cd0d2f5791cd [FIX] web_editor: add color preview to color picker
28a168172454 [FIX] web_editor: restore removal of spinner
67c90dd3b946 [FIX] website_forum: properly initialize editor
920dfe2a430a [FIX] website_forum: better css in the JW toolbar
43f33fd651af [IMP] web_editor: update Jabberwock library to commit 6853b60
71246c92f8de [FIX] Web_editor: table options button should be inside the toolbar
12b9e5916692 [FIX] web_editor: properly update the image options on replace image
e889cf8583da [FIX] website, website_sale: properly save filter id of dynamic snippets
e0fd11e36e45 [IMP] web_editor: update Jabberwock library to commit 4b2c903b
8f2b7ba35614 [FIX] web_editor: properly stop snippet option changed event propagation
a30c2c4105c7 [FIX] website: fix megamenu snippet editor behavior
312091cf822b [FIX] web_editor: fix overlay that is not reappearing
9f1d03dda613 [FIX] web_editor: table picker not fully displayed
814ddada6124 [IMP] web_editor: remove message before leaving page if editor is destro
4f38e26af7da [FIX] web: allow saving copyright footer
01e947b6123b [FIX] web_editor: only save translations that changed
103676072c50 [FIX] web_editor: prevent traceback on open crop dialog
5844ff66d4a0 [FIX] web_editor: apply image crop in jw on save dialog
1b435652e4a0 [FIX] website_forum: ensure media modal opens on click button
4f4a6ca0b8ac [FIX] web_editor: ensure valid default html value
51e22026ac7b [IMP] web_editor: update Jabberwock library to commit ab1184f8
2413fa19be0e [FIX] web_editor: Qunit test properly wait for editor stop
aa89e1ea3e97 [FIX] web_editor: properly save view blocks with an id
e2e90b53992e [FIX] web_editor: ensure language selector is non editable
0efd72089d5c [IMP] web_editor: clean useless lines
f54dfc7631f9 [IMP] web_editor: remove useless comment
3995ab1b84f2 [IMP] web_editor: update Jabberwock library to commit b8d73691
0834b1e5740a [IMP] web_editor: withDomMutations
f1459fb7b45c [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
6e8acc6c8cc7 [IMP] web_editor: update Jabberwock library to commit 3bbb175c
18a0c95d51cb [FIX] website, web_editor: #wrapwrap in body
4686a92e742c [FIX] website_form: allow edition of success message
78cc4da075cc [FIX] web_editor: allow edition of branded nodes only
bcffa7353448 [FIX] web: dialog should not use field value footer items
67ff56e14746 [FIX] web_editor,website_mass_mailing: display the popup preview
3cb9bea50c20 [IMP] web_editor: update Jabberwock library to commit a20492ea
518f03e6f1c9 [FIX] web_editor: use withIntangibles to find ZoneNode
d0ad6a568f49 [FIX] website: move sidebar out of theme
d690f5da13ea [FIX] website: properly save popup id
43b3433df3e6 [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
4ee8f4dedc30 [FIX] web_editor: prevent deadlock when removing child snippet of popup
850be198ef6d [FIX] web_editor: prevent traceback on reposition background image
4c3eaba41f5d [FIX] mass_mailing: adapt tour to the new editor design.
496d3ea272ed [FIX] web_editor: properly position sidebar scrollbar
5be4de703074 [FIX] web_editor: Show the toolbar when select the text in forum edition

closes odoo/odoo#63768

Related: odoo/enterprise#15458
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-24 13:36:49 +00:00
Adrien Widart d4eeb23397 [FIX] account: list all credit note methods
When adding a credit note, the user can only select the "Partial
Refund" credit method.

To reproduce the error:
1. Go to Invoicing
2. Create a new one
	- Add at least one invoice line
3. Save, Confirm
4. Click on "Add Credit Note"

=> You can not change the credit method.

The method field is editable only when the residual amount is different
from 0. Here is the issue: when clicking on "Add Credit Note", it
actually triggers some `onchange` methods. The latter uses a new record
to compute the values:
https://github.com/odoo/odoo/blob/45422d56bce413b8577f1784e10dd22ede93c751/odoo/models.py#L6147-L6148
Then, some `_compute` methods are also triggered. Among them, the amount
residual computation of the associated `account_move_line`. However,
`_compute_amount_residual` will skip the not-yet-created objects and set
the amount residual to 0. This is the reason why the residual amount of
the account move is zero and therefore, the user can't change the credit
method.

OPW-2418582

closes odoo/odoo#63780

X-original-commit: 13e33fdd9722a7022d56538ab69dda0200b3aaa2
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2020-12-24 13:47:21 +00:00
Pierre Paridans ad74a829df [FIX] web: prevent crash on image resize/crop
When attempting to resize or crop an attachment through the '/web/image'
route, if the attachment isn't actually an image (even if the record's
mimetype says so) or doesn't match one of the format supported by PIL
(Python Imaging Library) - like Apple's HEIF -  the request crashes with
a "500 Internal Error".

Although it makes sense to return a response with an HTTP error code, a
more sensible approach would be to return a "404 Not Found" response
instead.

The point by handling the Exception thrown by PIL and returning a 404
status code is to more closely match the semantic of this HTTP status
code. Getting a resized version of a non-image doesn't really make sense
as this resource doesn't exist at all ; hence the "404 Not Found"
response. On the other hand returning a "500 Internal Error" would
denote that a legitimate request failed on the server side, which is not
the case here.

Note: this difference of semantic, even if only visible in a regular
browser, has its importance in the mobile apps because we use it to
given a meaningful feedback to the user in case if failed HTTP requests.

Note: the mimetype detection could be improved to ease the handling of
this kind of errors but would require too much changes to be done in
stable branch.

Steps to reproduce in Discuss:
- rename an HEIF file with a ".jpeg" extension
- upload it in a chat window
=> the thumbnail in the chat window throws an HTTP error 500

opw-2417172

closes odoo/odoo#63772

X-original-commit: 873bc2aa5a8fcfc0664fc5ca70f789911873d583
Related: odoo/enterprise#15462
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-12-24 09:58:17 +00:00
Rémy Voet (ryv) cdf2d5441c [FIX] stock: improve perf of _compute_has_packages of stock.picking
Use read_group instead of search count to batch the compute.

opw-2371161

closes odoo/odoo#63754

X-original-commit: b82d8a8456085ab700ef1ce1df4052fa6cefd7e0
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2020-12-23 16:08:02 +00:00
Rémy Voet (ryv) c58865901f [FIX] stock: avoid flush all env in quants update
About this commit 8e7c0e544a8d3d18c57634750ee7ea03052c84b1

We need to manually invalidate the cache (of the quant) if a error
(other than concurrent ones) is raise from the write. Because
we can't know what the `write` has already put in the cache (e.g.
`write_uid`), we need invalidate it.

opw-2371161

X-original-commit: 7d75745267dada371d421ec93d50fb10b0006457
2020-12-23 16:08:01 +00:00
Rémy Voet (ryv) d5ea45c06e [FIX] stock: add index on lot_id of stock.quant
For validate 5K stock move line with SN:
Without index: 200 sec of SQL execution
With index: 15 of SQL execution

opw-2374846

X-original-commit: 21d7afca292f4c213d1fcfb4a31e0b7157eb941c
2020-12-23 16:08:01 +00:00
Rémy Voet (ryv) f21362ff2c [FIX] stock: _action_done with OrderedSet for scalability
Make more scalable the `_action_done` by replacing
recordset/union by OrderedSet/add.
Also add `limit=1` in the lot search.

opw-2374846

X-original-commit: ffe9f204474de832514ab6464947c607a4c92282
2020-12-23 16:08:01 +00:00
Rémy Voet (ryv) 55bf82880c [FIX] stock_account: fix performance of _get_in_move_lines
A `stock.move` can contain thousands of `move_line_ids` (when tracked
by SN). The union of recordset (`|=`) doesn't scale well due
to the N² complexity (for 10000 SML to validate,
). Replace recordset union
by `OrderedSet` of ids + browse (linear complexity).

Before for 10000 SML to validate:
- the `_get_in_move_lines` take 14% time in the pyflame
After in the same condition:
- the `_get_in_move_lines` isn't present anymore in the pyflame

opw-2347525

X-original-commit: 0acbf6f961e4e946c9e487343ad2cc0129400b7f
2020-12-23 16:07:59 +00:00
Daniel Blanco 08a7e0f38f [FIX] l10n_cl: exclude vendor bills from last sequence domain
closes odoo/odoo#63758

X-original-commit: 13b6550616a3d99643b0b3de3d75f4714fd9d2f2
Signed-off-by: Josse Colpaert <jco@openerp.com>
2020-12-23 18:13:20 +00:00