Commit Graph
149826 Commits
Author SHA1 Message Date
Antoine Guenet bb37bd915e [FIX] mass_mailing: do tab style manipulations on start mass_mailing
When starting the mass_mailing design option, some manipulations
are done on the `#design-element` style element. This can result in
sudden style changes when clicking the design tab.
This commit makes it so these manipulations are done as soon as
mass_mailing starts. In order to do that, constants were shared from
mass_mailing_snippets.

closes odoo/odoo#88318

Related: odoo/enterprise#25753
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-11 10:01:34 +02:00
Andres Calle 0c544f8e67 [FIX] l10n_ec: use the corresponding accounts for 100% withholding taxes
closes odoo/odoo#88342

X-original-commit: 89662dec86124d96036b824b105b462cf8ee9ca8
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-04-08 20:26:31 +02:00
Ivan Yelizariev eb9fedd2df [FIX] point_of_sale: make background loading silent
Loading in background is supposed be background and not block UI after 3 sec of
loading.

STEPS:
* In `pos.config` set `[x] Limited Products Loading`, and `[x] ​Load all
remaining products in the background`
* add enough products to POS, e.g. 40 000
* Open pos

BEFORE: background loading triggers UI Blocking if it takes more than 3 seconds
AFTER:  products/partners are loaded in background without interrupting UI

---

opw-2817770

closes odoo/odoo#88330

X-original-commit: 64232893886c6613212885a382b6f0732c091ef2
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-04-08 20:26:27 +02:00
Alexandre Kühn 7a09f8b7d6 [IMP] mail: remove ComposerSuggestionComponent getters
This commit replaces getters in `ComposerSuggestion` component to fields in
model `ComposerSuggestion`.

Getters in component are a problem for many reasons, notably that business
code is in component and not in modelling. Code that are not in modelling are
hacky, hard to maintain, and very prone to bug. That's why it's important to
move most code in components to models.

Task-2793280

closes odoo/odoo#88315

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-08 19:31:29 +02:00
Andrea Grazioso (agr-odoo) 64106ba7c7 [FIX] l10n_fr_fec: use invoice/bill date when generating FEC
Install FR accounting and have a FR company setup with VAT
Create a bill with bill date different from accounting date
Export FEC under Accounting>Reporting>FEC

For the created bill the accounting date will be used, while it should
be taken first the bill date

opw-2680288

closes odoo/odoo#88319

X-original-commit: 2b1fc6a9b48e423e8f299ebeb723c95302aa13ea
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-04-08 18:31:41 +02:00
jlzhou b9d5572204 [CLA] add medoo.tech CLA file
closes odoo/odoo#88306

X-original-commit: 1b55990169015de01bd192b197236763827fd084
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-04-08 17:13:40 +02:00
Jeremy Kersten 66f886e480 [FIX] website_event_*exhibitor,(q)web: don't crash sponsor if no name
Field name on sponsor are not required. So when we display the image of a
sponsor without field-name it will use the rec_name 'name' that is not set
and so False.
It will crash during rendering of the widget image that use it.

Now we force to use a field required 'partner_name' to avoid the crash.
By default, when you confirm the sale_order from the backend, we copy
the partner name in field name.

Because we use a class avatar to have a max-width of 96, we don't need
to use a image_512, image_128 is enough in most of case.
The max-width option on widget image has no effect on rendering.

In other case where the rec_name is Falsy and we don't provide other name to
the widget, we now use a default 'name' value to avoid a crash:

closes odoo/odoo#88296

Attributeerror: 'bool' object has no attribute 'replace'
X-original-commit: b054dfc715afb225eb032a722ec58e6888b1b905
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2022-04-08 17:13:35 +02:00
Xavier BOL (xbo) 2e124663e4 [FIX] project_purchase: display the form if only one record to display
Before this commit, when the user clicks on the Purchase Order row in
costs of project profitability section displayed in right side panel,
the action redirects the user to the list view of `Purchase Order Line`
even if there is only one record.

This commit fixes the issue to display the form view when there is only
one record to display.

task-2814466

closes odoo/odoo#88219

