Commit Graph
140986 Commits
Author SHA1 Message Date
Dhruv Patel 4aa47dbf3a [IMP] mail: mark first welcome message as read for the admin
Actually, We don't want to distract the admin with an unnecessary notification
on General Channel. The main focus should be on odoobot's tour, not on the
general channel's welcome message. And it is also not a good idea to remove the
general channel as it would reduce the discoverability of the feature.

So, we are marking the first message as read for at least admin user.
therefore admin can not distract over unnecessary welcome notification and
focus more on the rest of the functionality.

Task : 2442023

closes odoo/odoo#66010

X-original-commit: 069923e53fcb93c4cf0a0715d500d23525aafbe7
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-11 17:05:28 +00:00
Xavier Morel a3110822c8 [FIX] portal: internal & portal groups are largely exclusive
Prevent mistakenly adding "portal" to existing internal users through
the portal wizard as that can lead to odd behaviors (to the extent
that since 12.0 the "user type" uses radio buttons so it's not
possible to easily set a user as both internal and portal).

closes odoo/odoo#65981

X-original-commit: 8105902c4f6f467facad728ccd9763b7a44002bc
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-11 14:26:11 +00:00
Martin Trigaux 284daf7f68 [FIX] web: remove formating from event title
When copy-pasting text from rich text, the content may contain
unwanted formating instructions. Unsure it's escaped to avoid
propagating the content.

X-original-commit: 42f596a5b50e530fd5dc3f8c2939bc5b4e5921af
2021-02-11 14:26:10 +00:00
nie 87334736d4 [FIX] web: fields info for a specific view can be undefined
Steps:
- Install mrp
- Go to Manufacturing > Master Data > Bills of Materials
- Create a BoM
  - Components:
    - Add a component
- Save
- Click the component
- Close the modal window
- Click the component once more

Bug:
Traceback here:
https://github.com/odoo/odoo/blob/55a6642a9621fa9683895d5d45a015bb04c3017b/addons/web/static/src/js/views/basic/basic_view.js#L147
Error: can't convert undefined to object

Explanation:
As seen on the line just above:
https://github.com/odoo/odoo/blob/55a6642a9621fa9683895d5d45a015bb04c3017b/addons/web/static/src/js/views/basic/basic_view.js#L146
`fieldsInfo` might not have the view we are looking for.

opw:2452142

closes odoo/odoo#65998

X-original-commit: a8680ac8815575762b702917940c0b2d4dc0c4ea
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-11 16:01:17 +00:00
Thanh Dodeur a050a069b2 [FIX] mail: prevent traceback on attachment unlink
Due to asynchronous rendering, the attachment template can be rendered
when its attachment is undefined, this was causing an issue with an
unguarded getter call that was attempting to access the attachment.

This commit fixes this issue.

opw-2457983

closes odoo/odoo#65992

X-original-commit: 33802c65c3e8d04c54de3fca5903f66b34b9d13a
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-11 15:33:43 +00:00
919dbfb7f7 [MERGE][IMP] rating, website_slides_*: reduce differences between course types and improve user experience
PURPOSE

Lessen differences between documentation and training courses
in eLearning frontend display.

SPECIFICATIONS

Allow documentation lessons to be seen in fullscreen mode. Default mode
is still the slideshare-like one but fullscreen is now available. This
imply notably computing category data in both modes to enable fullscreen
support and course lessons navigation.

Unify layouts. In this merge we

  * use the left bar with course information on course page view on both
    courses;
  * unify menus and tabs;
  * better integrate sale and forum as everything is not a single layout;
  * move Type under Display to have all display related options within the
    same option group;
  * unify display, notably remove "+" on "+ Add Tags";

Finally provide some fixes for profile and rating, notably copywriting.

LINKS

Task ID-2275688
COM PR odoo/odoo#65454
UPG PR odoo/upgrade#2130

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Mariska Archielli <ram@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2021-02-11 18:07:47 +01:00
Thibault Delavallée 3a608fea32 [IMP] website_slides: add demo data for documentation channel
Purpose is to have some data in a documentation channel to see a bit
how they behave compared to training channels.

