Commit Graph
144852 Commits
Author SHA1 Message Date
Patrick Hoste a4244e0dfd [ADD] website_event_booth_exhibitor: allow sponsor creation with booths reservation
PURPOSE

This module integrates the Exhibitor module which allows the event manager
to automatically create a sponsor after a booth registration.
To enable that feature an option has to be set on the booth category.
The event manager can also choose what kind of sponsor will be created at the registration.
The frontend flow changes a bit to allow the user to provide his sponsor informations.

LINKS

Task-2318655
Closes : odoo/odoo#71104
2021-09-02 14:14:34 +00:00
Patrick Hoste 37c0c37bb1 [ADD] website_event_booth_sale: add e-commerce capabilities to frontend booths reservation
PURPOSE

This module integrates the e-commerce module which allows the
event manager to sell booths online.
The flow is the same as before but after the booths selection
they will be added to the user cart and he will be redirected
to the e-commerce flow.

LINKS

Task-2318655
Closes : odoo/odoo#71104
2021-09-02 14:14:33 +00:00
Patrick Hoste 60092b78e0 [ADD] website_event_booth: add frontend page for booths reservation
PURPOSE

This module enables the Booths registration on the frontend by adding
a dedicated page on the related event.
The user will have to first select a booth category and then select one
or more booths to book. He will then be asked to provide his contact informations.
The booths will directly be set to unavailable... First come, first served.

LINKS

Task-2318655
Closes : odoo/odoo#71104
2021-09-02 14:14:33 +00:00
Patrick Hoste b3c1141f8b [ADD] event_booth_sale: add sale capabilities to event_booth
PURPOSE

This module allows to sell booths to partners by setting a product and a price
to the booths categories. When selling booths on a sale order it will open the
product configurator and ask the event, booth category and booths.
It's only possible to select booths belonging to the same category for one sale order line.

A new model is introduced by this module :

- Booth Registration that allows multiple registrations to a booth.
  The booth will be set unavailable when the sale order linked to the registration is paid.
  All the others registrations will be cancelled

LINKS

Task-2318655
Closes : odoo/odoo#71104
2021-09-02 14:14:33 +00:00
Patrick Hoste 3c5c3c257e [ADD] event_booth: add booths management for events
PURPOSE

This new module adds a booths management capabilities to the event module.
The event manager will be able to manage booking to physical booths hosted
at his event by first creating several booths categories depending for example
on the booths size, the number of tables, extra services, ...
He will then create the actual booths to offer to the final users.

This module adds two main models :
- Event Booth Category which is used to differenciate the booths type.
- Event Booth which is the actual Booth that will be booked.

The booking is done directly on the booth form view by setting a partner and
his contact informations and by setting the booth state to unavailable.
If the event manager want to book a booth for later use he can set the state
to unavailable without setting a partner.

The booking of a booth will be displayed in the chatter of the related event
to ease the event manager overview

The user manager can use event template to adds booths by default when setting
the template to an event.

LINKS

Task-2318655
Closes : odoo/odoo#71104
2021-09-02 14:14:32 +00:00
Patrick Hoste ac8fd6c1c5 [IMP] event: add is_finished field in event model
PURPOSE

The is_finished computed field was added in order to avoid
displaying the booths on the registration page and warn the
user with a message.

LINKS

Task-2318655
Closes : odoo/odoo#71104
2021-09-02 14:14:32 +00:00
Patrick Hoste 73078e9cfc [IMP] event: add setting option for event_booth module installation
PURPOSE

Adds the possibility to install the new module 'event_booth'
through the event settings.

LINKS

Task-2318655
Closes : odoo/odoo#71104
2021-09-02 14:14:31 +00:00
Patrick Hoste 0eaecf062c [IMP] website_*_sale: add kwargs parameter to _website_product_id_change() method
PURPOSE

Before this commit we had to pass parameters through the context to get
them to the _website_product_id_change() method.
After this commit we can pass the parameters through the kwargs parameter.

LINKS