Related: odoo/enterprise#26004
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-04-08 17:13:31 +02:00
Xavier BOL (xbo) e0824571f0 [IMP] sale_timesheet: change timesheet action to get the correct pivot
Before this commit, in the project right side panel, we use the action
used with the stat button displayed in project form view. This action
has a pivot view grouped by invoice type. However, in the right side
panel, the timesheet invoice types shown in revenues and costs
subsection of the project profitability section does not need this group
by but we would like to group by invoice (if the row concerned
"Timesheet (Billed on Time)") or group by employee (for the other rows)

This commit changes the action to use the action as template created
for Sales section in project right side panel. With this changes, we
no longer have to change the views to have the ones expected, we will
just change the pivot view according to the row selected (concerning the
timesheets part) in Profitability section.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:31 +02:00
Xavier BOL (xbo) c48e54fb3c [IMP] project: put in bold the text in table column when text-bold class
This commit add a css style when a td (= table column) has the class
`text-bold` to put in bold the text in that column.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:31 +02:00
Xavier BOL (xbo) 3fcf7631c9 [IMP] sale_{project,timesheet}: add default values for timesheets action
This commit adds some default values for the action used in the SOLs
containing a service product shown in the Sales section.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:30 +02:00
Xavier BOL (xbo) 1a32fbd9c9 [IMP] project_purchase: take into account PO confirmed in project profitability
Before this commit, the PO is only taken into account in the project
profitability if the quantity to invoice or the quantity invoiced is
greater than 0 in its lines. However, we could take into account the PO
when it is confirmed and the products ordered are not delivered to have
an idea on the costs impacted by this PO.

This commit computes the costs impacted by the PO linked to the AA from
the project if the PO is confirmed and there is a quantity ordered or
invoiced or to invoice in its lines. If no quantity to invoice is found
then the amount to invoice will be the price unit of the product
multiplied by the difference between the quantity ordered and the quantity
invoiced.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:30 +02:00
Xavier BOL (xbo) e41a8b924c [IMP] sale_{project,timesheet}: display price_unit when 2 SOLs for the same service
Before this commit, the `name_get` method is override in
`sale_timesheet` module to add the price_unit when more than one SOL is
shown for the same product in the same Sale Order. This override adds
the price unit only when the `with_price_unit` key is in the context, so
it is only used in the `sale_line_id` field defined in `project.project`
and `project.task` models and also `so_line` field in
`analytic.account.line` model when the user wants to set a SOL for those
models. However, the Sales section displayed in project right side
panel is added in `sale_project` and so we cannot use the override in
that module since `sale_timesheet` is not installed when `sale_project`.

This commit moves the part concerning the `with_price_unit` of the
`name_get` override defined in `sale_timesheet` module to `sale_project`
one. And then, we will use the context key in the Sales section to
display the price unit when there are more than one SOL for a same
product in a same Sales Order.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:30 +02:00
Xavier BOL (xbo) 3c5de9490a [IMP] project_mrp: add help message when no record in MRP action
Before this commit, when the user clicks on "Manufactoring" row in
Project Profitability section displayed in right side panel the user
arrives in the tree view if there are more than one record. If he
filters the records and found no record then no help message is shown,
he has just an empty list view.

This commit adds a help message for that action to dislplay it when no
record is shown in the list view (or another view) for this action.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:30 +02:00
Xavier BOL (xbo) 5dd5149df1 [FIX] sale_timesheet: group by invoice for timesheet billed on time
Before this commit, all rows about timesheets in the revenues of project
profitability section can be clickable and shown the timesheets related
grouped by invoice. However, the invoice is only linked to the
timesheets containing a SOL with the invoice type of the product is set
to 'delivered' and the service_type of this product is set to
'timesheet'. It means only one timesheet row in the revenues has some
timesheets with an invoice linked.

This commit only group by invoice the views in the action called when
the user clicks on 'Timesheet (Billed on Time)' row name.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:29 +02:00
Xavier BOL (xbo) 6bd547a4e1 [IMP] sale_project: display 5 sales order items in Sales section
Before this commit, by default 10 sales order items are shown in the
Sales section displayed in the right side panel of project update view.
This section takes much place when there are 10 rows by default.

