Commit Graph
146395 Commits
Author SHA1 Message Date
Cedric Prieels (cpr) d3e7bd1904 [IMP] {sale_timesheet}: improve the margin displayed on project update
The Gross Margin stat button does not display the same value as the margin shown
AAL linked to the AA of the project, which might be confusing. This has been
improved by changing some labels, and adding some explanatory tooltips.

task-2671576

closes odoo/odoo#78739

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-12 20:53:17 +00:00
simonev 2857980a6c [FIX] auth_totp: add missing model decorator on change_password method override
Declared as an api.model in all the other modules except auth_totp

closes odoo/odoo#79726

X-original-commit: 61b319ea2b5ffc70e0fd80eb62b8a3f700be0f1f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-12 18:07:15 +00:00
Ivan Yelizariev a437b3ed33 [REF] account: make fields definition more readable
Since we don't have other docs for `account.tax.report.line`, let's just improve
source readability

closes odoo/odoo#79696

Signed-off-by: William André (wan) <wan@odoo.com>
2021-11-12 17:25:52 +00:00
Philippe Wauthy da642c06e3 [IMP] resource: allow to use _adjust_to_calendar with or without leaves
Allow to use _adjust_to_calendar with or without leaves.
This PR adds a keyword argument to the _adjust_to_calendar, _get_closest_work_time and _work_intervals_batch to include or not the employee being on leave when searching for the start and end of the shift.

task-2632775

closes odoo/odoo#79127

Related: odoo/enterprise#21944
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-12 16:34:58 +00:00
Romain Derie 9a1f868de5 [FIX] mass_mailing: correctly hide editor button
Since this [commit], the layout style was improved to not break when the save
and discard button are translated.
But it was breaking the mass mailing editor, as those button were not hidden
anymore.

[commit]: https://github.com/odoo/odoo/commit/120c88a6fffc111afba734c60eb06cf0543c1760

closes odoo/odoo#79719

X-original-commit: 940ac7a6c0d54e9ef8a89b0dc74b892209e1c125
Signed-off-by: Antoine Guenet <age@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-11-12 15:48:11 +00:00
lejeune quentin 5a431ff23e [FIX] pos_adyen: Fix the last status deleted
Actually the last status is deleted by the fist request who can reach it
So if a request is lost the answer too

With this fix we delete the last response only when we start a new one

closes odoo/odoo#79706

X-original-commit: 63abab836d95df9a45f6f7d038bb18df88f864b4
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2021-11-12 15:48:07 +00:00
SimoneVagile 8f73a13c71 [CLA] signature for SimoneVagile
closes odoo/odoo#79711

X-original-commit: c1716b419093edb8c99605a8e131908165db96a4
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-12 15:03:48 +00:00
Sébastien Geelen (sge) 287913ebbf [FIX] web_editor: fix translate button position
The translate button was overlapping the codeview button
in the mail template view.

task-2683847

closes odoo/odoo#79704

X-original-commit: 8a6de9089bfd77f5fdc6f4a11016906454e442cc
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-12 13:35:54 +00:00
roen-odoo e1a55d8324 [FIX] mrp : bom report duration for dozens
Current behavior :
When a bom is created with uom set as dozens the report
operations time is not correct. For exemple if the operation
time is 10 minutes. The operation time for a dozen should be
120, but at the moment it's 10 minutes

Steps to reproduce:
Have a product in units.
Create a bill of materials in dozens.
Have a operation where the workstation that has a capacity of 1.
Look at the Bill of material cost and structure even though it uses a dozen it shows
the operation time for one unit.

opw-2669899

closes odoo/odoo#79624

X-original-commit: 11f905737ea73aaf26dc792639abf66549a31864
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2021-11-12 12:49:52 +00:00
Leonardo Pavan Rocha 351056ec5d [IMP] base,hr: add tests for avatar mixin
In task 2404630 the avatar feature was created and no tests were written due to
the iminent freeze. This PR implements tests for the avatar feature, such as
avatar generation and placeholder logic.

task-2578233

closes odoo/odoo#79688