LINKS

Task ID-2275688
PR odoo/odoo#65454
2021-02-11 16:07:28 +00:00
Mariska ArchielliandThibault Delavallée 994cc3f5e6 [REF] website_slides: better integrate documentation and training channels
Purpose of this commit is to lessen difference in layouting between courses
being documentation or training. Indeed we want a smoother user experience.

In this commit we

  * use the left bar with course information on course page view on both
    courses;
  * unify menus and tabs;
  * better integrate sale and forum as everything is not a single layout;
  * move Type under Display to have all display related options within the
    same option group;
  * unify display, notably remove "+" on "+ Add Tags";

LINKS

Task ID-2275688
PR odoo/odoo#65454

Co-Authored-By: Mariska Archielli <ram@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2021-02-11 16:07:27 +00:00
Thibault DelavalléeandMariska Archielli 7cba785900 [IMP] website_slides: allow to see document slides in fullscreen
Allow documentation lessons to be seen in fullscreen mode. Default mode
is still the slideshare-like one but fullscreen is now available. This
imply notably computing category data in both modes to enable fullscreen
support and course lessons navigation.

LINKS

Task ID-2275688
PR odoo/odoo#65454

Co-Authored-By: Mariska Archielli <ram@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2021-02-11 16:07:27 +00:00
Mariska ArchielliandThibault Delavallée e7f2beed01 [FIX] website_profile: correctly apply color on karma circle progress
Currently in profile, karma circle progress is black due to a wrongly set
scss variable.

LINKS

Task ID-2275688
PR odoo/odoo#65454

Co-Authored-By: Mariska Archielli <ram@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2021-02-11 16:07:27 +00:00
Mariska ArchielliandThibault Delavallée 4a886e74bf [IMP] portal_rating: improve wording and user experience
Improve copywriting: Write a review instead of Add

Improve UX: better use available horizontal space

LINKS

Task ID-2275688
PR odoo/odoo#65454

Co-Authored-By: Mariska Archielli <ram@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2021-02-11 16:07:27 +00:00
nie a934fa8cf7 [FIX] website_event: registration template show sale end date
Steps:
- Install website_event_sale
- Go to Events
- Create a new event:
  - Add a line:
    - Sales Start: yesterday
    - Sales End: tomorrow
- Click the "Go to Website" smart button

Bug:
The sales end date is not displayed. It's displayed when there are more
items.

Explanation:
When there is only one item, the layout is not the same.
This commit adds "Sales end on" next to the price.

opw:2449080

closes odoo/odoo#65994

X-original-commit: 5719f2eca7aedfba71fef1e6c94f31277b3dc0b9
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-11 15:43:17 +00:00
Priyanka Kakadiya 63d6c32345 [FIX] mail: improve subject of message in inbox
PURPOSE

Displaying the subject when the name of the record is exactly the same is
redundant and crowds the interface needlessly

SPECIFICATION

Subject should only be displayed if it is different than the name of the
record

LINKS

closes odoo/odoo#65969

Taskid: 2363130
Pr: https://github.com/odoo/odoo/pull/61044
X-original-commit: 2558768aadc1ab80443472ae9911b39f0b818d95
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-11 13:05:21 +00:00
Michael Mattiello (mcm) 3b0b448408 [FIX] web: prevent quick edit in non-editable forms
Before this commit, non-editable forms could switch to edit mode
when clicking on a field or a label.
Now, the edit right is checked when the quick edit is triggered.

task 2456324

closes odoo/odoo#65964

X-original-commit: 298746a3cce3d241417bcf62f4deeeb8f3d3ca92
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-11 12:53:30 +00:00
Odoo's Mergebot d4cfa14a75 [FW][MERGE][FIX] event, website_event_track: split stored editable compute fields methods
RATIONALE

Stored editable fields receive their values either from compute either from
user input. If a user input is given to create / write compute method is not
called. If multiple fields are computed through the same method giving one
field value discard call to compute method and other fields are not called.

SPECIFICATIONS

Split ``_compute_contact_info`` compute method on registration model
so that partner related fields are independent.