Task-2318655
Closes : odoo/odoo#71104
2021-09-02 14:14:31 +00:00
William Henrotin eb0ebc077a [FIX] stock_picking_batch: remove empty pickings
If a picking is totally empty (no move line with quantity recorded) in a
batch at validation. This one will be ignored by the immediate transfer
mechanism as well as the backorder creation. It is simply remove from
the batch.

closes odoo/odoo#63291

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-09-02 14:14:10 +00:00
William Henrotin 8d3805eccb [IMP] stock_picking_batch: add quick access to batch
This commit adds a quick access to all the batches and waves of a picking
type (only transfers picking type) ready to be processed from the
Inventory dashboard.

Task : 2411102

Part-of: odoo/odoo#63291
2021-09-02 14:14:10 +00:00
William Henrotin dd53f5323f [IMP] stock: wave pickings
This commit introduce Wave Pickings. This new object is a group of stock
move lines related to different pickings. The goal is to group stock
movements having similar characteristics like same source location, same
product category, ...

Wave pickings are created from stock move lines. Those are removed from
their picking to a copy of it. All the new picking are grouped together
in a new batch picking. This batch is the wave.
To differentiate the batch pickings and the wave pickings. This commit
introduces a new menu and a new sequence.

Task : 2411102

Part-of: odoo/odoo#63291
2021-09-02 14:14:09 +00:00
William Henrotin bf9944c100 [IMP] stock,delivery: quick access to operations
This commit add a quick access to all the move lines of a picking
type (only transfers picking type) ready to be processed from the
Inventory dashboard

Task : 2411102

Part-of: odoo/odoo#63291
2021-09-02 14:14:09 +00:00
Jacky (trj) dc7050ccef [FIX] point_of_sale: html2canvas letterRendering is configurable
The `letterRendering` option from the html2canvas broke the receipt's characters of some localizations/languages such as the arabic one.

With this commit, we can simply override the `htmlToImgLetterRendering()` method from the `PosModel` when needed.

closes odoo/odoo#75870

X-original-commit: 8b2c9bd026c0b7296c7be819a992ccac24b9b2e3
Related: odoo/enterprise#20559
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-09-02 12:57:51 +00:00
Andrea Grazioso (agr-odoo) 334fb8533f [FIX] delivery,sale_mrp,stock: correct delivery slip kit cost valuation
- Create a product with a kit BOM and weight
- kit components should have list price and weight as well
- Create SO with kit product
- Add shipping (fedex int. or bpost will do)
- Delivery product

A custom's form is generated but the value of the product it is not
correct as it take the valuation of the kit in the sale order
for every component of the kit, resulting in higher customs taxes for
the final customer

opw-2628309

closes odoo/odoo#75658

X-original-commit: e13f048a78b41d81602e868a3b0c7ded24ce992b
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-09-02 12:57:47 +00:00
William Henrotin f5a08bb1dc [FIX] stock: remove unused view
The quants are only displayed on list view

Task : 2555118

closes odoo/odoo#74715

Related: odoo/upgrade#2711
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-09-02 12:57:33 +00:00
William Henrotin 179bd67970 [IMP] stock,mrp_subcontracting: rearange quants filters
Task : 2555118

Part-of: odoo/odoo#74715
2021-09-02 12:57:33 +00:00
William Henrotin 749225db2a [FIX] stock: quants view adjustments
Task : 2555118

Part-of: odoo/odoo#74715
2021-09-02 12:57:33 +00:00
William Henrotin 79ba0cd05b [IMP] stock: default action on count request
When requesting an inventory count, the manager can decide to, in the
same time, precounting the quant to their actual values.

Task : 2555118

Part-of: odoo/odoo#74715
2021-09-02 12:57:32 +00:00
William Henrotin 8f12dbc00f [IMP] stock: merge two wizards into one
This commit merge the wizards asking for a inventory name and the one
warning the user not all quant have been set.

Task : 2555118