This commit reduces the number of Sales Order Items to 5 records
to display by default when the user arrives in the project update
view with the right side panel. By the way, if the user wants to see
more Sales Order Items, he can click on "Load More" button to see 5
additional Sales Order Items.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:29 +02:00
Xavier BOL (xbo) ad4b334789 [IMP] sale_project: check if the user can access SO to see SOLs
Before this commit, when the user clicks on the Material row shown in
the project profitability section, he can see the SOLs from another
saleman even if he has just the "See own documents" access rights on
Sales app. Moreover, the check to allow the user to click on a SOL name
in Sales section to get either the timesheets and the stock moves
related is done in sudo and so we do not take into account the rules
defined for the current user.

This commit filters the Sales Order Items to show for the user if
he can see the Sales Order(s) related. it removes the sudo to
correctly filter the SOLs and get only the ones accessible by the
current user.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:28 +02:00
Xavier BOL (xbo) 153f35ef7f [IMP] project: grey the row when the user hovers it.
Before this commit, the user could having a bit difficult to read a
row in Sales or Profitability section shown in right side panel of
project update view since there is not much space between 2 rows.
The idea is to add a color when the user hover a row to correctly see
the row that he sees.

This commit greys a row when the user hovers a row like we did for the
line in the milestone section in the right side panel.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:28 +02:00
Xavier BOL (xbo) 44bc52724a [IMP] project: add no line break in formatMonetary for right panel
Before this commit, when the amount is big the monetary symbol is
displayed either above or below the amount associated.

This commit replaces the basic space by a no line break space to keep
the symbol at the same line than the amount.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:28 +02:00
Xavier BOL (xbo) d1d00c0e4c [IMP] project,sale_{project{_stock},timesheet}: display form view if one record
Before this commit, when the user clicks on a row in Sales section
displayed in the right side panel of project update, the action display
the list view even if there is only one record to display.

This commit passes the `res_id` with the action to the frontend to
call the action and directly display the form view when we are sure
there is only one record to show.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:27 +02:00
Xavier BOL (xbo) f6ba68220a [IMP] project_hr_expense: display the form view when one record to display
Before this commit, when the user clicks on the expense row shown in the
project profitability displayed in the right side panel of the project
update. The action displays the list view instead of directly the form
view.

This commit checks the number of records is equal to one to display the
form view directly if the number is one.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:27 +02:00
Xavier BOL (xbo) c9b8b5b0eb [FIX] project: parse the context given by the backend
Before this commit, the context retrieves when the user clicks on a
Profitability section is not parse, and since this context is a string
containing the JS object with the context added, the context is not
correctly added with the existing context.

This commit parses the added context to correctly append it with the
initial one.

task-2814466

Part-of: odoo/odoo#88219
2022-04-08 17:13:27 +02:00
Brieuc-brd 731de19c27 [REF] mail: FollowerSubtype, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2818653

closes odoo/odoo#88202

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-08 17:12:52 +02:00
Brieuc-brd bbe2702cec [REF] mail: Follower, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2818584

closes odoo/odoo#88196

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-08 17:12:48 +02:00
Sébastien Theys a29a7183a4 [IMP] mail, im_livechat: fix performance of channel access rule
Current access rule requires fetching all members of each channel, which does not scale.

Use is_member field instead, and make sure itself does not fetch all members.

task-2818759

closes odoo/odoo#88221

Related: odoo/upgrade#3422
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-04-08 15:52:31 +02:00
Brieuc-brd cc23863f09 [REF] mail: MailTemplate, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2818801

closes odoo/odoo#88216

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-08 15:52:27 +02:00
Brieuc-brd 5e634a53e9 [REF] mail: FollowerSubtypeList, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2818667

closes odoo/odoo#88203

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-04-08 15:52:23 +02:00
Pieter Claeys (clpi) 0e26ed6962 [FIX] mrp_subcontracting: landed cost
When adding a landed cost and selecting Manufacturing Order, the name of the receipt of the subcontracted products is now shown as well as the MO name for subcontracting orders.

Task: 2667152
Community PR: https://github.com/odoo/odoo/pull/88199

closes odoo/odoo#88199

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-04-08 15:52:19 +02:00
Guillaume (gdi) 457d61693b [IMP] website: remove useless code from social media
As social medias can no longer be d-none in the DOM, some code can be
removed from the social media snippet option.

task-2739937

closes odoo/odoo#85476