Split ``_compute_from_event_type`` compute method so that event template
configuration  related fields are independent.

Split ``_compute_from_event_type`` compute method on event model
so that event type related fields are independent.

Add tests related to registration / partner contact fields synchronization. Add
tests with user input and/or partner synchronization to ensure editable stored
fields work as expected on lead model

LINKS

Task ID-2455165
COM PR odoo/odoo#65688

closes odoo/odoo#65963

Forward-port-of: odoo/odoo#65923
Forward-port-of: odoo/odoo#65688
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-11 15:58:09 +01:00
Thibault Delavallée d97355e616 [FIX] website_event_track: split stored editable computed fields compute method
RATIONALE

Stored editable fields receive their values either from compute either from
user input. If a user input is given to create / write compute method is not
called. If multiple fields are computed through the same method giving one
field value discard call to compute method and other fields are not called.

SPECIFICATIONS

Split ``_compute_parnter_info`` compute method so that partner related fields
are independent.

LINKS

COM PR #65688
Task ID-2455165

X-original-commit odoo/odoo@12d7aae9ee

X-original-commit: 436fb7d7aa339e86753721d3385df4f4517d2d30
2021-02-11 13:29:59 +00:00
Thibault Delavallée adedada349 [FIX] event: fix seats_limit and configuration stored editable computed fields compute method
RATIONALE

Stored editable fields receive their values either from compute either from
user input. If a user input is given to create / write compute method is not
called. If multiple fields are computed through the same method giving one
field value discard call to compute method and other fields are not called.

SPECIFICATIONS

Split ``_compute_from_event_type`` compute method so that event template
configuration  related fields are independent.

Fix seats_limited being computed in sevearl method which should not occur.

LINKS

COM PR #65688
Task ID-2455165

X-original-commit odoo/odoo@3c09e86b4e

X-original-commit: ddc4ade6ad81c63efebd848ec56d197cd18e8041
2021-02-11 12:41:48 +00:00
Thibault Delavallée 6986faf533 [FIX] event: split stored editable computed fields compute method
RATIONALE

Stored editable fields receive their values either from compute either from
user input. If a user input is given to create / write compute method is not
called. If multiple fields are computed through the same method giving one
field value discard call to compute method and other fields are not called.

SPECIFICATIONS

Split ``_compute_contact_info`` compute method so that partner related fields
are independent.

LINKS

COM PR #65688
Task ID-2455165

X-original-commit odoo/odoo@dfc319f584

X-original-commit: c251048cfead27d12117557fe4b6601bef39e8e1
2021-02-11 12:41:47 +00:00
Thibault Delavallée 87f3891244 [IMP] event, website_event_track: add tests about stored editable computed fields
Add tests related to registration / partner contact fields synchronization.
Add tests with user input and/or partner synchronization to ensure editable
stored fields work as expected on registration model.

Add tests related to event track / partner contact fields synchronization.
Add tests with user input and/or partner synchronization to ensure editable
stored fields work as expected on track model.

Add tests related to event / event type configuration fields synchronization.
Add tests with user input and/or event type synchronization to ensure editable
stored fields work as expected on event model.

Warning: those tests are currently partly failing. Next commits will split
computed fields into several methods in order to fix computation.

LINKS

COM PR #65688
Task ID-2455165

X-original-commit odoo/odoo@6b0346bbb5

X-original-commit: 7f0c7339c39b05e20efa163d0ea91f7dd5c0017c
2021-02-11 12:41:47 +00:00
Rémy Baranx (bar) f240c987d8 [FIX] account: is_valid_balance_start computing
According to its description, the field `is_valid_balance_start`
of the `account_bank_statement` model shall be `False` if the starting
balance of the current statement, is different from the previous
ending balance.
That means, it shall be set to `True` when no previous statement has been
set (`previous_statement_id` is NULL), whatever the starting balance value.

closes odoo/odoo#65941