X-original-commit: 400b3fd93266f88832446c8f7422f6e14b958115
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-12 12:00:23 +00:00
Florian Damhaut 41f7426595 [FIX] hr_holidays : Only show allocable leaves in allocation requests form
Current Behaviour :
Employee can request any type of leave.

Behaviour after the PR:
Employee are only shown leave that they can request.

opw-2684670

closes odoo/odoo#79502

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-11-12 10:30:57 +00:00
Aaron Bohy 1bb9cb89c8 [FIX] web: setup luxon locale from user lang
Before this commit, luxon wasn't configured with respect to the
user lang, meaning that months weren't translated (for instance,
in the filter menu, date(time) filter options, or in the datepicker
displayed in the "Add custom filter" sub-drodown).

closes odoo/odoo#79644

X-original-commit: 9530b0a2462aca0938ce315cee262b147b7a5634
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-11-12 08:25:53 +00:00
Josse Colpaert a4a2d100c4 [FIX] l10n_it_stock_ddt: separate xpaths might need the invisible fields for inheritance purposes
Before, when installing stock_picking_batch after l10n_it_stock_ddt,
it would give a traceback because the header was replaced in a view
in stock_picking_batch and that removed the invisible field that was
used in an attrs in another place.

So we add the field again in that other place.

closes odoo/odoo#79655

X-original-commit: 997f888a325509c72b2a39af346026783f192700
Signed-off-by: William André (wan) <wan@odoo.com>
2021-11-10 19:50:10 +00:00
Nathan Marotte (nama) fd3f40ec38 [FIX] mail : traceback on Marketing Automation Mailings test send
Issue: When test sending a mail in Marketing Automation Mailings, there
is a traceback because we try to set the state of the mail to done,
even though there is no done in mail_mail.state

Steps to reproduce :
 1) Install Marketing Automation
 2) Create/select a campaign
 3) Access the templates of that campaign
 4) Create/select a template
 5) Click Test
 6) Send Sample Email
 -> Traceback

opw-2568210

closes odoo/odoo#79650

X-original-commit: 954c413149befe847a526b54a1fca4c0dd2b16cd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-10 17:23:59 +00:00
Sébastien Theys 4c26e69f53 [FIX] mail: fix crash when message body is null in db
closes https://github.com/odoo/odoo/issues/79229

closes odoo/odoo#79646

X-original-commit: c5a7de48d547846971de59483e56377b8fb85568
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-11-10 16:40:52 +00:00
Odoo's Mergebot b21755fbdc [MERGE] gamification: improve challenge views and reorder module
PURPOSE

Gamification display is slow when being heavily used. Indeed the m2m towards
users is used in kanban and form views, leading to a huge data fetch when
being used in production environment with lots of users.

SPECIFICATIONS

Remove user_ids m2m from views. Indeed in some heavily used DBs you may have
more than 10K records in user_ids, leading to a huge m2m tags to display.

Replace it by an optimized count, used in

  * form view: as a stat button redirecting to participants of a challenge;
  * kanban view: a line (replacing the 11 first avatars) redirecting to
    participants of a challenge;

Also of this commit is to rename and reorder views, data and models by main
model. It allows to better understand module organization and find views
one may have to update.

Task-2678295

closes odoo/odoo#79599

Related: odoo/upgrade#3020
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-10 15:30:51 +01:00
Thibault Delavallée 07c872d674 [IMP] gamification: remove m2m display
PURPOSE

Gamification display is slow when being heavily used. Indeed the m2m towards
users is used in kanban and form views, leading to a huge data fetch when
being used in production environment with lots of users.

SPECIFICATIONS

Remove user_ids m2m from views. Indeed in some heavily used DBs you may have
more than 10K records in user_ids, leading to a huge m2m tags to display.