Part-of: odoo/odoo#74715
2021-09-02 12:57:32 +00:00
William Henrotin 79ee1ae3d2 [FIX] stock: use the same editable view for inventories and products
This commit makes sure the same view is used between the "inventory
adjustments" menu and the " update quantity" button in the product form.
The two views should always keep the same fields and buttons.

Task : 2555118

Part-of: odoo/odoo#74715
2021-09-02 12:57:32 +00:00
William Henrotin 72f5b23063 [IMP] stock: change empty screen message
task : 2555118

Part-of: odoo/odoo#74715
2021-09-02 12:57:31 +00:00
William Henrotin 04beff906d [IMP] stock: allow importing quants
As the inventory adjustments have been removed in favour of the editable
quants, this commit introduced the possibility to import pre counted
quants like non validated inventories back then.

task : 2555118

Part-of: odoo/odoo#74715
2021-09-02 12:57:31 +00:00
John (jol) 0624e3f728 [IMP] base: remove setting 'Show Full Accounting Features'
The goal is to remove confusion between Invoicing and Accounting.

The current setting "Show Full Accounting Features" is confusing
and leads users to believe they have a full accounting package
in community, which is not true.

closes odoo/odoo#73977

Task: 2578997
Signed-off-by: William André (wan) <wan@odoo.com>
2021-09-02 12:57:17 +00:00
Nikunj LadavaandMohammed Shekha 662ecf4e20 [IMP] base_import: improve import wizard preview
PURPOSE

Improve import wizard as followup of recent improvements.

SPECIFICATIONS

Preview lines

  - make the preview lines more visible
    - set font-weight: 500 on o_import_header_name
    - remove the text-muted class from the data preview line

  - allow the user to preview the first 5 non-empty values
    - when hovering on the data preview span, display a tooltip with the first
    5 non-empty values of the file column (with 'Preview' as the tooltip title)

  - In the 'when a value cannot be matched' dropdown:
    add a new 'skip record' option for the following field types: boolean,
    many2one, many2many, selection
    add a new 'set empty' for the following field types: many2one, many2many,
    selection hide this option if the field is required

When a value cannot be matched:
  the 'skip record' option will make sure that lines with an unmatched value
  will not be imported (i.e. skipped at import)
  the 'set empty' option will set the field value to False when the value
  cannot be matched

  - Restore colored background on alert boxes by removing some css rules

Task-2504343

closes odoo/odoo#73713

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2021-09-02 12:57:13 +00:00
Tom De CaluwandJeremy Kersten adc85ad610 [IMP] product, website_sale: separate attributes from variants
Several changes distinguish product attributes better from variant
attributes. The variant creation mode is added on the template form for
attribute lines with more than one value. Specification attributes are
no longer listed as variant attributes in the product variant form and
tree views.

task-2466988

closes odoo/odoo#72559

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Co-authored-by: Tom De Caluw <tdc@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2021-09-02 12:57:09 +00:00
Ivan Yelizariev f9f5f889e4 [FIX] fields: allow to define several m2m with same relation but domain
Partial of #67648

Part-of: odoo/odoo#72559
2021-09-02 12:57:08 +00:00
254d6a71e8 [IMP] hr_holidays: Improve Accruals, dashboards and general UX (Back2basics)
Purpose
=======

Time Off : New Dashboard, Accruals feature, Public holidays, New time off type configuration view.

- Review of Dashboard
- Accrual feature : Currently, when you create an allocation, it's possible to create an
  Accrual, but there is no appraisal Plan. An Appraisal plan is use to define steps of accruals
  for each employee.
  In Belgium, we use accrual Allocation for European Leaves, or compensatory hours, it's a
  simple use case.  But in USA, it's possible to change the calculation mode each year.
  Also, in USA, it's possible to deal your accrual plan when you arrive on the company. It's a
  HR Officer task to create the right Accrual allocation for each new employee.
- Public Holidays :
  Improvement of global time off feature located on Working hours calendar. Now, Time off
  application have to manage Public Holidays.
- Review of Time Off type configuration