X-original-commit: 096fcfa30b3ead8314b1162db357450a8c1b2a0e
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2021-02-11 10:34:57 +00:00
nounoubensebia 2b4ccc326b [IMP] mass_mailing, mass_mailing_sms: revamp mail trace form
- make all the mailing trace fields readonly inside the form,
  beacause a user would not want to edit a mailing trace as
  this will make the related statistics about the mailings
  incorrect
- change the mailing trace form view interface to give more
  clarity to the user and to better separate between different
  fields
- add a stat button to redirect the user to the coressponding
  mailing contact so that he can easily access the mailing
  contact in order to blacklist/output/correct the email address
  or the phone number
- remove the warning messages in the mailing trace form view
  because the user already has all the information in the
  status bar of the form
- update the inherited mailing trace form view located in the
  mass_mailing_sms module to adapt to the new changes in the
  trace form view of the mass_mailing module

Task-2440420
Enterprise PR: https://github.com/odoo/enterprise/pull/16105

closes odoo/odoo#65469

Related: odoo/enterprise#16105
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-11 12:08:03 +00:00
Aaron Bohy a890b0bf03 [FIX] web: keep null/false/true strings in domains
Before this commit, occurences of 'null', 'true' and 'false'
strings as autocomplete values in the search view were replaced
respectively by None, True and False.

Fixes #65743

closes odoo/odoo#65958

X-original-commit: 885932ae8e31905e08b79141a445933b6afc9f15
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-11 12:18:25 +00:00
Dhruv Patel bbeacef466 [IMP] mail: notify user after subscription preference changes
Currently, the user doesn't receive any feedback or notification when updating
his subscription preferences. Therefore, he might be prompted to open the
subscription modal again to double-check that his modifications were correctly
applied or not.

With this commit, We are now displaying screen notification with success message
after successfully applying the changes.

Task : 2445481

closes odoo/odoo#65957

X-original-commit: 95aebcbc8051f71762724149f6b20f3501485cdd
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-11 12:17:45 +00:00
Mohammed Shekha c56b6f6e78 [FIX] web: badge widget vertical alignment
before this commit: badge widget was not displayed vertically aligned

after this commit: badge widget will display vertically align

task-2351554

closes odoo/odoo#65940

X-original-commit: 1f99f5df22b3d36775a7386af170c126a481279b
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-11 10:34:31 +00:00
Anjali f661924f62 [IMP] crm: display tag colors in lead kanban
This display colors of the tags on leads' kanban view,
same as opportunity.

Task-id : 2453047

closes odoo/odoo#65677

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-11 05:18:29 +00:00
nie e8fac631c8 [FIX] payment,sale: Use record website domain in links
Steps:
- Go to Settings > Users & Companies > Companies
- Create a new company (1)
- Install a payment acquirer and Website
- Go to Website > Configuration > Settings:
- Select "My Website 2"
- Assign it to company (1)
- Add a custom domain
- Save
- Switch to company (1)
- Go to Invoicing
- Create a new Invoice:
  - Add a product line
- Post it
- Click Action > Generate a Payment Link

Bug:
The base domain is used instead of the domain of the website linked to
the invoicing company.

Explanation:
The app only uses the URL on which the user has logged in to generate a
payment link. If the user has multiple companies, this can confuse
customers if they land on another domain than the one they are used to.
This commit makes the app use the domain of the website of the record
linked to the payment if it has one.

opw:2440251

closes odoo/odoo#65938

X-original-commit: 700dba53843e71f5f34c86305cc658d9273914aa
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-11 10:08:25 +00:00
Ipsita Borisagar 9ece748b84 [IMP] mail: activity form view improvements
PURPOSE

The current form view of Activities(from the technical settings) is not very
useful. There is no indication of which document the activity is linked and the
buttons like save/discard etc. looks weird within the form view.

SPECIFICATION

-Adding field 'res_name' for indication of document at the top of the form which
 is read-only.
-Removing 'save', 'discard', 'mark as done' and 'done & schedule next' buttons
 within the form and simply make a form view without buttons.

LINKS