Related: odoo/upgrade#3292
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-04-08 15:52:09 +02:00
Guillaume (gdi) 7ce797233b [IMP] website: make the mega menu use the social_media block
This commit changes the mega menu template in order to make it use the
social_media block.

task-2739937

Part-of: odoo/odoo#85476
2022-04-08 15:52:09 +02:00
Guillaume (gdi) 69a6396e2b [IMP] website: remove hidden social media links
As social medias are now created dynamically, invisible (d-none) social
medias can be removed from the templates.

task-2739937

Part-of: odoo/odoo#85476
2022-04-08 15:52:08 +02:00
Guillaume (gdi) 4e564b4ffd [FIX] website: move s_share options to standard options
As the s_share options are now shared options between s_share and
s_social_media, the XML option code has to be in a shared file.

task-2739937

Part-of: odoo/odoo#85476
2022-04-08 15:52:08 +02:00
Laurent Desausoi (lade) 9d78022917 [FIX] website_sale_comparison: Product comparison with base unit price error
When you compare two products on the ecommerce with the Base Unit Price enabled,
an error occurs.

To reproduce the issue:
1. Install the eCommerce app.
2. Go to the settings of eCommerce and activate the options "Base Unit Price" and "Product Comparison Tool".
3. On the website, go to the shop, and compare two products.

Solution: The XML was passing an invalid argument (unset variable) to the 't-call'.
The argument was in fact unecessary as the argument is already defined in the 't-foreach'.

opw-2802682

closes odoo/odoo#88294

X-original-commit: 91a3a3803c7569ccb755266c8bec2fd7b2a6c315
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Desausoi Laurent (lade) <lade@odoo.com>
2022-04-08 14:48:50 +02:00
Adrien Widart b342db8cc9 [FIX] product_expiry: propagate lot's expiration date
On a receipt, when defining the expiration date of a lot, the SML keeps
<today> as expiration date

To reproduce the issue:
1. Edit the operation type "Receipts":
    - Show Detailed Operations: True
    - Use Existing Lots/Serial Numbers: True
2. Create a product P:
    - Type: Storable
    - Tracking: By Lots
    - Expiration Date: Enabled
3. Create a planned receipt R with 1 x P
4. Mark R as Todo
5. Add a detailed operations:
    - 1 x P with new lot L
6. Edit the lot:
    - Expiration Date: <today + 7days>

Error: When saving the picking (with the lot updated), the expiration
date is incorrect (set to <today>).

OPW-2785256

closes odoo/odoo#88283

X-original-commit: dd78e43a6286f798c54cf6b3222d3861b9dad34f
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-04-08 14:48:46 +02:00
Xavier BOL (xbo) 8e0ef46e32 [FIX] project: fix duplication of project containing subtasks
Before this commit, when the user duplicates a project with subtasks the
subtasks are duplicating twice. This is because we now duplicate the
subtasks when a task is duplicated.

This commit fixes this issue to duplicate once the subtasks when the
project is duplicated.

Steps to reproduce:
==================
1) Create a project A
2) Create a task T with a subtask
3) Duplicate the project A

Expected Behaviour:
==================
The duplicated project should have 2 tasks (subtasks included)

Actual Behaviour:
================
The duplicated project has 3 tasks (subtasks included), the subtask is
duplicated twice.

This bug has been found during the development of task-2726465

Related PR: #86997

closes odoo/odoo#88264

X-original-commit: dcf780026bfa7d76a58aa766b8d190022818ce45
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-04-08 14:48:42 +02:00
Odoo's Mergebot 3e480657fa [MERGE] sale_coupon,point_of_sale: Merge Coupon, Loyalty Cards, eWallets models
This module is an unification of `coupon`, `gift_card` and an extraction
of the program models of `pos_loyalty`.

The goal of this module is to unify the creation of coupon, promotion,
gift_card, loyalty programs etc.. into a single base module and share
the same models.

Managers will be able to create programs based on rules and rewards.
Programs may apply on the current order (rules and rewards)
or on future orders, where the rules must match the first order to get a
reward on the second order
or even be nominative and accumulate points over multiple orders.

Every program is based on a point system. And each use of the program
will result in the creation of a coupon (except for nominative programs
which should be limited to one card per customer).

