Commit Graph
146662 Commits
Author SHA1 Message Date
Hubert Van de Walle (huvw) fd381e99af [FIX] web: quickedit on readonly one2many list
Steps to follow

  - Go to the purchase app
  - Create a RFQ, add a line, confirm it, lock it and save it
  - Click on the one2many line
  -> An editable popup is opened and the main form is also switched in edit mode

Solution

  - Check if the one2many list has a readonly modifier before switching the main
    form to edit mode
  - When opening the one2many preview popup, pass along an editable param

opw-2689420

closes odoo/odoo#80338

X-original-commit: d1c9265659572c738596889f7a5ad53f673e9db4
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2021-11-24 16:32:57 +00:00
Tiffany Chang (tic) 481806137c [FIX] mrp: sync operation's work center and bom
Fixes 2 issues:
1 - odoo/odoo#61027 made mrp.routing.workcenter.company_id =
  self.bom_id.company_id. This made it so the work center selection is
  empty until a BoM is selected, which is confusing to users. To make it
  less confusing, we switch the order since we expect users to fill in
  the fields from top to bottom.

2 - odoo/odoo#65628 made it so the BoM can be changed. This made it so
  it's possible to save the record and have the company of the BoM and
  the work center not match. This can lead to a usererror when users try
  to start the WO associated with the operation. Steps to reproduce:

  - create a new operation from Configuration > Operations
  - select a BoM from company 1 and a Work Center from company 1 + save
  - edit and change BoM to a BoM from company 2 and DO NOT change the
    Work Center

  Expected result: save error
  Actual result: Save will be allowed, but WO will throw an usererror
                 when you try to start it.

  To fix this, we prevent the user from saving when the workcenter
  company does not match the BoM's (if both have a company_id assigned).

closes odoo/odoo#80337

Task: 2682365
X-original-commit: f77c9560ad304940610d797018246a8f5d32f721
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-11-24 15:49:14 +00:00
Goffin Simon 669976db67 [FIX] base: The symbol ANG must be before the amount
REF:https://www.xe.com/currency/ang-dutch-guilder/

opw:2690166-

closes odoo/odoo#80188

X-original-commit: e84af51ffbb550d069288e498e96604cb610443e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-11-24 15:49:11 +00:00
Noe Antoine 4ceda8c137 [IMP] sale_crm: propagate fields on quotation creation from stat button
When using the 'new quotation' button on the opportunity view, the tags of the
opportunity are propagated on the quotation. However, this is not the case when
using the stat button 'quotations' and creating a quotation from there.

This commits adds the tags in context to propagate them in that case as well,
as well as the other fields propagated on the 'new quotation' button:
medium, campaign, user / team if any...

This means both behaviours now have the same context, except for the search
default values.

--- LINKS ---
Task-2679488

closes odoo/odoo#79352

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-24 15:49:06 +00:00
baa c99a5f837e [FIX] l10n_gcc_invoice: changes a div to allow studio editing on the english/arabic invoice
closes odoo/odoo#80332

X-original-commit: c2f6df4eeed8d69867893c69704782b2a2b46b75
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-11-24 14:53:28 +00:00
Touati Djamel (otd) 2c6fab231c [FIX] sale_product_configurator: stop hiding subsequent dialogs after configuration step
Steps to reproduce the bug:
- install `”sale_product_configurator”`
- Go to the sales settings and enable the “Warnings” option
- Create a product with variants
- Add sale warning
- Create a SO and add the product

Problem:
The warning message is not appearing

Solution:
The product configurator does not need to hide modals after the product is added.
This fix ensures that any modals displayed after adding the product (such as warnings, messages, etc.) are correctly displayed and not hidden.

opw-2696002
opw-2679495

closes odoo/odoo#80331