Replace it by an optimized count, used in

  * form view: as a stat button redirecting to participants of a challenge;
  * kanban view: a line (replacing the 11 first avatars) redirecting to
    participants of a challenge;

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:50 +00:00
Thibault Delavallée 3fe3c7a234 [MOV] gamification: reorder and rename data files
Purpose of this commit is to rename and reorder data by main model. It
allows to better understand module organization and find data one may have
to update.

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:50 +00:00
Thibault Delavallée 0a03960e8b [MOV] gamification: reorder and rename model files
Purpose of this commit is to rename and reorder models by main model. It
allows to better understand module organization and find models one may have
to update.

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:50 +00:00
Thibault Delavallée 4d7efe41f5 [MOV] gamification: move menus definition
Purpose of this commit is to have all gamification menus defined in a single
file. It helps reorganizing a module TOC (menus) when doing some b2b like
on an app. Otherwise menus are split across several files and finding them
and keeping them organized is not easy.

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:49 +00:00
Thibault Delavallée 2ae9d590e1 [MOV] gamification: reorder and rename view files
Purpose of this commit is to rename and reorder views by main model. It
allows to better understand module organization and find views one may have
to update.

Task-2678295

Part-of: odoo/odoo#79599
2021-11-10 14:30:49 +00:00
Guillaume (guva) 6200696ecc [FIX] account: Fix taxes computation in multi-currency
Steps to reproduce:

- On a company with multi currency
- Set the company currency rate to 1, and the foreign currency
  to 0.273748
- Create a vendor bill
- Set first the foreign currency, then select a product with a
  tax to 21% and a price unit of 155.32
- Go to 'Journal Items', the 'tax paid' line debit is computed to 119.15
- Reselect the foreign currency on form.
- Now the 'tax paid' line debit is computed to 119.16

The total is also impacted as the tax changed.

Explanation:

Before this commit, the taxes was both computed in foreign currency and company currency. However, when setting a new currency or changing the date, the taxes wasn't recomputed but the new conversion rate was applied.
This commit is fixing the issue by applying the same logic as in 14.0: the taxes are always computed only the foreign currency, then the conversion rate is applied to get the accounting balance.

opw-2569668

closes odoo/odoo#79618

X-original-commit: 11f5fcfb577b117b279f5d96095e9c0798d78bbd
Signed-off-by: Laurent Smet <las@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-11-10 13:46:25 +00:00
Nasreddin Boulif (bon) 33f8c747b3 [FIX] web_editor: Display correctly top buttons of the editor sidebar
Steps to reproduce :

  - Install website module
  - Activate (and translate website) French language
  - Go to translated terms and fetch for "Discard" in website module
  - Replace the translated value by "Ne pas sauvegarder"
  - Go to Website -> Configuration -> Websites
  - Select main website and change language to french then save
  - Go to Website and edit homepage
  - Add any block

Issues :

  On top of editor sidebar, buttons are not displayed correctly.

Solutions :

  Add css class `d-flex` to the div arround the buttons.

opw-2683602

closes odoo/odoo#79612

X-original-commit: 772156078418544907f9073e242e4491ddae1e5d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2021-11-10 13:46:21 +00:00
Louis Wicket (wil) bf71f4e7c2 [FIX] mail: avoid crashing on partner created from lead
Delete obsolete suggested_recipient_info with isCausal and ensure thread is
required on it.

This is intended to prevent crashing when creating a new partner from a
lead.

Task-2654859

closes odoo/odoo#79619

X-original-commit: fdbbed270d0c266a0e495136b461a4c40f8394bf
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-11-10 12:54:44 +00:00
Tommy (tong)andAaron Bohy 114a5885ba [FIX] web: rpc error handling: use normal dialog if possible
Before this commit, automated actions could not raise "normal"
errors anymore (e.g. UserError). Indeed, since the wowl refactoring,
it always shows the custom BaseAutomationErrorDialog when an error
is thrown in an automated action, even if it is a standard error
well-known by the framework. Before the wowl refactoring, those
errors were handled normally if possible, and when it wasn't the
case, the custom BaseAutomationErrorDialog was used.

This commit restores that behavior.