A rule may filter on quantity, money spent and products and give points
on the order, the amount of units paid or the amount of money spent.

A reward could be a free product, a discount or (with an additional
module) free shipping.
Discounts can be percentage based, fixed, or based on the amount of
points the card has.
They can also be filtered on products or tags, to discount specific
products.

A new feature is also being able to select communication plan for these
programs.
The manager can define a template to be sent upon the creation of a new
coupon/card or when reaching a certain amount of points.

TaskId-2675382

Relates to:
 - Community: https://github.com/odoo/odoo/pull/82250
 - Enterprise: https://github.com/odoo/enterprise/pull/23256
 - Upgrade: https://github.com/odoo/upgrade/pull/3234

Original PRs:
  - coupon: https://github.com/odoo/odoo/pull/38266
  - gift_card: https://github.com/odoo/odoo/pull/64195
  - pos_loyalty commit: https://github.com/odoo/enterprise/commit/376f7ca4870e995438cd91b9289ace753320e32e
  - sale_coupon: https://github.com/odoo/enterprise/pull/13
  - sale_gift_card: https://github.com/odoo/odoo/pull/64195
  - website_sale_gift_card: https://github.com/odoo/odoo/pull/64195
  - website_sale_coupon_delivery: https://github.com/odoo/odoo/issues/31857
  - pos_coupon pr: https://github.com/odoo/odoo/pull/38382
  - pos_gift_card pr: https://github.com/odoo/odoo/pull/75518
  - sale_coupon_taxcloud: https://github.com/odoo/enterprise/commit/d08e5083fe89df231766bf57606515677405e1ad
  - sale_coupon_taxcloud_delivery: https://github.com/odoo/enterprise/commit/010926e28c08226531b21466ee092fe503aff497
  - helpdesk_sale_coupon: https://github.com/odoo/enterprise/commit/4c81b37abb89ef748aa59cf193ed2f59ab974bc0

closes odoo/odoo#82250

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-04-08 13:46:26 +02:00
dbkosky df2759edb4 [REM] l10n_it_edi: remove unused tax_map variable
The tax map was used in a previous version of the invoice template, it
was superceeded by 'tax_details', which uses the
_prepare_edi_tax_details function

closes odoo/odoo#87734

Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-04-08 12:37:50 +02:00
momegahed 3001419e15 [FIX] product: variant sale price is wrong
If applied, this commit will fix the following bug by using the price
with the additional cost added instead of only the price

Steps to reproduce:

1- install sales
2- create a product p with variant pv
3- set an extra value for pv
4- go to Products>Product Variants
5- open the pv in form view
6- the Sales Price is the price of p not pv
(which should be p + extra value)
7- also the tax string is calculated on p not pv

Bug:

```list_price``` is being used

Fix:

replace ```list_price``` with  ```lst_price```

OPW-2774199

closes odoo/odoo#88270

X-original-commit: 46526f629f7645eaac8ce86e81e806cfa392b8b8
Signed-off-by: William André (wan) <wan@odoo.com>
2022-04-08 11:39:56 +02:00
PNO fbba584c68 [FIX] stock: Wrong next_inventory_date
Issue:
Imagine today is the April 7th 2022 and we set the inventory frequency to 90 days. If our last inventory date was on January 12th 2022, the next inventory date should be set to April 12th 2022. However, it is being set to January 27th 2022 which is wrong.
The next inventory date should be last inventory date + cyclic inventory frequency.

OPW-2795459

closes odoo/odoo#88267

X-original-commit: 990758ebbed294c8f25d90a5e4f6a7455be97a31
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-04-08 11:39:52 +02:00
clesgow bde1fe704a [FIX] mrp: procure_method lost on mrp backorders
When creating a backorder for a manufacturing order, procure method for
its moves are lost in the process, as the the field is set to copy
False. But the split of a manufacturing order is not a usual copy case.

In this specific case, we need to keep the procure_method of the copied
moves, as it keeps the two/three-steps routes working for the splitted
manufacturing order.

Task-2797359

closes odoo/odoo#88208

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-04-08 11:39:49 +02:00
William Braeckman 26e79061f5 [ADD] pos_loyalty: manage loyalty in PoS
This module was moved from enterprise to community and now includes
pos_coupon and pos_gift_card aswell.

