Commit Graph
146412 Commits
Author SHA1 Message Date
Thibault Libioulle f2b13dd0ec [FIX] website{,_sale}: fix search product with several categories
This commit fixes an issue when there are several public categories on
a single product. Categories are shown side-by-side under product name
in the search bar.
This commit also fixes the issue where the `Category:X` text is matched
and highlighted whereas the search text is not used to match the product
categories.

Steps to reproduce :
    - Install eCommerce
    - Add several eCommerce Categories to a product
    - Go to shop
    - Search for the product in the searchbar
    - Traceback

Current Behavior :
    - Traceback when generating the results in the quick search bar.
      It's not expected to have several categories in the current
      implementation.
    - If all products have a unique category, then the text in
`Category:X` is matched and highlighted.

Desired Behavior :
    - No traceback
    - When there are multiple categories, an extra link should be
      present on each category rather than a unique link on all
      categories.
    - The product categories don't have to be matched.

Related PR: #79258
task-2680726

closes odoo/odoo#79363

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-11-15 12:53:20 +00:00
Pierre Paridans bed30d93cc [FIX] web: remove unused class o_py
closes odoo/odoo#79751

Related: odoo/enterprise#22244
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-11-15 12:07:21 +00:00
Aktiv Software 7bfb643229 [FW][FIX] product: properly trigger computation of computed fields
The two fields (name & price) were only updated on pricelist (`product.pricelist`) save, not when the rules were updated (`product.pricelist.item`).

The reason was that name and price are compute fields, which were added to the tree view but not added to the form view.

This commit adds "name" and "price" to the `product.pricelist.item` form view and hence the values will be updated as soon as the popup form is saved.

Fixes: #78488

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#79748

Forward-port-of: odoo/odoo#78699
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-11-15 11:02:49 +00:00
Touati Djamel (otd) 8c77e1cfdb [FIX] {pos,sale}_gift_card: compute the gift card balance correctly
Steps to reproduce the bug:
- Install POS
- Go to the POS settings and enable “Gift Card” option
- Create a new Gift card with initial amount of $50
- Open a new POS session > create an order of $50 and apply the gift card
- Confirm the order > the order state becomes “paid” and the gift card balance is computed correctly: $0

Problem:
Close the POS session, the order state becomes “done” and the balance is computed wrongly: $50

opw-2683523

closes odoo/odoo#79741

X-original-commit: 10f22a125a96d60fc5983531f6026ba325d08959
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2021-11-15 11:22:40 +00:00
Nicolas Bayet 6f972d9f9c [FIX] web_editor: undo after dropping a snippet
The commit 1b80fe9b56acea09a6784691561df65fe6349f50 made impossible
to undo after dropping a snippet.

Task-2688104

closes odoo/odoo#79649

X-original-commit: 92b1f78e8de6c343a9d1ef19459522b868cf108f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 11:22:34 +00:00
Nicolas Bayet 8087bd00e8 [FIX] web_editor: allow to move snippets
As an oversight of 2185e89e3f2a15b98b9cb8c3371a6031f9a6f055, it became
impossible to move snippets.

Task-2688281

closes odoo/odoo#79648

X-original-commit: f76ba944c516a0377cec324f564df604e52c2ffd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 11:22:30 +00:00
Nicolas Bayet b6ea6d14d2 [FIX] web_editor: enable selection under toolbar triangle
In the editor, there was a little spot where it was impossible to
click in order to select a text.

Task-2684378

closes odoo/odoo#79642

X-original-commit: 02c0cce926b1252596f10299597a9c984a8341ac
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 11:22:26 +00:00
Nicolas Bayet 34d0f92a78 [FIX] web_editor: wait untill colorpicker is inserted
Before this commit, an update to the colorpicker could be called
multiples times with a `colorpicker` not yet in the document.

If a colorbpicker has been created, we need to await it's start method
to be fully resolved.

Task-2667983

closes odoo/odoo#79641

X-original-commit: 105208c8363f77130ee644ce8ec2e993d9955763
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 11:22:22 +00:00
Nicolas Bayet 7146a6fbf4 [FIX] web_editor: have correct linkPopover reference
Before this commit, the reference of the linkPopover was
the last popover being created which is not what this property
is supposed to correspond to. It should correspond to the latest
opened linkPopover.