PR #63121
Task-2371023

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-01-27 08:46:38 +00:00
Andrea Grazioso (agr-odoo) 894717fa2e [FIX] sale: fix order line amount update after downpayment invoice
Create a standard tax included in the product price.
Add that tax to a product and the down payment product.
Create a sales order (i.e. 1 line, 100$ total, 15% tax incl).
Create a percentage down payment invoice, i.e. 50%.
Post the downpayment invoice.
Go back to the sale order

The sale order line relative to the downpayment was asjusted to remove
the tax amout while this should not occur when dealing with tax included
in price

Added test

opw-2426294

closes odoo/odoo#65911

X-original-commit: 3b58b373e1c6c155f65b88c31cbb47794cb0a554
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-02-10 20:33:17 +00:00
Joseph Caburnay a922656967 [FIX] pos_hr: set the right employee for the order
closes odoo/odoo#65888

X-original-commit: 84d668ed3a1ba8ba4f61302dea011c596a07f493
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-02-10 14:13:33 +00:00
Mohammed Shekha 4b122de129 [FIX] web: date options are not displayed in dropdown
before this commit: when groupby dropdown is opened and hover over date/datetime
field then it does not show options like Day, Month, Quarter, Year instead it
adds horizontal scrollbar, this issue is raised after commit: https://github.com/odoo/odoo/commit/cf351ae49875ec7d28a18747b65ed2a61f55262b
So this commit simply reverts that commit and fix the issue solved by above commit
different way.

with this commit: reverts https://github.com/odoo/odoo/commit/cf351ae49875ec7d28a18747b65ed2a61f55262b
and fix the issue solved in above commit different way.

task-2452033

closes odoo/odoo#65905

X-original-commit: a622936ab09497086f43715e546a1b33418d0ee3
Related: odoo/enterprise#16272
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-10 17:22:59 +00:00
Géry Debongnie addf9d7eec [FIX] web, point_of_sale: update owl to v1.2.4
This commit update owl from 1.2.3 to 1.2.4, and
introduces a few fixes for code that was broken (because it accesses
private owl values)

Note the fix for the test menu code is interesting. Before this commit,
the handler for the click on the home menu component was not called, so
the click had a side effect: it modified the url to its href, which
caused the action manager to load the next application, even though the
home menu was not mounted.

With the update to Owl, this is no longer true: the handler is called,
and call preventDefault on the event. Because of that, the url is not
changed. However, since the home menu is itself not mounted, it cannot
communicate to the web client that we should load the next app.  This is
why it was broken.  The fix is simple: we actually make sure that the
home menu is displayed before clicking on the app menuitem.

closes odoo/odoo#65906

X-original-commit: 2385e58d76aa5e4bca0fc6d76ecedc7de5fd4267
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-10 17:28:10 +00:00
Odoo's Mergebot 4ff5e072a1 [MERGE] survey: ease management by removing state and adding responsible
PURPOSE

Improve daily management of surveys by adding a responsible and
removing states to use an archive-based flow instead.

SPECIFICATIONS

The goal of the draft state on survey is to have the survey under edition
mode before before sending it to participants. Under this mode:
  - the responsible can test it (can be done with "In Progress" mode)
  - the survey can't be answered (same as the state closed)

The risk that the survey can be leaked before being ready is really
limited. If it's a live survey, participants will have to guess the
4 digits access code and wait for the host to go to the next question.
Else, participant will have to guess the token.

Considering these facts, the use of the draft state is very limited so
'draft' state can be dropped. If we do so, we are left with only two
stages that are 'open' and 'closed'. But whether to consider survey
open or closed can be simply achieved with active field we already
have (if active=False, survey is closed, otherwise it's considered
as open).

So with this commit, we remove the state field from survey and thus
simplify the flow. It means that we no longer require 'Start Survey'
button, and so that button is also removed, and for the closed surveys,
instead of the button 'Set to draft', now we have a 'Reopen' button
which will activate the survey. And instead of displaying few buttons
after saving a record, we now display all the buttons from beginning.

This commit also enable users to set a 'Responsible' for the survey by
adding 'user_id' field. Demo data for the same is also updated.

LINKS

