Commit Graph
141473 Commits
Author SHA1 Message Date
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
Nicolas Pierre b03e900a40 [IMP] stock(_*), mrp: highlight PO/SO links on forecast report
Replenishment is great to replace MTO but misses the direct link between SO and PO (smart buttons on both SO and PO to link to the corresponding PO and SO).
The info is actually there in the forecasted report but it is not accessible directly from the PO and in the case of the SO does not highlight the corresponding line of the SO.

This adds a graph icon in the PO, MO and receipt form to directly access the forecasted report (it already exists for SO and delivery).
The information linked to the SO/PO/MO/receipt/delivery is also sent to the forecasted report to highlight the corresponding line.
Note that in the case of the SO, the information needs to go first through the qty_at_date widget (which contains the link to the forecast report).

The graph icon for the PO, receipts and MO turns red when the forecasted quantity at expected date is negative. This is done using the new 'forecasted_issue' field.

closes odoo/odoo#62264

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-09 13:41:27 +00:00
Csaba Tóth 4c91e895a9 Sign the Odoo CLA by Online ERP Hungary Kft.
closes odoo/odoo#65816

X-original-commit: 054f3a53c9335bee0a09d4b375e1620292cf0601
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-09 13:19:42 +00:00
Lavish Chhatwani d30663503d [IMP] sms: autofocus on "body" for valid phone number in single mode
Before Commit:
When users wants to send an SMS to someone with help of the phone widget,
the composer is opened, and users expect to be able to write the message
right away. The issue is that the default focus is on the phone number, so
if users start writing, it will corrupt the phone nubmber, and they have to
discard the changes and have to click the body to finally start typing SMS
content.

After Commit:
When the composer is opened, if the phone number is valid, 'body' field is
focused automatically so that users can start typing right away. If number
is not valid, the focus will still be on the phone number. This is managed
by providing 'default_focus' attibute on the body field, which appears or
is hidden as needed.
For the mass mode also, we simply focus on the body field to enable user
to start writing content right away.

closes odoo/odoo#65443

Task-id: 2394488
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-09 11:01:03 +00:00
Didier (did) d34c9c224c [IMP] mail: composer require thread
Whole code is relying on composer having a linked thread, which makes sense
functionally too, so let's explicit this requirement on the field.

task-2453459

closes odoo/odoo#65531

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-02-09 08:54:43 +00:00
Anh Thao Pham (pta) 097f29d0f6 [FIX] product_margin: fix Avg. Sale Unit Price
- Install product_margin
- Go to Invoicing > Customers > Invoices and create an Invoice
- Add a Credit Note
- Go to Accounting > Reporting > Product Margins and check Product used in the Invoice
The "Avg. Sale Unit Price" is incorrect. It should be 0 as it is for "# Invoiced in Sale"

Credit Notes are not taken into consideration when computing "Avg. Sale Unit Price".
This is also the case for discount.

opw-2382797

closes odoo/odoo#65777

X-original-commit: 8c7feb45f1ee8581e259f3c2aaff7a139f516d94
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-02-09 09:45:15 +00:00
Thibault Delavallée 1b8aa71e6b [FIX] mass_mailing: fix batch call of action_send_mail
Loop inner calls should use mailing not self.

Task ID-2455433

closes odoo/odoo#65755

X-original-commit: d63734eb6e00c079ad9c0658674efb2321610173
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-09 07:55:23 +00:00
Samuel Degueldre 5845bef12b [FIX] web_editor: insert record name as text
Previously, the many2one widget from the web_editor used jQuery's
'.html()' method when inserting a record name into the page. The record
name was not HTML-escaped before this, which may have unexpect result
and break the layout.

This commit fixes that by using the '.text()' method instead.

This bug only affects pages containing a many2one (contact excluded)
at the time of selection and not after the selection.
e.g. on the /event page, changing the category of an existing event
via the website editor

closes odoo/odoo#65686