Complete steps to reproduce:
- Install base_automation module
- Install an app for the base_automation to trigger (e.g. Sales)
- Turn on debug mode
- Go to Automated Actions
- Create an action with Action To Do is Execute Python Code and the Trigger is On Creation & Update
- Set the model to your app (e.g. SalesOrder)
- Put `raise UserError('Test')` in Python Code section
- Go back to the app, try to create a new record in the model you set for the automated action to trigger
- Compare the result with 14.0

closes odoo/odoo#79611

X-original-commit: d65d742de1b30a00b3ffd872c042e002736f7f6b
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2021-11-10 11:28:15 +00:00
William Henrotin 8fdd6f095d [FIX] purchase_stock: relax the location constrains
The constrains on orderpoint location being related to the warehouse view
location was too restrictive especially in a complex subcontracting flow
with dropship.

This commit change the constrains to only be triggered if the two
location to be compared have both a warehouse.

closes odoo/odoo#79593

X-original-commit: 871cd6ad2d986ee1c28804aeeee63a001156154a
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-11-10 10:43:22 +00:00
Stefan RijnhartandRaphael Collet 8f574a274a [14.0][FIX] Keep original kwargs intact for reuse on retry
closes odoo/odoo#79589

X-original-commit: 6387619d308c8969cbafe6acf77f6d22075ac6ba
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2021-11-10 10:43:17 +00:00
anhe-odoo 8b6742cb83 [FIX] accounting: fix invoices preview total and untaxed amounts
Expected Behavior