Task ID-2389434
COM PR odoo/odoo#62712
ENT PR odoo/enterprise#15217
UPG PR odoo/upgrade#2006

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-10 19:24:24 +01:00
Dharmraj Jhala f8738b70f4 [IMP] {hr_recruitment_,website_slides_}survey: add 'user_id' field
This commit enable users to set a 'Responsible' for the survey by
adding 'user_id' field. Demo data for the same is also updated.

Task ID-2389434
COM PR odoo/odoo#62712
ENT PR odoo/enterprise#15217
UPG PR odoo/upgrade#2006
2021-02-10 17:03:59 +00:00
ijas ahammed 3010751e95 [IMP] {hr_recruitment_,website_slides_}survey: remove 'state' field
The goal of the draft state on survey is to have the survey under edition
mode before before sending it to participants. Under this mode:
  - the responsible can test it (can be done with "In Progress" mode)
  - the survey can't be answered (same as the state closed)

The risk that the survey can be leaked before being ready is really
limited. If it's a live survey, participants will have to guess the
4 digits access code and wait for the host to go to the next question.
Else, participant will have to guess the token.

Considering these facts, the use of the draft state is very limited so
'draft' state can be dropped. If we do so, we are left with only two
stages that are 'open' and 'closed'. But whether to consider survey
open or closed can be simply achieved with active field we already
have (if active=False, survey is closed, otherwise it's considered
as open).

So with this commit, we remove the state field from survey and thus
simplify the flow. It means that we no longer require 'Start Survey'
button, and so that button is also removed, and for the closed surveys,
instead of the button 'Set to draft', now we have a 'Reopen' button
which will activate the survey. And instead of displaying few buttons
after saving a record, we now display all the buttons from beginning.

Task ID-2389434
COM PR odoo/odoo#62712
ENT PR odoo/enterprise#15217
UPG PR odoo/upgrade#2006
2021-02-10 17:03:03 +00:00
Oussama MESSAOUDI ae7e1f64f8 [ADD] website_sale_gift_card, gift_card: manage Gift Card in ecommerce
Add suport of gift card for ecommerce.
Split the generic part to allow others modules to us it (e.g. pos)

A customer buy 1 Gift Card, he receive a code by mail and see it into the
sale order.
Another customer can now use this code in the payment step to deduce this
amount.

Product Gift card is sold by default without tax, because we don't know on wich
ecommerce, the shipping address ans sot the tax that will be used.
So the tax is deduce from the sale order that use the gift card.
We considere to be in the MPV case from:
     https://www.vandelanotte.be/fr/actuel/actualites/624-les-bons-soumis-a-un-nouveau-regime-de-tva-a-partir-de-2019

Courtesy of @bvr-odoo for the email and product image

Co-Reviewed by @rde-odoo and @jke-be

task-2428004
pr-64195

closes odoo/odoo#64195

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-02-10 16:24:36 +00:00
Aaron Bohy d9880122db [FIX] web: call do_hide/do_show on a destroyed widget
Before this commit, calling do_hide/do_show/do_toggle on a
widget that had been destroyed before being rendered crashed
(because this.$el was undefined).

Obviously, calling those methods in this situation is useless, but
with asynchronous code, it might happen that you call them in an
handler, and they have been destroyed meanwhile.

This commit checks if this.$el is set before accessing it to avoid
the crash.

closes odoo/odoo#65897

X-original-commit: 320c29f5b37d4f02b4d5f7b1b6ff64462b000c92
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-02-10 15:42:33 +00:00
nie 1db8e17ef7 [FIX] website_form: user dynamic fields without readonly attribute
Steps:
- Install studio, website_form
- Go to Settings > Users & Companies > Users
- Click the Studio icon
- On the top bar, click Website
- Click New Form
- In edition mode, click the first label
- Select Customize > Add an Existing Field

Bug:
Traceback here:
https://github.com/odoo/odoo/blob/3ff00944fe6a439bd5d7bddb846206d3d6cac3a0/addons/website_form/models/models.py#L73
KeyError: 'readonly'

Explanation:
Dynamic selection fields don't declare a 'readonly' attribute:
https://github.com/odoo/odoo/blob/3ff00944fe6a439bd5d7bddb846206d3d6cac3a0/odoo/addons/base/models/res_users.py#L1275-L1282