X-original-commit: 53aff7f07317a8261b8b9c3e462d930141c7081b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-02-08 09:04:12 +00:00
Benjamin Frantzen (bfr) dd65f793e7 [FIX] account: when a decoder successfully parse an attachment, ocr is not called when updating an invoice
Before this commit, even if another attachment decoder managed to parse an attachment into an invoice, all the decoders were called.

closes odoo/odoo#65764

X-original-commit: ec05004acb2a3283920e3d7730a971814ccc2ac1
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-02-08 20:40:16 +00:00
Denis Ledoux e402cd496f [FIX] mrp: qty_available computation of a kit and its component
When `qty_available` was being called
for a kit and its components at the same time,
e.g.:
 - Kit product
   - Product 1
   - Product 2

The kit product available qty was always computed to `0.0`,
because when computing its component available quantity,
they were computed to `0.0` because they were marked
as `protected` by the ORM when calling the compute method
for these records at the first call.
When the `qty_available` compute method for the kit
then called recursively the `qty_available` compute
method for the component, as the component record
were marked as protected,
the ORM filled their value with the Falsy value `0.0`.

This issue occured particularly in the upgrade integrity unit test
which makes sure the available quantities of the products remain
unchanged after upgrade. This test computes the available
quantities for a bunch of products at the same time,
and its therefore likely a kit product gets its available
quantity computed as the same time than its components.

upg-3185
upg-4215
upg-4228
upg-5558
upg-5745
upg-5856
upg-6012
upg-6064
upg-6076
upg-6306
upg-6514
upg-6588
upg-6729

closes odoo/odoo#65758

X-original-commit: 8e152a567a6003dae4abb3b537b963eec4142d6d
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2021-02-08 18:58:04 +00:00
Thibault Delavallée abeb7f907a [FIX] crm: update query counters
Probably linked to merge and forward of odoo/odoo#65688 that split some
computed fields. This may have an impact on some fields computation and
therefore queries.

Task ID-2455236

closes odoo/odoo#65748

X-original-commit: b1520ad39c7abd18f8af1c3b23e6e3e897916004
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-02-08 16:34:44 +00:00
Tiffany Chang (tic) 9effef7087 [FIX] mrp: use bom quantity in bom report
This commit makes it so when the bom structure report (Structure & Cost
smartbutton) is opened the product quantity defaults to the BoM's
`product_qty` amount rather than 1.

Steps to reproduce:
- Create/open a BoM
- Set `product_qty` to any value greater than 1
- Click on "Structure & Cost" button.

Expected result: product quantities scaled to the `product_qty`
Actual result: product quantities scaled to Quantity = 1

closes odoo/odoo#65747

Task: 2429885
X-original-commit: 30c05ad99bcf5884e071ebfa41adc6b44f23ba1e
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-02-08 16:33:36 +00:00
Benjamin Frantzen (bfr) 35a5c0c84c [FIX] account_edi_extended : fix visibility of 'Retry' and 'Send Now' button.
Before this commit, the button 'Retry' would appear if the blocking_level of an account.move (aggregated value of all the related edi.document) was lower than 'error' even though the button 'Send now' also appears. The button 'retry' should only show if the blocking_level is 'error'.

closes odoo/odoo#65714

X-original-commit: 4fda4838b8e3462b6428f316bfe9814cd743e891
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: bfr-o <bfr-o@users.noreply.github.com>
2021-02-08 12:20:39 +00:00
Benjamin Frantzen (bfr) 7785fcb819 [FIX] account_edi: edi.document are re-send if they are in error
Before the introduction of account_edi_extended and blocking_level, if an edi.document was in error, it was retried each the time the edi.documents were processed. With account_edi_extended a bug was introduced and only the document not in error were processed. This commit aims to restore the previous behavior.

Also fixes tests of account_edi.

See https://github.com/odoo/odoo/commit/a9a46cf09b0c841c7fda95b5ed03033fc6936ca2

X-original-commit: 385fa29322f6dffc7d7d0de96a1cfbddb0cab7f0
2021-02-08 12:20:37 +00:00