Without this fix, the code that want to act on the last linkPopover
would not work as expected (e.g. `this.linkPopover.hide();` in
`_onSelectionChange`).

Task-2667983

X-original-commit: d1abbc9d66a5858c771fa643f8c73990e8f14792
Part-of: odoo/odoo#79641
2021-11-15 11:22:21 +00:00
Nicolas Bayet f726f40d25 [FIX] web_editor: prevent link o_default_snippet_text
Whenever a link is being manipulated through the link tool,
the classes are being saved before the manipulation. However,
the class `o_default_snippet_text` is removed in the meantime.

Because we never want that class after the manipulation, this commit
systematically remove it.

Task-2667983

X-original-commit: f82f004e1e1439c38a09d5eb0fded5197e058c1b
Part-of: odoo/odoo#79641
2021-11-15 11:22:21 +00:00
Nicolas Bayet 93537cf82a [FIX] web_editor: allow to select a link already selected
Before this commit, selecting a link was not working all the time.
This commit allow to properly select a link all the time.

Task-2667983

X-original-commit: 8c90772470046d0b932443ac7b2c2a868c443a85
Part-of: odoo/odoo#79641
2021-11-15 11:22:21 +00:00
Amin Cheloh 02957fd919 [IMP] web: extract FieldBinaryImage img click handler
allow override handler in extended widget.

closes odoo/odoo#71773

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-11-15 09:47:56 +00:00
Sébastien Geelen (sge) cb1fcb598f [FIX] web_editor: fix ResizeObserver error in FF
The error "ResizeObserver loop limit exceeded" was catch by the browser error
global listener. this error was wrongly flagged as a CORS error.
This error is well known to be useless and can safely be ignored.

We do so.

Task-2670745

closes odoo/odoo#79645

X-original-commit: 1c21e2d6fa3c25d2a920902ebecd19f6229b56d8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 09:04:32 +00:00
Raphael Collet 8b6232ed25 [FIX] tests: allow OdooSuite to handle unittest.TestCase without crashing
closes odoo/odoo#79713

X-original-commit: 6ae762f1e4a7f3eb5320d28428310905961dfad3
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-11-15 08:18:26 +00:00
qsm-odoo 1ebc7c301b [FIX] web_editor, website: fix onFocus/onBlur flow + add test
The flow has been broken multiple times across the years. Let's add a
test in all stable versions.

For the 14.0 forward-port, the test came with a fix which restores the
13.0 flow which we tried to change in 14.0... but only ended up broking
it. Indeed, with [1], the 13.0 was fixed. And, with [2], we tried to
simplify the flow... but the explanation given by the commit is just
wrong: the flow was just broken and the simplification that was to be
done in fact practically never occurs. The more the reason to add a
test, proving how the flow is working. The simplification may be done
someday but not sure it is really worth it.

For the 15.0 forward-port, another fix was needed because of [3] which
introduced a bug which makes the onBlur method be called multiple times
when hiding a whole editor hierarchy.

[1]: https://github.com/odoo/odoo/commit/076992bdf099f3a645c9a1ef6df2cdcccbf1c2b2
[2]: https://github.com/odoo/odoo/commit/5c007305c9998ade32c6677cac5552101c3a96af
[3]: https://github.com/odoo/odoo/commit/806a8db35b5e0e6a461422f5bba7c97180c3ef29

closes odoo/odoo#79734

X-original-commit: 0acc5e784b15d9c963660da3781763448503f33e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-11-14 21:40:48 +00:00
bbh-odoo 113038e1b1 [IMP] hr_timesheet: improve demo data
Currently 'Timesheet cost' is not set in demo data.
This commit sets the 'Timesheet cost' on each employee of the demo data.

task-2531416

closes odoo/odoo#76151

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-13 09:42:27 +00:00
Aktiv Software 8143a641a2 [FIX] base: remove duplicated mandatory field name
When trying to save a new res.partner without name, an error appeared saying
Invalid fields:
- Name
- Name

Add condition to the domain to make it required only when displayed

Fixes #77976

closes odoo/odoo#79727

X-original-commit: f65e3d9d21d269058dd842a4319b5b2242df103e
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-13 07:15:46 +00:00
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