opw:2449356

closes odoo/odoo#65894

X-original-commit: 5a74dc2ca8aadb7d91d9cf7c047065fee3263ece
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-10 15:00:48 +00:00
Benjamin Frantzen (bfr) 0fcab51a26 [FIX] account: when an attachment is submited and an invoice is sucessfully parsed it is posted in the chatter
Before this commit, the attachment was only posted if no decoder was able to parse the attachment.

See https://github.com/odoo/enterprise/pull/16138

closes odoo/odoo#65878

X-original-commit: d583de02392b7738e7eead4ef33f91ef8a47b0f6
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-02-10 13:21:12 +00:00
Odoo's Mergebot 513a91d673 [MERGE] event_*: clean the ACLs files to be consistent in all sub-modules
Purpose
=======
In event, many files have different naming format. We want to clean
them, to group the lines by models before changing and adding a new
event group.

Task ID-2204364
COM PR odoo/odoo#65867
Migration odoo/upgrade#2150

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-10 16:56:25 +01:00
std-odoo d1125288e2 [REF] event_*: clean the ACLs files to be consistent in all sub-modules
Purpose
=======
In event, many files have different naming format. We want to clean
them, to group the lines by models before changing and adding a new
event group.

Task 2204364
PR odoo/odoo/pull/65867
Migration odoo/upgrade/pull/2150
2021-02-10 14:07:46 +00:00
std-odoo 0948870e7d [MOV] event: move the security tests to "Test Event Full"
Purpose
=======
Move the security tests of event to "Test Event Full", so if we
change the ACLs in a sub-modules, we are sure to test it.

Task 2204364
PR odoo/odoo/pull/65867
Migration odoo/upgrade/pull/2150
2021-02-10 14:07:46 +00:00
Ivan Yelizariev d9ff1e6c69 [FIX] web: fix duplication on phone+sms button rerendering
STEPS:

* Add related phone field to a form (e.g. partner_id.phone to sale.order form)
* Use widget "phone" + activate sms feature
* Create a record
* Click edit, select partner that has phone specified (e.g. +1 234), edit
partner's phone (e.g. +1 234 555), save

BEFORE: ``+1 234 []SMS`` is converted to ``+1 234 555 +1 234 555``
AFTER: ``+1 234 555 []SMS``

WHY:
* FieldPhone is inherited from FieldEmail

  https://github.com/odoo/odoo/blob/0de069b8ca9fb005ba5b076984f5677de25889ee/addons/web/static/src/js/fields/basic_fields.js#L1549

* sms module adds SMS button to ``$el``

  https://github.com/odoo/odoo/blob/0de069b8ca9fb005ba5b076984f5677de25889ee/addons/sms/static/src/js/fields_phone_widget.js#L91

* So this commit filters ``$el`` before updating it

This also solves the same issue but this time for the EmailField widget introduced at 2689915e3f

---

opw-2425949

closes odoo/odoo#65879

X-original-commit: b25104bae7f38d4d1de182176d239b1b7c8f803d
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-02-10 13:22:36 +00:00
Thibault Delavallée 8b67fe0b2b [FIX] crm: still fixing some peak runbot counters in assign tests
closes odoo/odoo#65861

X-original-commit: e199f22eb07debe34de375cbefbae638075e6c0a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-10 11:12:25 +00:00
Tiffany Chang (tic) 83a43af4cb [IMP] mrp,stock: improve duplicate SN warnings
Add and improve onchange warnings when a duplicate SN is used in
following cases: inventory, picking (any type), manufacturing, scrap,
and "Update Quantity" (i.e. directly edit quants from product form).

Improvement includes:
- include location where the existing SN is
- auto-correct source location when appropriate (e.g. trying to scrap a
  SN in the wrong location)

The goal of this is to prevent but not restrict duplicate SNs so users
can have some flexibility (especially if a dupe SN occurs because of an
error such as doing pick-pack-ship out of order.)

closes odoo/odoo#61287