The total amount and total taxes amount in invoice, purchase order and offer should be formated with the correct formating options (related to the client's location), and with the correct currency symbol, as it was the case in V14

Observed behaviour

In V15, these amount are written as pure numerical values (eg : 1452.24 instead of $1.452,24). This is the case in every generated pdf, as well as in the user portal preview(s), but not in classical form view(s).

Reproducibility

This bug can be reproduced following these steps:
- Create a new invoice
- Validate it
- Preview it in the user portal of download the printable .pdf
This can also be done with a purchase order, following the same steps.

Problem Rout Cause

The problem comes from the fact we read the wrong fields, using account.tax_totals.amount_total and account.tax_totals[subtotals].amount instead of account.tax_totals.formatted_amount_total and account.tax_totals[subtotals].formatted_amount.

opw-2666924
opw-2666553
opw-2665130

closes odoo/odoo#78762

X-original-commit: 2d632013af87f3d4e639bd79595fcbc69aeb4f51
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-11-10 10:43:11 +00:00
Anh Thao Pham (pta) 15a6a96107 [FIX] point_of_sale: fix price alignment in POS receipt
- Configure a Receipt Printer for POS
- Create a Product with a long name (> 20 chars) and a big price
(i.e. PRODUCT BCDEFGHMWPGHHH - price: 9999.00)
- Create a Product with a short name (i.e. PRODUCT Z - price: 12.00)
- Make a POS sale with long product first and short as second
On the receipt, the line containing long product is too small to
contain also its price.
So the price will be on another line justified on the right.
But the following product will be stacked on the same line, making
the price on the receipt unreadable.

Someting like this:
-------------------
PRODUCT BCDEFGHMWPGHHH
PRODUCT Z     12.009999.00

The issue also appears for taxes lines and on the report of all sales
of current POS session.

This is due to a css style (float: right) applied to the price part.

opw-2639120

closes odoo/odoo#79595

X-original-commit: c565695b895a012a3953416fab60fe71d6f70665
Signed-off-by: Anh Thao PHAM <pta@odoo.com>
2021-11-10 09:58:22 +00:00
Odoo's Mergebot 72b028fbb2 [MERGE] mail, various: improve notification layout buttons and usage
PURPOSE

Display "View document" link on notification emails using the 'light' layout
as done in standard layout.

Cleanup layout xml id propagation through composer or email sending in
mail and various applications.

SPECIFICATIONS: LAYOUT XML ID USAGE

Get rid of context usage and use a real field on mail.compose.message model.
Support old context key in composer for backward compatibility, working like
a default value for the field itself.

On template model: rename ``notif_layout`` parameter of ``send_mail`` to
``email_layout_xmlid`` to be coherent with naming used in other parts of the
code. Moreover it better indicates we expect an xml id.

On rating model: rename ``notif_layout`` parameter of ``rating_send_request``
to ``email_layout_xmlid``, for the same reasons as above.

In various wizards: support ``email_layout_xmlid`` context key when no field
is available, notably because this is still done manually in some wizards
like survey invite. Keep a fallback on ``notif_layout`` but remove support of
``custom_layout`` deprecated since quite a long time.

SPECIFICATIONS: ACCESS LINK

Light template is used is several notification processes as an alternate
layout to the classic one. It currently lacks any link to the document that
generated the notifications.

We add this behavior in this commit. Behavior is the same as the classic
notification email, aka a link to mail/view that chooses what to do based
on access rights and user status (internal, portal, ...).

SPECIFICATIONS: MISC

Remove ``mail_notification_borders`` as it is not used anymore.

LINKS

Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer

closes odoo/odoo#76418

Related: odoo/enterprise#20903
Related: odoo/upgrade#2829
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2021-11-10 10:58:11 +01:00
Thibault Delavallée 6908c475c5 [FIX] mail, survey, website_slides: fix logger usage
Make CI/Style happy even if not really related to this PR.

Task-2621326 (Mail: add 'view' button in 'light notification template')

Part-of: odoo/odoo#76418
2021-11-10 09:58:10 +00:00
Thibault Delavallée 4059bbabac [IMP] mail: give access link to document in "light" notification layout
Light template is used is several notification processes as an alternate
layout to the classic one. It currently lacks any link to the document that
generated the notifications.

We add this behavior in this commit. Behavior is the same as the classic
notification email, aka a link to mail/view that chooses what to do based
on access rights and user status (internal, portal, ...).

Task-2621326 (Mail: add 'view' button in 'light notification template')

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Thibault Delavallée f9dbd38720 [IMP] mail, various: rename custom_layout / notif_layout context usage
RATIONALE

Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.

SPECIFICATIONS

On template model: rename ``notif_layout`` parameter of ``send_mail`` to
``email_layout_xmlid`` to be coherent with naming used in other parts of the
code. Moreover it better indicates we expect an xml id.

On rating model: rename ``notif_layout`` parameter of ``rating_send_request``
to ``email_layout_xmlid``, for the same reasons as above.

In various wizards: support ``email_layout_xmlid`` context key when no field
is available, notably because this is still done manually in some wizards
like survey invite. Keep a fallback on ``notif_layout`` but remove support of
``custom_layout`` deprecated since quite a long time.

Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Thibault Delavallée 3659546738 [IMP] mail, various: support email notification xmlid at model level in composer
RATIONALE

Currently we can specify email used for notification layouting through context
use in mail composer. It is then propagated to message_post, stored on
mail.message and used to encapsulate emails sent based on posted messages.

SPECIFICATIONS

Get rid of context usage (``custom_layout``) and use a real field on composer
model: ``email_layout_xmlid``. Use now a default value coming from context
(default_email_layout_xmlid) instead of custom_layout.

Support old context key in composer for backward compatibility, working like
a default value for the field itself.

Task-2621326 (Mail: add 'view' button in 'light notification template')
Task-2647302 (Mail: add layout field in composer)
UPG odoo/upgrade#2829

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Thibault Delavallée 88d66434a8 [REM] mail: remove unused notification template
RIP ``mail_notification_borders``. You were a joyful comrade.

Task-2621326 (Mail: add 'view' button in 'light notification template')
Related to odoo/upgrade#2829

Part-of: odoo/odoo#76418
2021-11-10 09:58:09 +00:00
Thibault Delavallée a480f1f3cd [MOV] mail: split templates to better isolate notification layouts
Just separating notification layouts from templates used for various discuss
or chatter related notifications. Purpose is to have shorter but cleaner
files.

Task-2621326 (Mail: add 'view' button in 'light notification template')

Part-of: odoo/odoo#76418
2021-11-10 09:58:08 +00:00
Martin Trigaux 91d5aef00c [FIX] project: translate panel data
Give the language in the context

closes odoo/odoo#79594

X-original-commit: 9939a0cbfae814f6b4d66c0ca45e0a84d3f57836
Related: odoo/enterprise#22205
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-10 07:45:53 +00:00
Martin Trigaux c7942f19f2 [FIX] web_editor: translate init message
X-original-commit: 4e466182e89e835dd04809d53ef58ddbf4020d05
Part-of: odoo/odoo#79594
2021-11-10 07:45:53 +00:00
Martin Trigaux 3887448aae [FIX] hr_holidays: translate the display_name of allocation
X-original-commit: 7e6f78896a0104087fa97f3ad8a0a46b92c91a0f
Part-of: odoo/odoo#79594
2021-11-10 07:45:53 +00:00
Martin Trigaux bf0a7dcb40 [I18N] website_sale: mark as web translation
Once again, beaten by the unique term constraint and in conflict with
the same term in `web` module

X-original-commit: 21224e3a6d99d6b7e14529e67feabaac6df9d910
Part-of: odoo/odoo#79594
2021-11-10 07:45:52 +00:00
Pablo Paez fc188f8aa2 [FIX]account,account_debit_note: not show only purchaseable product
Only purchaseable products are not searchable in the lines of debit notes
and credit notes if this account moves are created from their tree view with
the CREATE button. This changes make that this behavieour were also if we
create this account moves from the buttons in the invoices "ADD CREDIT NOTE"
and "ADD DEBIT NOTE".

closes odoo/odoo#78266

Task: https://www.odoo.com/my/task/2543493
X-original-commit: 461801335b1bce1390f0e482648eb5eac7c7e3a8
Signed-off-by: Florian Gilbert <flg@odoo.com>
2021-11-10 06:49:58 +00:00
Tiffany Chang (tic) 7c43290ff4 [FIX] stock: safely reference move source in reception report labels
Commit d6abfbade9fb7f6dd6b3253551c559b1c7e6ece5 made it so we directly
reference a move's source origin via _get_source_document(). Normally
this is fine when the labels are created because labels would never be
created for a move without a source document, but this isn't safe when
the label is accessed via another way (e.g. test_reports). Therefore,
let's add in a check to prevent a error from trying to access
False.name.

closes odoo/odoo#79585

X-original-commit: 8abba9c3c0c48241e017e87045f392dc403a28e9
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-11-09 17:57:40 +00:00
Pierrot (prro) 709f43f153 [FIX] sale: update downpayment SOL after refund
How to reproduce the problem:
- Install the Sales and Invoicing apps
- Create a simple SO with a product
- Create Invoice -> Down Payment (percentage) 30% -> confirm
- On the SO -> Create Invoice -> with Deduct down Payment -> confirm
- On that invoice -> Add Credit Note -> Reverse -> confirm
On the SO, the Down payment is not counted as invoiced, even tough it
was already paid and not refunded. If the user wants to create a new
invoice, the system will create one with the full price (not taking the
already invoiced Down Payment into account).

Cause of the problem : when computing the quantity to invoice for
the SO, a condition was avoiding preventing the down payment invoice
line to be taken into account in a way that it was just ignored.
I don't really understand the reason for this condition, as
it specifically ignores the down payments, while it should not be
ignored.
When creating the draft for the refund invoice, the down payment's SOL
is correctly updated as `line.untaxed_amount_to_invoice == 0` is true.
But when confirming the invoice, the values changed and the condition
is thus not met anymore.

opw-2491225

closes odoo/odoo#79572

X-original-commit: 99e8d4ad33bcdb27f7632a9ba5a5a2886d074ed5
Signed-off-by: Roose Pierre-Rodéric ( prro) <prro@odoo.com>
2021-11-09 16:25:18 +00:00
Thomas Josse cbec2409a2 [ADD] website_sale_slides: add default course product
Purpose
=======
This commit adds a default product called "Access Course" to the
database when you have the `website_sale_slides` installed.

This commit also starts the transition for courses products
into `event ticket`-like products

Specifications
==============
This product is already created in order to help the users start to sell
their courses.

We also added a new type of product named `Courses`.
This will be used to create courses and easily work with courses products.

The commit adds the list of all the courses that the will gain access to
when he will buy the product inside of the cart and in the right column
whe it appears.

It also adds the same list when the product is inserted into a sales order.

The commit adds the choice of enroll policies in the front-end when
`website_sales_slides` is installed and of the corresponding product
if we are creating a paid course.

Task-2636092

closes odoo/odoo#77990

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-09 15:35:15 +00:00
Simon Genin (ges) a79ab876af [FIX] web: report client action can keep context on reload.
Report client action can need context data to be properly be
displayed. But because all the required data is not put in the url,
reloading didn't work.
However, there is the current action data kept in the session storage
which is a solution to avoid the described problem. But it didn't
work because of the implementation of the report client action execution.
It was in reality executing two actions: one for the report, gathering
the data and fallbacking to a client action. By doing this, the
session storage would not have the necessary data kept for reloading the
page.

The fix is simply to duplicate the code of the client action execution
instead of calling doAction again.

closes odoo/odoo#79567

X-original-commit: 3fc095c57888e5f69729e1a5a6edea97c4c098b6
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-11-09 14:46:33 +00:00
Touati Djamel (otd) f5d5632b63 [FIX] sale_mrp: avoid creating useless picking
Steps to reproduce the bug:
- Install sale_management and sale_mrp
- Create a product with BOM, which is a KIT and add any product in BOM line
- Create a SO for the product > Confirm
- Validate the delivery
- Cancel the SO >  Set to Quotation > Reconfirm

Problem:
A new delivery order is generated while the ordered quantity = delivered quantity
This is because `_get_qty_procurement` wrongly computed the product quantity based on the moves quantities in the kit case.

opw-2647856

closes odoo/odoo#79560

X-original-commit: 1f6f7dc82cede9a9038178d70fc7c53f685c5748
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2021-11-09 14:46:29 +00:00
Florian Damhaut 73590380ca [FIX] delivery : translate 'Free Shipping'
Problem : Free Shipping is not translated in delivery
New Behaviour : Free shipping will now be translated

opw-2679727

closes odoo/odoo#79557

X-original-commit: 511bede06788ffb94308dc36d33abadc466a3168
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2021-11-09 14:46:25 +00:00
Xavier-Do 9b1957fd81 [FIX] core: revert check on new models before setup
This reverts commit 9cc4d6956b71291958114196107b1889109e92a1.

How to reproduce the issue:
- Starts from a database with some modules installed (account).
- Install a module with data only (l10n_generic_coa)

The models are not setup and the data fails to install.

A proper fix would be to mark the registry as dirty when new models are
added and only setup models when needed.

Since the faulty commit was part of a bunch of optimization and the
impact of this particular one is quite small, reverting it is a quick
and easy fix waiting for a better one (maybe, one day).

closes odoo/odoo#79552

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-11-09 14:46:21 +00:00
Wolfgang Taferner 2c1617d22b [IMP] l10n_at: replace with specific formula to not confuse users
As it was confusing to have some autogenerated sum on the parent model
we show the proper tax value of the report

+ add missing report line to related taxes

closes odoo/odoo#79534

X-original-commit: 163e4c069a15c75d75df980c558a03cc89fd254c
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-11-09 14:46:17 +00:00
clesgow aefd5f7d64 [FIX] purchase: Don't plan PO line at the middle of the day
No longer converts the date_planned of a purchase_order_line to the
middle of the day. In case of multi-steps receipts, this caused a
discrepancy between the actual receipt and the later internal transfers.

Let's say a reordering rule is triggered :
- The date is set to midnight for the procurement, so the internal
transfer's date is set to midnight as well.
- The date is increased to noon for the PO line, which define the PO
planned_date, which define the linked receipt picking.
- So in the end :
  - Receipt is planned to day X at noon.
  - Transfer from Input -> Stock is planned to day X at midnight.

Task-2656397

closes odoo/odoo#79523

Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-11-09 14:46:14 +00:00