TaskId-2675382
2022-04-08 11:04:44 +02:00
William Braeckman 38b907814f [ADD] website_sale_loyalty_delivery: offer free shipping in eCommerce
Connects sale_loyalty_delivery and website_sale_loyalty.

This module replaces website_sale_coupon_delivery

TaskId-2675382
2022-04-08 11:04:43 +02:00
William Braeckman 5cebdc7986 [ADD] website_sale_loyalty: manage loyalty in eCommerce
This module replaces both website_sale_coupon and
website_sale_gift_card.

Connects sale_loyalty with website_sale to allow for promotion programs
in eCommerce.

TaskId-2675382
2022-04-08 11:04:43 +02:00
William Braeckman 58a88b7731 [ADD] sale_loyalty_delivery: offer free shipping in sales orders
Connects sale_loyalty and loyalty_delivery.

This module replaces sale_coupon_delivery.

TaskId-2675382
2022-04-08 11:04:43 +02:00
William Braeckman 1d92a264a6 [ADD] sale_loyalty: manage loyalty in sales orders
This module replaces both sale_coupon and sale_gift_card aswell as
adding new loyalty programs feature to sale.

TaskId-2675382
2022-04-08 11:04:43 +02:00
William HenrotinandAdrien Widart 7ef48801bb [FIX] mrp_subcontracting_account: read price unit at validation
In a subcontracting flow, the extra_cost on the subcontracted production
is read on the purchase line (via _get_price_unit() ) at the production
creation. In case the price unit on this purchase line change before the
validation, the stock valuation layer linked to the production will not
take this new value into account.

This commit ensures the price unit is the right one at validation

Note: the first version of the current fix broke a use case. The test
`test_tracked_compo_and_backorder` has been added to protect that use
case.

closes odoo/odoo#87817

X-original-commit: 1ff1b4a9a2b9ab27b29fdcac93731fa053c77cc7
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Co-authored-by: William Henrotin (whe) <whe@odoo.com>
Co-authored-by: Adrien Widart <awt@odoo.com>
2022-04-08 10:37:56 +02:00
Joseph Caburnay 1cfac2f2cd [FIX] point_of_sale: ui stuck when product has grouped tax
To reproduce:

1. Create a grouped tax with multiple taxes. Reorder the tax
   items. (Important step.)
2. Assign tax to the product.
3. Open pos loading the product.
4. a. [BUG] If pos config is tax-included -> non-responsive ui.
4. b. [BUG] If pos config is tax-excluded:
          Add the product. -> non-responsive ui.

Fix:

With the new reactivity in owl, mutating reactive objects will
trigger rerender. However, computing tax amount of orderline
or product with grouped taxes result to mutation of a reactive
object, triggering an infinite render (render -> compute with
mutation -> will trigger another render -> ...).

The call to sort is mutating the reactive array referred by
`children_tax_ids`. To prevent this infinite render, the solution
is to use a copy of the array when sorting the taxes.

OPW-2816546

closes odoo/odoo#88245

X-original-commit: b273056a12a34fec75d980e8a4a08ebaedad7e9c
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-04-08 09:40:14 +02:00
Antoine Guenet 984ec124f4 [FIX] mass_mailing: properly apply nested styles in paragraphs
Inline styles applied by the editor should always have priority over the
general stylesheet. This failed in the case of nested styles (a <font>
with a color within a <span> with a font size for instance).

closes odoo/odoo#88004

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-04-08 09:40:10 +02:00
Antoine Guenet 989425c576 [FIX] mass_mailing: handle comma-separated template styles
To give a custom style to a template, we need to add a style element at
its top, with the id "design-element", and apply to it the supported
styles. These supported styles and their selectors can be seen in the
`DEFAULT_CSS_OBJECT` constant in `mass_mailing_snippets.js`.
However, comma-separated selectors were not supported, meaning styles
could only be incomplete.

task-2816655

Part-of: odoo/odoo#88004
2022-04-08 09:40:10 +02:00
William Braeckman e996ff630d [ADD] loyalty_delivery: add free shipping as reward
Complementary module for `loyalty` that adds a new reward type: Free
Shipping.

TaskId-2675382
2022-04-08 09:38:45 +02:00