Task: 1924758
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-10 09:52:37 +00:00
Krupal Oza 71499bbd23 [FIX] sale_(coupon): Fix coupon reflection on invoice
The purpose of this task is to reflect the coupon discount perfectly
from sale order to invoice. This issue is already fixed in 13.0 in
commit: bb5d999 but during refactor of coupon it was removed due to
module split.

So in this commit, improve the default invoicing policy of coupon product.
The default invoicing policy should always be by ordered quantity.
Otherwise, if the user changes the default invoicing policy to
"delivered quantity", coupon won't be applied to the invoice.

closes odoo/odoo#65845

Taskid: 2303244
X-original-commit: 98a3ca3274e9829666a773d5fe79f2e695524f51
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-02-09 19:33:28 +00:00
Sébastien Theys 3d219cf548 [FIX] mail: make Inbox counters more reliable in mark as read flows
- Send the new Inbox counter when marking as read, to guarantee the JS has the
  correct value (instead of having to guess it which was impossible when an
  arbitrary domain was given to the method).

  NOTE: Manual increment is kept on receiving a new Inbox message because that
  one was reliable and it would have been more tricky to compute the new counter
  for each target partner (mark as read is one user doing an action for himself,
  whereas new message is from another user to potentially many different users).
  Generic counter for threads is also not sent on every change for similar
  reasons.

- Refresh Inbox automatically when some messages are marked as read and there
  are more message on the server than currently loaded.

- Remove confusing (and impossible to maintain) counter on non-origin threads
  (in particular channel followers). This behavior in JS was not consistent with
  the server which always counted only origin thread (model/res_id).

task-2446302

closes odoo/odoo#65842

X-original-commit: f9bc1f98ed8f76846697cde68a760217b3af2aaf
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-09 17:45:00 +00:00
Michael Mattiello (mcm) 18780e9e5a [FIX] web: fix click on field label
Before this commit, clicking on some field labels threw an error.
This was because we were searching for the associated field by its id
to get the name.
Now, we don't search the associated field anymore, we use
`fieldIdsToNames` to get the name from the id.

task 2456348

closes odoo/odoo#65838

X-original-commit: ad97c32b236d92afd4a0b6d7b39e137448b0a9a5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-02-09 16:04:36 +00:00
Christophe Monniez 2529447428 [FIX] tools: prevent call to pillow exif_transpose image method
In a previous fix [0], the call to exif_transpose was kept to allow
rotation of images format different than `JPEG`.

After a small test, it appeared that the call would crash if the image
in another format had the same `LensInfo` tag.
So it's safer to not call this method at all.

With this commit, the rotation tag is retrieved disregarding the file
format by using the `getexif` method if available, falling back to the
private method for Pillow < 6 support.

As a bonus, a test is also added with a small embedded `JPEG` image,
crafted with an `Orientation` exif tag and, for reference,  the
`LensInfo`tag that caused so much trouble.

The fix referenced in [0] was not forward-ported as it was only moving
the code the is completely removed in the present.

[0] b83c48d5c48954193

closes odoo/odoo#65823

X-original-commit: bfd3f857b44f31f8077182d10cab869f42076464
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-02-09 14:51:36 +00:00
root aabd4296c5 [I18N] account: add missing translations
Before this commit not all messages where translated/translatable.
By adding _() to them they're now translatable. This means that if somebody puts OdooBot to another language the messages would be translated.

closes odoo/odoo#65787

X-original-commit: 355ae0d59a446a87d195b6749e66cd732f21ae2f
Signed-off-by: William André (wan) <wan@odoo.com>
2021-02-09 10:37:09 +00:00
ijas ahammed 0c90469efa [IMP] crm: for first won lead, display rainbowman regardless of revenue
Right now, if the expected revenue is not set on the opportunity, the
rainbowman is not displayed and it does make sense to ask for a revenue
so that we can measure if this is a record or not. However, revnue is not
necessary to congratulate the user for his first win.

With this commit, for the first won lead of a user, we congratulate user
with rainbowman, even if there is no exptected revenue set.

closes odoo/odoo#65378

Task-id: 2410443
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-09 10:11:26 +00:00