X-original-commit: e82230fd395fa71081dc94ffefc39b51ad258382
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2021-11-24 14:53:24 +00:00
thcl-odoo 3ce63a0041 [FIX] mail: members can be added through channel settings' form view
Current behavior :
When we try to add a member through channel's settings by clicking on "Add a line", a blank line is correctly added but can't be edited.

Steps to reproduce :
- Install Discuss
- Go to channel settings
- Try to add a member by clicking on "Add a line"

Reason :
Since commit 89eef4cdd419cc23cfb8d3e0af7a7115119549c2 , 'partner_id' field as been set to readonly because it doesn't make sense to edit the partner_id of a channel. However, this prevents the possibility of adding a member.
( diff : https://github.com/odoo/odoo/pull/75496/files#diff-d02eca5ffaa6b9765330a905661cd6cb917b92d851b473d459ee011bb2c5be3cR17 ).

OPW-2677329

closes odoo/odoo#80326

X-original-commit: 9536f8ec556670f67939fdee825630e06d5b4808
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-24 14:04:32 +00:00
Julien Van Roy c31f971508 [IMP] account: hide field currency on misc journal
- Hide the field 'currency' on the journal entries (for the miscellaneous journals only) because it is neither necessary functionally nor doing anything technically.
- Accounting journal views: amount in currency is made optional (shown by default)
- Journal entry view: currency is made optional (hidden by default)

closes odoo/odoo#79486

Purpose: lighten the user interface/make it clearer
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-11-24 14:04:28 +00:00
Odoo's Mergebot d5f7f6c21e [MERGE] survey: improve survey views, especially kanban
PURPOSE

When dealing with lot of surveys kanban view is not really optimal and its
state based grouping is not really helpful. Indeed we do not have total of
each coumn and there is not point adding new states, meaning most surveys
hang in the same column. This is not an optimal display.

SPECIFICATIONS

Improve ungrouped display as this is the main usage of surveys. It should
be displayed like a global list view: each card should take the whole
screen (like ``Visitor`` kanban view). Each line contains some "columns"
holding statistics. We notably use a progressbar to display a nice passed
ratio, as well as a many2one avatar widget to make survey enters the era
of amazing wow kanban views.

When grouped, display should be the old one, aka a standard card.

This is done using a small CSS hack: card template actually consists in main
templates related to two displays. Each card style is hidden depending on being
groups or ungrouped. This triggers a class that is used using CSS to hide
irrelevant content.

A ribbon is also added on kanban cards displaying an Archived danger ribbon
when survey is not active anymore. It is therefore coherent with the form
view display that also has a ribbon defined.

An override in website_slides_survey is added to add number of courses using
the survey.

Order is updated so that new surveys are on top. No need to be bloated by
old ongoing surveys when creating new one.

Finally, some labelling is done with answers to be clearer: registered (number
of raw user inputs), completed (finished answers), certified or passed (quiz
with certification activated or not).

Task-2388785

closes odoo/odoo#77227

Related: odoo/upgrade#2862
Related: odoo/enterprise#21194
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-11-24 15:04:22 +01:00
Thibault Delavallée d5b688956b [IMP] survey: display a list-kanban when being ungrouped
PURPOSE

When dealing with lot of surveys kanban view is not really optimal and its
state based grouping is not really helpful. Indeed we do not have total of
each coumn and there is not point adding new states, meaning most surveys
hang in the same column. This is not an optimal display.

SPECIFICATIONS

Improve ungrouped display as this is the main usage of surveys. It should
be displayed like a global list view: each card should take the whole
screen (like ``Visitor`` kanban view). Each line contains some "columns"
holding statistics. We notably use a progressbar to display a nice passed
ratio, as well as a many2one avatar widget to make survey enters the era
of amazing wow kanban views.

When grouped, display should be the old one, aka a standard card.

This is done using a small CSS hack: card template actually consists in main
templates related to two displays. Each card style is hidden depending on being
groups or ungrouped. This triggers a class that is used using CSS to hide
irrelevant content.

A ribbon is also added on kanban cards displaying an Archived danger ribbon
when survey is not active anymore. It is therefore coherent with the form
view display that also has a ribbon defined.

An override in website_slides_survey is added to add number of courses using
the survey.

Order is updated so that new surveys are on top. No need to be bloated by
old ongoing surveys when creating new one.

Finally, some labelling is done with answers to be clearer: registered (number
of raw user inputs), completed (finished answers), certified or passed (quiz
with certification activated or not).

Task-2388785

Part-of: odoo/odoo#77227
2021-11-24 14:04:20 +00:00
Thibault Delavallée f13857bf74 [IMP] survey: update views naming
As we are about to refactor survey views, especially kanban, let us rename
some views xml IDs. Especially they have few overrides so quick to do.

Task-2388785

Part-of: odoo/odoo#77227
2021-11-24 14:04:20 +00:00
Thibault Delavallée 937e5e181a [IMP] mail: allow to display responsible name in avatar widget
Currently mail override of avatar user widget strips user name in
kanban view. Real reason is quite obscure, see odoo/odoo@59641325c7

In this commit we add an option to display both the avatar and the name.
Sometimes you want to display an avatar and a name to have a nice display
especially when focus is more on the displayed user / partner than on
chat capabilities.

Task-2388785

Part-of: odoo/odoo#77227
2021-11-24 14:04:20 +00:00
Michael (mcm) 8f3c693b7d [FIX] web: fix calendar popover opening
Before this commit, the opening of a calendar popover could crash
because we tried to evaluate the domain of the readonly modifier.
Only the invisible modifier is necessary in the calendar popover so
this commit fixes the issue by evaluating only the invisible modifier.
It was also evaluated twice to do both the same thing so this commit
remove the duplicated lines.

closes odoo/odoo#80318

X-original-commit: c558ae309ff63a26c30ea0196930eb15a279e1dc
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-24 13:17:14 +00:00
Michael (mcm) 4649d9c0a2 [FIX] web: fix readonly patch._super
Since https://github.com/odoo/odoo/pull/79858,
we define the patch._super with an `Object.defineProperty`.
It works well but it prevents objects from being patched
by the legacy patch method afterwards.

closes odoo/odoo#80317

X-original-commit: 2090e09c51876b9b8af4097ca8f093a8c19361e0
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-24 13:17:10 +00:00
Paul Morelle 6223ac2130 [FIX] sale_project: prevent unacceptable project form loading time
Previous implementation was generating an unoptimised query which
lead to unacceptable loading time on large databases.

task-2697814

closes odoo/odoo#80316

X-original-commit: fa1578abea4ebe887d4e23a81bb1011ed986cc0c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-24 13:17:05 +00:00
Lois Rilo 7e3f429911 [IMP] stock: add hook to control lot creation on incoming shipments
closes odoo/odoo#80314

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-11-24 13:17:01 +00:00
Alexandre Kühn 89218e7e82 [IMP] mail: use t-component with component as value
Was done with https://github.com/odoo/odoo/pull/80084
But then https://github.com/odoo/odoo/pull/79259 reintroduced
`t-component` with string.

In preparation for using OWL v2 in Discuss code.

Task-2694217

closes odoo/odoo#80307

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-24 13:16:56 +00:00
Fabio Barbero 43fc87ecc4 [IMP] mass_mailing: improve mailing form view
Purpose
=======

Improve UI of mass_mailing module to give the user a clearer view of the
mailings they send, enabling A/B test by default since it is not invasive.

Specifications
==============

Remove border and padding around the chatter in mass mailing form view.
Add sum and average in mailing list view for KPIs
Change sort order from sent_date to calendar_date
Move user_id in form view
Set group_mass_mailing_campaign to True by default

Task-2679537

closes odoo/odoo#79213

Related: odoo/enterprise#22202
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-24 13:16:52 +00:00
Aurélien Warnon 4a329da6a0 [IMP] website_slides: improve quiz error management
This commit slightly improves the quiz error management when building a quiz
directly on the website or when answering to the quiz.

When there is a validation or submission error, instead of displaying a toaster
very far from the user focus, we add the error next to the button he just
clicked.

For the question validation, this requires a small trick in the controller,
where we catch the ValidationError to return the message to the JavaScript.

Task-2678061

closes odoo/odoo#79081

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-24 13:16:45 +00:00
Benjamin Vray db27973180 [IMP] website, website_livechat: redesign and improve livechat button
After this commit:

- The livechat button is redesigned as a floating icon in website.
- The "colliding" check between buttons and bottom fixed elements is no
longer done only on the buttons but also on the <a> elements.
- When the livechat button hides a button/link, it is moved up rather
than made invisible.

task-2614762

closes odoo/odoo#78891

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-11-24 13:16:40 +00:00
Adrien Widart f0a835a404 [FIX] sale_stock: let public users open the DO
From the portal view of a SO, when a public/portal user tries to open
the delivery order, he will have an error

To reproduce the issue:
(Need sale_management. Use demo data)
1. Create & Confirm a SO:
    - Customer: Joel Willis
    - Add some products
2. Log in as portal (i.e., Joel Willis)
3. Open the SO
4. Open the Delivery Order

Error: It leads to a 403 error page.

When rendering the template, the `sudo` flag is forced to False. Since,
in this case, this is a public controller that uses a token, we can use
`SUPERUSER_ID` (see [1] for more details)

[1] 61b4b6777d64218f94c51ec839c187fdc7b2034f

OPW-2689053

closes odoo/odoo#80308

X-original-commit: cb098f6348ddc85edfef06c284c74c8af44ca7ba
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-11-24 12:31:21 +00:00
Elisabeth Dickinson 8a01be5d62 [IMP] base: redesign company image
Align style of company_image.png with avatar_grey.png to keep interface
and usage coherent.

Task-2487489
Task-2688887

closes odoo/odoo#80304

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-24 12:31:17 +00:00
Thibault Delavallée 7c95dd9506 [IMP] sales_team, crm: add chatter on team member view to display trackings
Currently no chatter is added on team member form views. Indeed this model is
mainly technical and accessed through a dedicated menu in configuration.

However some fields are tracked and being able to see tracking information is
important in day to day dealing of team members. This is why we add chatter
on team members form view.

We also add context key to avoid autofollow when creating team members. As
chatter is mainly present for tracking and information no need to add extra
followers automatically. This causes unnecessary notifications.

Task-2679897

closes odoo/odoo#79356

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-24 10:18:24 +00:00
Odoo's Mergebot de8af73f9a [MERGE][REF] website_slides: rework the slide.embed feature
PURPOSE

Make the slide.embed feature more reliable and more visible.

REASON

Currently, we use the same URL to embed slide content within the e-learning
module and when the end-user wants to embed that content on an external
website.

However, we want to know whether the slide is embedded externally or not to
show different controls and update some statistics.
The code previously relied on the presence of the "referer" header to achieve
that detection, if the referer URL comes from a domain that is not this Odoo
website -> then it's embedded externally.

The issue with that strategy is that it's not very reliable, indeed some modern
browsers now completely avoid passing the referer header (mostly for security
and privacy reasons).

SPECS

- Introduce an external embed URL to ease external embed logic
- Improve various sharing controls when slide is embedded externally
- Globally improve the slide.embed feature and give it more visibility

See underlying commits for more details.

LINKS

Task-2654009

closes odoo/odoo#77736

Related: odoo/upgrade#3059
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-24 11:18:19 +01:00
Aurélien Warnon 043b3385d2 [IMP] website_slides: improve slide.embed feature
Currently, the slide.embed statistics only work if a 'Referer' header is passed
in the request object.

The issue with that strategy is that it's not very reliable, indeed some modern
browsers now completely avoid passing the referer header (mostly for security
and privacy reasons).

This commit refactors the slide.embed feature to work even without a referer
header.
When the header is missing, the incremented count will be stored under a
common slide.embed record with a url field = False.

This count is still useful because the end-user will want to know if the slide
is popular externally, even if we don't know on which website it has been
embedded exactly.

In addition, we add more visibility to the slide.embed feature by introducing
a stat-button on the slide.slide form view, that redirects to the list of
slide.embeds for this slide.

Finally, we also renamed the 'embedcount_ids' field to 'embed_ids' to get a
better / clearer naming.

A few tests about embed detection were added to ensure this behavior.
(Tests are based on the work of Nathan Marotte <nama@odoo.com>).

Task-2654009

Part-of: odoo/odoo#77736
2021-11-24 10:18:17 +00:00
Aurélien Warnon 1a21b0896a [MOV] website_slides: move slide.embed model into its own file
As we are going to do some rework on the slide.embed feature, let's put the
model into its own python file.

Task-2654009

Part-of: odoo/odoo#77736
2021-11-24 10:18:17 +00:00
Aurélien Warnon 6638b79c5e [IMP] website_slides: improve sharing control when slide is embedded
This commit improves the sharing control when the slide is externally embedded,
meaning embedded outside of the Odoo website, on a third party.

Previously, there were several buttons to share (by email / social / embed),
but the end result was really strange with some kind of overlay content
displayed on top of the PDF viewer that was almost unreadable.

Now, we simply re-use the "slide_share_modal" template to get a consistent
sharing feature whether it's embedded externally or not.

Side note: this removes the ability to share by email, which was not working
anyway since it requires the user to be logged-in to the system, which will
most likely never happen if said user is actually viewing the slide on a third
party website.

Task-2654009

Part-of: odoo/odoo#77736
2021-11-24 10:18:17 +00:00
Aurélien Warnon 1ab9455a9a [IMP] website_slides: refactor slide.slide embed detection
This commit slightly changes the embed detection for slides.

Currently, we use the same URL to embed slide content within the e-learning
module and when the end-user wants to embed that content on an external
website.

However, we want to know whether the slide is embedded externally or not to
show different controls and update some statistics.
The code previously relied on the presence of the "referer" header to achieve
that detection, if the referer URL comes from a domain that is not this Odoo
website -> then it's embedded externally.

The issue with that strategy is that it's not very reliable, indeed some modern
browsers now completely avoid passing the referer header (mostly for security
and privacy reasons).

Instead, we change this to let users embed on external websites with a
*different* URL.

When the embed comes from '/embed_external/', we now easily know that it comes
from an external embed and don't have to do some further and potentially tricky
processing.

We introduced a computed 'embed_code_external' field that is computed the same
way as the embed_code except for that small route distinction.

This also easily solves any issue that could come with multi-website /
different root URLs etc.

Task-2654009

Part-of: odoo/odoo#77736
2021-11-24 10:18:17 +00:00
baa 61d7af7611 [ADD] pos_l10n_sa: include a qr code on the pos receipt for SA
New Saudi law starting 1 of december 2021 mandate the presence of a qr code on the pos receipt

closes odoo/odoo#80299

X-original-commit: 8de297258eb6bdeabc179b365b2ff0513ae364ad
Signed-off-by: Masereel Pierre <pim@odoo.com>
2021-11-24 09:32:07 +00:00
baa ea91b778c9 [ADD] pos_l10n_gcc: arabic/english pos receipt for GCC members
Most GCC member countries have laws that mandate all receipts to include arabic

X-original-commit: a76274fbd18e2f9edb0a653e75b5e81f3411af20
Part-of: odoo/odoo#80299
2021-11-24 09:32:07 +00:00
Nicolas Bayet 10385a2aac [FIX] web_editor: keep table styling
Before this commit, the styles of the table were not kept when
copy/pasting a table generated by the Odoo editor. Now it is.

Task-2657445

closes odoo/odoo#80246

X-original-commit: 6f4eff378fc24bdd5e8a84ee485832162108a400
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-24 09:32:00 +00:00
Nicolas Bayet 74ffa03861 [FIX] web_editor: prevent link dialog to close upon error
Before this commit, if the link dialog had unvalid form data, and the
user clicked on the "save" button, the link dialog tried to close
and save with no data.

Now, it is not possible to close the dialog if the form data is invalid.

Task-2583696

closes odoo/odoo#80245

X-original-commit: c7f574c1044d5710c156f747c9b8647d6aeb3ff7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-24 09:31:56 +00:00
Goffin Simon 7a5466a8ec [FIX] hr_expense: Wrong tax in multi companies
Steps to reproduce the bug:

- Let's consider two companies C1 and C2 where C1 is the parent of C2
- Let's consider an expense product P with T1 as tax in C1 and T2 as tax in C2
- Let's consider an expense alias A defned for C1 and C2
- Let's consider an employee E in C2 with work email address W
- Send from W to A an email with subject [internal reference of P] Test Expense 1000€

Bug:

An expense is created in C2 with T1 and T2 as supplier taxes instead of only T2

Inspired from function _compute_tax_id defined in model sale.order and purchase.order

opw:2507162

closes odoo/odoo#80250

X-original-commit: a3daaf4d3a22e403ca891a1d396380e118020164
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-24 07:56:13 +00:00
stefanorigano (SRI) 539ccabe4f [FIX] website_sale: snippet_filter demo image url
Update some missing urls that should have been adapted with https://github.com/odoo/odoo/commit/d063d99e1590856561f0fffe5acf38747e359d86

closes odoo/odoo#80178

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-11-24 06:59:53 +00:00
Florent de Labarre a805e0cf53 [FIX] point_of_sale : impossible to reversea paiement after reload
1. add an electronic payment, send it
2. you show "reverse paiement"
3. reload the POS
4. go back on the payment
--> Issue "reverse payment have disappear"

closes odoo/odoo#80283

X-original-commit: 0816dbd99ad8a394542057aab9618a5504c68e64
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Masereel Pierre <pim@odoo.com>
2021-11-23 18:34:54 +00:00
Florent de LabarreandJoseph Caburnay caf7eb2090 [FIX] point_of_sale: singleton error
Issue 1: fix singleton error if open pos session en batch
Issue 2: in large database to search all pos.session to get just one

closes odoo/odoo#80277

X-original-commit: 63500d6357f6f27724d1cda44db071aba968515a
Signed-off-by: Masereel Pierre <pim@odoo.com>
Co-authored-by: Joseph Caburnay (jcb) <caburnay.joseph@gmail.com>
2021-11-23 18:34:50 +00:00
baa 37dd08d776 [FIX] l10n_gcc_invoice: fix traceback on invoice when a section is present + fix arabic display on the section subtotal
having a section or a note on the invoice would trigger a traceback when printing the invoice for a GCC company. The arabic/english label inside that element would not display properly either

closes odoo/odoo#80276

X-original-commit: b8af5a493d8b1735735f5edee14be4a117cb66b8
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-11-23 17:53:53 +00:00
Joseph Caburnay 1e15908622 [FIX] pos_{hr,restaurant}: show opening cash control popup at the right time
1. pos_hr: Show the popup when an employee is logged in.
2. pos_restaurant: Show the popup already in the FloorScreen, no need
to click a table to see the popup.

closes odoo/odoo#80268

X-original-commit: eacfd60b1acfb6b793ac9d65c1cf63c24930cf2e
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2021-11-23 17:53:49 +00:00
Louis Wicket (wil) 2cb3f774a1 [IMP] mail,*: change model declaration syntax
* = calendar, crm_livechat, hr, hr_holidays, im_livechat, mail_bot, sms,
     snailmail, website_livechat

This commit will change the declaration of the models with the aim of
getting closer to a plain JSON-object. It allows us to eliminate a wide
portion of boilerplate code, making the declaration shorter, more
declarative, and less redundant, but mainly, it prepares the ground for
further changes.

Task-2695223

closes odoo/odoo#79259

Related: odoo/enterprise#22042
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-23 17:53:46 +00:00
William Henrotin 9a19583700 [FIX] purchase_stock: create and confirm the same day
Testing purchase order creation assumes the whole test is done the same
day. The assert could failed if the test is run right before midnight
and end the day after.

This commit ensure the time is frozen during all the tests about
purchase order creation.

closes odoo/odoo#80264

X-original-commit: 438e47cdc87fc0f13c61a1ede29a190120dea117
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-11-23 17:06:47 +00:00
Aktiv Software b27d1176f8 [FIX] website_crm_partner_assign: fix template variable usage
Fixed error on rendering template of email_template_lead_forward_mail when
clicking Forward to partner.

Issue is
'dict' object has no attribute 'lead_id'.

This was because in Odoo v14, jinja was used and using a dict like properties
was ok. With QWeb it crashes and we have to correctly handle the dict.

Fixes #79492
Task-2657930

closes odoo/odoo#80259

X-original-commit: 7facd634328ad2038a13f75a3616b753e8fef147
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-23 14:42:12 +00:00
jbw 82763d81bf [FIX] account: fix manual reconciliation widget
- set journal_id, tax_ids, analytic_account_id, analytic_tag_ids & force_tax_included as optional hide
- fix _get_write_off_move_lines_dict to make clicking a reconciliation model button have the same result as doing the operation manually :
    - add journal_id parameter
    - use reco line label in new aml name

closes odoo/odoo#80176

Task: 2611348
X-original-commit: 4514f0ec4a1eebb4652c34c4926d0cd1ff336e17
Related: odoo/enterprise#22435
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-23 14:42:05 +00:00
thcl-odoo f09482c57f [FIX] payment: use correct target on onclick event
Current behavior :
If we click on the icon rather than the label we got a crash

Steps to reproduce :
- Enable Online Payment and configure an acquirer and add the possibility to save the card
- Go to the Website and Log in (e.g. as `Marc Demo`)
- Go to your account (from dropdown menu > `My Account`)
- Manage you payment methods and add a new one
- Try to delete the newly added payment method by clicking on the trash icon in the button

Reason :
Currently, we rely on the `target` property of the event (triggered after clicking on the button).
The problem is that, as in this case, if a button has an HTML element as a child and we click on this child, `target` property will target the child whereas in this case we want to retrieve the button and not the child.

Using `currentTarget` property instead of `target` allows us to retrieve the button no matter what since `currentTarget` always refers to the element to which the event handler has been attached.

OPW-2660186

closes odoo/odoo#80253

X-original-commit: e8ec4fb6aa9ee4796d486a3d32e6a9a5e1382548
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Claude Thibault (thcl) <thcl@odoo.com>
2021-11-23 13:55:05 +00:00
Florent de Labarre 49a23bb3fa [FIX] base: simplify field dependencies to avoid costly invalidation
Consider upgrading module 'base' on a database with millions of 'res.partner' records.
The upgrade of country and country state data makes a very costly search to reverse
the dependencies of the non-stored computed field 'contact_address', just for the sake
of invalidating its value from cache, which is most probably not present at all.  The
cost of the search is so high that it may prevent from upgrading the module (timeout).

closes odoo/odoo#80251

X-original-commit: b7f9d0b7c3dfbca0f4897a650983a298da811ce1
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-11-23 13:55:01 +00:00
Didier (did) e1084c4536 [IMP] mail: create activity_box model
This PR introduce activity_box_model to handle the activity_box component logic.

part of task-2579306

closes odoo/odoo#79993

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-23 13:54:57 +00:00
Cedric Prieels (cpr) 0d2c09a938 [FIX] project_account: fix the analytic accounting setting
Before this fix, the "Track costs & revenues by project" option is missing
from the project module if both project and invoicing are installed.

Now, this setting is shown on the project module until accounting is installed,
as expected. It is then shown in the settings of the account module.

task-2695812

closes odoo/odoo#80045

Related: odoo/enterprise#22370
Related: odoo/upgrade#3051
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-23 13:09:47 +00:00
Guillaume (guva) aa5d7358fa [FIX] l10n_fr: tax data for tva 10%
Steps to reproduce:

-In a database with french accounting,
- The fields cash_basis_transition_account_id and invoice_repartition_line_ids are not well configured

opw-2669061

closes odoo/odoo#80229

X-original-commit: 17b9a2046502fffd9a21d6da3fff82a7dae54256
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: Guillaume Vanleynseele <guva@odoo.com>
2021-11-23 12:04:16 +00:00
Bonis ModiandKartik Chavda f4c054e473 [IMP] project, hr_timesheet, *: improve generic ux
Purpose of this commit to improve generic UX for the project app.

So, In this commit done following changes:

- add 'subtask_effective_hours' and 'total_hours_spent' fields in the page of
subtask in task form view.
- change invisible attrs to column_invisible attrs for block_by page in task
form view.
- add 'task in progress' subtype for project.task and move 'stage changed'
subtype above 'task blocked'.
- remove the 'is_close' field and all its references from project.task.type.
- unarchive all of its tasks when the user unarchives the task stage.
- sort projects on 'is_favorite'.
- internal users following the project automatically follow its updates and
their notification preferences propagated accordingly.
- duplicating a task will duplicate all of its subtasks.
- move parent task field in extra info page of task form view.
- change the label of 'edit' to 'view' in the burger menu of project kanban view.
- user can delete task without sale_order validation error.
- add constraints for 'seller_ids' field.
- add remaining_hours_so field in task tree view.
- add unusual_days in task calendar view.
- add 'no content helper' in action of burndown chart.

task-2536044

closes odoo/odoo#74018

Related: odoo/enterprise#19880
Related: odoo/upgrade#2801
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Co-authored-by: Kartik Chavda <kcv@odoo.com>
2021-11-23 12:04:00 +00:00
Benoit Socias 6b9183a322 [FIX] website: accept default template key in dynamic snippets
Before this commit the "first" template key was selected by default
before the default options were being considered. Because of this,
setting a specific default template key was always ignored since a
template was already selected.

After this commit the widget keeps track of which value is actually a
default one, allowing for setting a specific default for the template
key.

task-2680578

closes odoo/odoo#80207

X-original-commit: 84130ffb5c7f728e7e61d6979d78c496c473947e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-11-23 11:12:18 +00:00
Cedric Prieels (cpr) ea038c6b19 [IMP] project: follow up the project overview removal
The project overview is a significant technical debt
as it is a custom qweb view. It is quite limited:

It is not possible to group the data, to filter on dates,
SOs or Field Service projects.
Improving this is very difficult and would require weeks
of development that are not worth it.
In any case, all the information provided by the project overview
can be found elsewhere. The stat buttons of the report are basically
duplicates of the ones from the project form view.
Therefore, we are removing this report and its twin,
the Project Costs and Revenues.
In addition, analytic items lack context for the user to understand
what generated a certain cost or revenue:

there is no link to the source document;
the entries are not categorized (e.g. it is not easy to understand
if a cost comes from a timesheet cost, a purchase order or an expense);
the billable type group by works fine for timesheets but then all
the other entries are flagged as Undefined, which is not very helpful;
there is no option to easily isolate costs from revenues.

task-2646234
See odoo/enterprise#20936

closes odoo/odoo#76553

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-23 11:12:14 +00:00