COM PR: https://github.com/odoo/odoo/pull/72511
ENT PR: https://github.com/odoo/enterprise/pull/19157
UPG PR: https://github.com/odoo/upgrade/pull/2791
TaskID:2475413

closes odoo/odoo#72511

Related: odoo/enterprise#19157
Related: odoo/upgrade#2791
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: William Braeckman <wbr@odoo.com>
Co-authored-by: Xavier BOL (xbo) <xbo@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2021-09-02 12:57:03 +00:00
Vishal Thacker 0e04aeab94 [FIX] l10n_in_pos: Fixed the xpath in pos_receipt template
Before this commit:
===============
when we have installed module l10n_in_pos at the time of printing receipt it give error

After this commit:
=============
print POS receipt successfully.

Issue and Fix:
===========
it was showing an error because of changes made in commit: 8610a4bf38
fixed the issue by inherit the OrderLinesReceipt template and adding the correct xpath in pos_receipt template

closes odoo/odoo#75628

Task-id: 2623512
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-09-02 11:47:49 +00:00
Jeremy Kersten 13c0fab15b [REF] website_sale: split product/template model in 2 files
closes odoo/odoo#72242

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-09-02 10:41:51 +00:00
Kamen ZhekovandJeremy Kersten 8fc2e229f9 [IMP] website_sale: add price per unit on products
Description of the issue/feature this PR addresses:
Currently, we cannot display prices per unit (for example $/kg, etc.)
on products shown in the shop. This is important for any eCommerce
business that sells something other than units, or just for informational
purposes.

Desired behavior after PR is merged:
Allows the user to add unit measurements for products. This behaviour is
disabled by default, and can be enabled through the settings page by
activating "eCommerce Base Unit Price" option.

Enabling it displays a price per unit field in /shop's product page,
comparison tool and cart. The price per unit of measurement is
automatically computed and can be displayed both on the product,
the cart and the comparison pages.

Enabling it also modifies the product's configuration page to include
what unit of measure to display in the price per unit field, as well
as the number of units used to calculate the price per unit.

task-2558128

Part-of: odoo/odoo#72242
Co-authored-by: Kamen Zhekov <kzh@odoo.com>
Co-authored-by: Jeremy Kersten <jke@odoo.com>
2021-09-02 10:41:51 +00:00
JF Aubert e0f0b86a9b [FIX] stock: Fix forecast availability with UoM
virtual_available return the quantity in product base UoM while
move product_uom_qty is the quantity with the UoM of the move

For the forecast compare the quantity with the same UoM

closes odoo/odoo#71732

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-09-02 10:41:46 +00:00
JF Aubert 972ce4e445 [FIX] purchase: fix typo for dest_address_id label
Task: 2444742
Part-of: odoo/odoo#71732
2021-09-02 10:41:46 +00:00
Arnold Moyaux 174c3b7951 [IMP] mrp: Mass assignation of SN/Lot in MRP
Allow to produce several serial numbers at once.
Only when BoM do not contain any component tracked by unique serial number
and lot ones are from 1 lot.
Also allow to copy/paste serial numbers.
This applies to manufacturing orders.

Task: 2444742
Part-of: odoo/odoo#71732
2021-09-02 10:41:46 +00:00
JF Aubert 35fb293c05 [IMP] mrp: Set subcontractor address on PO
If all the product in a PO are for a subcontracting purpose,
set the PO delivery address to the subcontractor address.

Task: 2444742
Part-of: odoo/odoo#71732
2021-09-02 10:41:46 +00:00
JF Aubert 40eb8e158c [IMP] mrp_subcontracting_dropshipping: Add new route
Added 'Dropship Subcontractor on Order' route to simplify user interaction
and stay tuned with 'Resupply Subcontractor on Order'.

Task: 2444742
Part-of: odoo/odoo#71732
2021-09-02 10:41:45 +00:00
Pierre Paridans 5d41c38673 [FIX] web: prevent mobile keyboard popping up on tablet
Before this commit, when loading a view containing a searchbar on a
tablet, the device's keyboard is appearing once the searchbar's field is
autofocused.

Thanks to the backport of the mobile OS detection (see PR
odoo/odoo#75455 ), we are now able to properly target mobile OS
(independent of the screen's resolution) instead of only small screens.

closes odoo/odoo#75880

X-original-commit: b1a7296f060811153039ef73140e78ea702088a1
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2021-09-02 08:39:26 +00:00
Lucas Perais (lpe) 20ee752c61 [FIX] web: widget pie_chart supports timeRanges
During the refactor of the comparison feature, the pie_chart widget was forgotten
(commit: be5a51a345)
Before this commit, the pie_chart widget did not support timeRanges any longer

After this commit it does again.

closes odoo/odoo#75878

X-original-commit: 4f64cd724ad2a58a35dadf382b10dab74e1c0559
Related: odoo/enterprise#20564
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-09-02 08:39:18 +00:00
Katherine Zaoral d1ca1040b7 [IMP] l10n_ar: Argentina Localization config
Add Argentina Localization section in config to be extend for both
l10n_ar_report and l10n_ar_edi modules.

closes odoo/odoo#75632

Related: odoo/enterprise#20457
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-09-02 08:39:08 +00:00
Achraf (abz) d2df27288c [FIX] website_sale_slides: force sudo addition of course members at SO confirmation
When a sale.order containing a slide.channel registration product is confirmed
by a person that does not have rights on slide.channel (typically a salesman),
the system will throw an error.

This commit forces the addition of members by using a sudo on the
"_action_add_members" method.

We assume that when confirming a sale.order, we want to add the members and
enable their access to the course even if the person confirming the sale.order
does not have e-learning privileges.

OPW-2580128

closes odoo/odoo#75879

X-original-commit: ecac935d3c0b5478d4e3eb8e0df9e01fce034a86
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2021-09-02 07:32:32 +00:00
Odoo's Mergebot 7568854f39 [MERGE] website_event_*: improve Online Events feeling and organization
PURPOSE

Improve Online Events feeling, user experience and management for
event users.

SPECIFICATIONS

Allow multiple tries & improve layouts of track quizzed. Purpose is to add
feedback and allow to repeat quizzes, making them more fun to use.

Add a popover on the exhibitor cards giving their information. Purpose
is to improve they way exhibitors are displayed and ease their dicovery.

Improve track management through stage legend, like what is done in
project for example. Add customizable legends on stage kanban state,
track it on tracks records.

Update the track stage visibility logic. Rules are now

  * a published track is always displayed in agenda, tracks list and page
    view, whatever its state;
  * a track in a 'is_visible_in_agenda' stage (replacing 'is_accepted') is
    always displayed in agenda and tracks list. Its page view access is based
    on ACLs: aka: published = everyone, unpublished = for event users only;
  * a track in a 'is_fully_accessible' stage (replacing 'is_done') is
    automatically published when entering this stage, allowing its full
    display

Page view still relies on ACLs, and therefore on published flag automatically
set when entering "fully accessible" stage.

See sub commits for more details and explanations.

Task-2504216

closes odoo/odoo#69585

Related: odoo/upgrade#2408
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-02 09:32:26 +02:00
Julien Banken d369726f6a [IMP] website_event_track: update the track stage visibility logic
In the track stage model, the fields 'is_accepted' and 'is_done' of the
track stage model are not self-explanatory enough. The user may not know
that those fields will have an impact on the visibility and the accessibility
of the tracks in the frontend. We will then rename those fields and update
their use to make it clearer.

Rules are now

  * a published track is always displayed in agenda, tracks list and page
    view, whatever its state;
  * a track in a 'is_visible_in_agenda' stage (replacing 'is_accepted') is
    always displayed in agenda and tracks list. Its page view access is based
    on ACLs: aka: published = everyone, unpublished = for event users only;
  * a track in a 'is_fully_accessible' stage (replacing 'is_done') is
    automatically published when entering this stage, allowing its full
    display

This means that

  * tracks may be displayed in agenda and tracks list to public without giving
    access to their page;
  * easy way to publish tracks at once is achieved by moving them in batch in
    a fully accessible stage;
  * early-disclosure of tracks is achieved by publishing them manually whatever
    the stage;
  * easy removal of track page view is achieved by unpublishing them manually
    whatever the stage;

Page view still relies on ACLs, and therefore on published flag automatically
set when entering "fully accessible" stage.

task-2504216

COM PR: odoo/odoo#69585
UPG PR: odoo/upgrade#2408
2021-09-02 07:32:25 +00:00
Julien Banken a4bd3e0db1 [IMP] website_event_track: improve track management through stage legend
In order to make the kanban view more customizable, we will allow the
administrators to give a custom legend on the event track stages. With
the custom legends, the employees should be able to find their way more
easily especially if the company uses its own internal processes.

The custom description of the track stage will appear in a tooltip when
the user hovers the corresponding kanban column and does not move for a
few seconds. It can help people understand the role of each track stage.

In order to ease track management, tags are now searchable directly from
track view.

task-2504216

COM PR: odoo/odoo#69585
UPG PR: odoo/upgrade#2408
2021-09-02 07:32:25 +00:00
Julien Banken c1b7944a67 [IMP] website_event_exhibitor: add a popover on the exhibitor cards
On the website, the exhibitor cards only shows a logo. If the visitors
clicks on a logo, the visitors will be redirected to the website of the
corresponding exhibitor. If no website has been set and the logo of the
exhibitor is rather abstract, the visitors may not be able to recognize
and identify the exhibitor.

To provide more information about the exhibitor, we will add a small
popover that will be opened when the visitor clicks on the logo. The
popover will contain the following information:

- The name of the exhibitor
- The website of the exhibitor

Other information are considered as private and can be added through
customization if this fits specific use cases.

task-2504216

COM PR: odoo/odoo#69585
UPG PR: odoo/upgrade#2408
2021-09-02 07:32:24 +00:00
Julien Banken 4fb38e2876 [IMP] website_event_track[_live]_quiz: allow multiple tries & improve layouts
When the user submits a quiz, the user will not get much feedback. To
improve the user experience, we will now indicate how many points the
users earned per question. With that information, the users could detect
errors and report them to the administrators. We will also add some
minor layout improvements to make things clearer.

When the administrator creates a quiz, the administrator might not want
to set a limit on the number of attempts that a user can have on a quiz.
To allow that, we added an option in the quiz settings called 'Unlimited
Tries'. When the administrator checks that option, a button will appear
below the quiz and will let the users reset the quiz at will.

Sometimes, the administrator might also want to (1) give points for an
answer that is not wrong or (2) give no point for a correct answer. This
is not currently possible as we considered that the correct answer is the
answer that rewards points. To allow that, we will add a new boolean
field on each answer to mark the correct answer.

task-2504216

COM PR: odoo/odoo#69585
UPG PR: odoo/upgrade#2408
2021-09-02 07:32:24 +00:00
Brieuc-brd e7d779add6 [FIX] website: fix alignment for narrow size of mega menu
This fixes a bug about alignment, which shifted the mega menu with the
narrow size by 50%. This bug was triggered in multiple headers:
- sidebar
- hamburger
- magazine

task-2502208

closes odoo/odoo#75877

X-original-commit: 1f54c7f5cb458b437a54ea0cde9c0df388c1f47d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-02 05:46:00 +00:00
Sébastien Mottet (oms)andqsm-odoo 97b103dcd2 [FIX] website, *: fix conversion of specific svgs on Firefox
*: website_slides

A function allowing to convert a SVG to a PNG has been added as an
utility function in website.utils and is used for the upload of document
in website_slides. This function add support for a specific case which
was not supported by the previous conversion function used for the
document upload in website_slides: SVG without width and height
attributes on Firefox.

Related to task-2602521

closes odoo/odoo#75866

X-original-commit: b5ad8d66e311afcc30dae0ab62642e61ea74b156
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-09-02 04:41:54 +00:00
Wolfgang Taferner 018d4856db [FIX] models: log field names in api.onchange warning
Without this, the warning isn't very actionable.

closes odoo/odoo#75858

X-original-commit: afe7c9895914125fb31dbfde15903fa41e000948
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Signed-off-by: Wolfgang Taferner <wtaferner@users.noreply.github.com>
2021-09-02 04:41:50 +00:00
Xavier-Do babf021812 [FIX] profiling: fix speedscope with empty ctx
Since de077243 the iter(False) will occur when trying to render a
speedscope output with `use_context=False` since the context given in
parameter of `stack_to_ids` won't be an iterable.

This simple fix avoid this by always giving an empty iterable
in this case.

closes odoo/odoo#75851

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-09-02 04:41:46 +00:00
Adrien Widart 7d78dd42c0 [FIX] website_sale: compute price with discounts and pricelists
When combining two pricelists, the unit price might be incorrect

To reproduce the error:
1. In Settings, enable:
    - Pricelists (Advanced)
    - Discounts
2. Create a product P:
    - Sales Price: $100
    - Available on website
3. Edit the Public Pricelist:
    - Add a price rule:
        - Apply On product P
        - Min. Quantity: SuperProduct
        - Compute Price: Percentage
        - Percentage Price: 63%
    - Discount Policy: Included in the price
4. Create a second pricelist:
    - Add a price rule:
        - Apply on product P
        - Compute Price: Formula
        - Based on: Other Pricelist
        - Other Pricelist: Public Pricelist
        - Price Discount: 25%
    - E-commerce Promotional Code: PROMO
    - Discount Policy: Show public price & discount
5. On the website, add P to the cart
6. Edit the cart:
    - P's quantity: 500
    - Apply PROMO code

Error: The new price is $75 instead of $27.75

`_website_product_id_change` already returns the correct price value, so
the latter shouldn't be computed again (moreover,
`_fix_tax_included_price_company` should use the price with the pricelists
applied instead of the default product price)

OPW-2605804

closes odoo/odoo#75843

X-original-commit: 030e92a3150bbb7d749f1a6f10e261791da6eca6
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-09-02 03:43:02 +00:00
std-odoo cc012a0864 [IMP] mail, various: add email templates management levels
Purpose
=======

Purpose of this commit is to add a new group for the mail template designer.
Goal is to make roles clearer: managers edit templates, users use them. This
commit allow some designers / managers to make email template and to let
others users use those email templates.

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

When this feature is enabled in the Settings page, a new group is required to
modify email templates in a composer like wizard or to make dynamic content.
This allows to separate managers editing / composing templates from standard
users that use them.

If the current does not have this group, the email body will be in readonly
mode if he selected an email template. That way we force him to use the email
template that the manager made.

Technical
=========

New Group
---------

Only users in this group will be able to create / write email template or
to write Jinja code in the mail composer (including other fields like subject
in mailing).

By default, all internal users have this group. Mass mailing users also have
this group as writing mailings is about the same management level as writing
templates.

Mail Composer Mixin
-------------------

In comment mode, the template is rendered and then saved on the body field
so non-"Mail Template Editor" users can load email templates.

But in mass mode, the body of the template is saved and then rendered and
many things change the body (HTML sanitizer, web editor move inline CSS
properties, add / remove spaces...). So in this case, we can not know if
the user changed the body or not. That is why we put the body field in
readonly mode so, it is not modified by the web editor.

Jinja code detection
--------------------

To detect dynamic Jinja content, we compile the template, and we browse the
AST. If we do not have a single "Template Data" node, we assume that the
template is dynamic.

When we detect the template as static, we do not render it. That way we
avoid unnecessary rendering.

Code cleaning
-------------

Move Jinja import into tools so that it is outside of mail framework code.

Task-2187263

closes odoo/odoo#75840

Related: odoo/enterprise#20547
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-09-02 03:42:54 +00:00