Commit Graph
147401 Commits
Author SHA1 Message Date
std-odoo efc407fe03 [FIX] mail_group: add missing SMTP headers
Bug
===
Since 2d359b909b we moved the mailing
list feature of the <mail.channel> in a different model, <mail.group>.

During this split, some SMTP headers have been forgotten.

Task-2721009

closes odoo/odoo#81887

X-original-commit: daf9c0300fb042891c019e4f2a8c5395de388e1c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-24 09:52:42 +00:00
luvi ff4ac9075b [FIX] web: Missing trash icon from custom filters
This commit fixes an issue where the trash icon was not properly
shown in the dropdown when adding more custom filters.
A test has been written to verify if the download button is
present in the dropdown.

task-2716032

closes odoo/odoo#81871

X-original-commit: af566b663f42479ade2d4b4b01d052215be85c1e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
2021-12-24 08:36:43 +00:00
Alexandre Kühn cc28195b7d [IMP] im_livechat,mail: remove MobileMessagingNavbar/tabs deep props
In preparation for using OWL v2 in discuss code.
(shouldUpdateBasedOnProps will be removed)

Solution consists of introducing MobileMessagingNavbarView model.

Task-2695743

closes odoo/odoo#80617

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-23 19:15:38 +00:00
Alexandre Kühn c71d9ba51e [IMP] mail: remove useless 't-ref="startAMeetingButton"'
Task-2694206

closes odoo/odoo#81801

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-23 18:26:20 +00:00
Alexandre Kühn cd05d194b2 [IMP] mail: remove useless 't-ref="composer"'
Task-2694206

Part-of: odoo/odoo#81801
2021-12-23 18:26:19 +00:00
Alexandre Kühn 0e51782d59 [IMP] mail: remove useless 't-ref="header"'
Task-2694206

Part-of: odoo/odoo#81801
2021-12-23 18:26:19 +00:00
Alexandre Kühn 79d6f1db60 [IMP] mail: remove useless 't-ref="dropzone"'
Task-2694206

Part-of: odoo/odoo#81801
2021-12-23 18:26:19 +00:00
Achraf (abz) 3784a90fd5 [FIX] project: Fix edit button in forms views
since https://github.com/odoo/odoo/pull/79947 edit buttons in forms views `o_form_buttons_view` are invisible
This is due to the missing super call in on_attach_callback and on_detach_callback

closes odoo/odoo#81876

X-original-commit: ffd69e306e501c32bf688614d1fbd70bd5f406ac
Related: odoo/enterprise#23089
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-12-23 17:35:50 +00:00
Audric Onockx (auon) 197b7eddd7 [FIX] sale_timesheet : unlink timesheet from invoice when deleting
invoice line

Steps:
- Create 2 service products with "Invoicing based on timesheet" & " Create a task in sales order's project"
- Create a SO with both products > confirm
- Add hours to both tasks
- Create invoice > remove one invoice line > Save

Issue:
- The removed invoice line is still appearing in the Timesheet stat button

Cause:
- account_analytic_line.timesheet_invoice_id is set to the invoice when the invoice is created
- It is not reset to False when the line is removed from the invoice

Fix:
- Reset it to False when the move the line is removed from invoice

opw-2668814

closes odoo/odoo#81831

X-original-commit: a391ea82091cd4cd62914d7e21fa54f5670126c9
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-12-23 16:43:06 +00:00
stefanorigano (SRI) b0bf660c77 [FIX] website_sale: design fixes
Solve multiple issues on the products grid, causing:
- the ribbon to be wrongly positioned
- the layout to be broken on Firefox
- the products' images ratio to be incorrect on Safari

task #2710553

closes odoo/odoo#81150

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-23 16:43:01 +00:00
88008a8247 [MERGE][REF] product, sale, *: clean pricelist API
Refactor the whole sale price computation logic in `product` & `sale` to improve code quality, maintainability, ...

### Drop/reduce as much as possible context-based logic

* Drop magic `price` and `pricelist_id` fields on `product.product`/`product.template`
  * Keep one unique `_get_contextual_price()` to provide the old logic where it's still needed/difficult to remove atm.
* Do not rely on context fallbacks on the lower level of price computation (aka `price_compute` method)
  It is way too dangerous to have such magic fallbacks so deeply in the logic, inducing potentially unexpected/wrong results

### Clean `product.pricelist` API

* Clear parameters and fallbacks
  * Do not provide unused parameter(s) anymore (`partner`)
  * Stop providing products & quantities as a list of tuples, it was never used with different quantities in the existing code anyway
* Removed unused methods
* Split methods logic to ease and allow clean overrides and customizations
* Convert the old hardcoded SQL query to a clear domain, using ORM querying and formatting logic instead
* Improved documentation (docstrings, ...)

### Side cleanups in related/impacted modules

* Update to use the new clean pricelist API
* Code cleanup in sale prices computation (`sale_*`, `website_sale`, ...)
* Some onchanges -> computes conversion in `sale_*` scope
* Cache applied pricelist rule on SOL (avoid recomputing the pricelist rule in the price AND in the discount computation)

Task ID - 2688106
Community PR: https://github.com/odoo/odoo/pull/79605
Enterprise PR: https://github.com/odoo/enterprise/pull/22211

<!-- Keep both authorship for the merge commit (author=robodoo) -->

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

closes odoo/odoo#79605

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2021-12-23 17:42:54 +01:00
Louis Wicket (wil) 971fecb40b [IMP] mail: test isMulti only once
Move isMulti sooner in the flow so that the check is only done once.

closes odoo/odoo#81863

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-12-23 15:53:48 +00:00
alt-odoo 6fab93bf64 [FIX] lunch: prevent order of unavailable vendor
There is a default Available Today filter on products view but it is not
enough to prevent a very hungry employee to order a product from a vendor
not available today if he removes the filter.

closes odoo/odoo#81866

X-original-commit: 7ec9ab0e9efd87c9e49f72f5f9fc5e43108ed591
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
2021-12-23 15:07:12 +00:00
Benjamin Vray bfec4e2ca4 [FIX] website: fix ripple effect on buttons
Before this commit, the "ripple effect" no longer worked because the
assets were never activated for the following reason:

- To activate the ripple effect assets via the editor options, we
activated a template that no longer exists (with
data-customize-website-views). Instead of activating the assets with the
new system of assets using records.

After this commit, a new "data-customize-website-assets" xml attribute
was created so that the assets can enable/disable in the same way as the
views. The "write" method for ir.asset has also been overridden in
website so that each website has its specific assets (via COW).

task-2686370

closes odoo/odoo#81833

X-original-commit: 9f56357cc1f4a7b8606ef4d5fd431fc396bdf1e8
Related: odoo/design-themes#546
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-23 15:07:06 +00:00
Victor Feyens 83c583b494 [IMP] product: do not fallback on context values in price_compute
This adds too much indeterminism in price computation logic.

Furthermore, remaining calls to price_compute provide the parameter when
needed.
2021-12-23 15:30:24 +01:00
Victor Feyens 15eb4d8795 [FIX] hr_expense: compute price unit in correct currency 2021-12-23 15:30:24 +01:00
Victor Feyens 03d06865de [FIX] sale_purchase: Fix wrong constraint definition
constraint validation should work correctly on multi records
creation/updates
2021-12-23 15:30:24 +01:00
Yannick Tivisse bbd65b8a3a [IMP] product,sale: Convert _onchange_type into compute methods 2021-12-23 15:30:23 +01:00
Yannick Tivisse 70b9b7a772 [IMP] sale_quotation_builder: Split files according to guidelines 2021-12-23 15:30:23 +01:00
Yannick Tivisse 6bf1d1bd9a [IMP] sale_quotation_builder: Convert onchanges into compute method 2021-12-23 15:30:23 +01:00
Yannick Tivisse 9e99a9df46 [IMP] product: Remove price/pricelist_id field from template/variant
Purpose
=======

The fields are not used, don't work correctly and there is a specific
report to generate the product prices according to the pricelist and
the ordered quantities
2021-12-23 15:30:23 +01:00
Yannick Tivisse 14308462e4 [IMP] sale_management: Convert _onchange_product_id into compute methods 2021-12-23 15:30:23 +01:00
Victor Feyens 002d13729a [FIX] sale: make update_prices work correctly if called twice in same request 2021-12-23 15:30:23 +01:00
Victor Feyens 0acd96c340 [IMP] sale: Use a 'cached' pricelist rule mechanism
Cache the pricelist rule used for price computation in a dedicated non
stored field, since it is used both for the price_unit and the discount
computation.

This divides by 2 the number of pricelist requests/queries when
discounts computation is enabled.
2021-12-23 15:30:23 +01:00
Victor Feyens 3295fa4733 [IMP] website_sale_stock: customer_lead field is now compute
no need to compute it manually on e-commerce order creation
2021-12-23 15:30:23 +01:00
Victor FeyensandChafique delli 24fbbb7f83 [IMP] product: split rule filtering in separate method
Co-authored-by: Chafique delli <chafique.delli@akretion.com>
2021-12-23 15:30:23 +01:00
Victor Feyens 493866c37d [IMP] sale, *: clean _get_display_price
* remove error prone product param
always use the product of the line instead.
* also move the method near the place where it's called
2021-12-23 15:30:23 +01:00
Victor Feyens bb1cf7d7ce [IMP] sale: delegate update_prices logic to the computes
Remove duplicated price & discount computation and trigger
the necessary computes.
2021-12-23 15:30:23 +01:00
Victor Feyens b4cc2df510 [IMP] product: reorder pricelist methods & improve docstrings 2021-12-23 15:30:23 +01:00
Victor Feyens 9de5685132 [IMP] product: stop using raw sql to fetch pricelist rules
* Leave the flush to the orm
* Ease inheritance and customizations
* Make sure the order is correctly shared with the 
product.pricelist.item model order
2021-12-23 15:30:23 +01:00
Victor Feyens 57ced812f0 [REF] product: clean pricelist API
* Do not rely on context, everything should be cleary specified through
parameters
  Catch context keys in an unique targeted place to improve code clarity
* Drop strange old API
  * do not provide unused partner parameter anymore
  * do not provide products, qty as a list of tuple, we only request the
same qty for all products anyway
* Clear methods, add/adapt comments and docstrings
* Reduce potential side-effects of context content.
2021-12-23 15:30:23 +01:00
Victor Feyens 6b80cce173 [IMP] product: typos/docstring improvements 2021-12-23 15:30:22 +01:00
Victor Feyens b55f753b80 [IMP] product: clean imports 2021-12-23 15:30:22 +01:00
Victor Feyens 1332074c64 [IMP] product: use existing tools to format amount 2021-12-23 15:30:22 +01:00
Victor Feyens a28ba8dbf3 [IMP] product: harmonize price_compute behavior
* consistent choice of company for currency, currency rates and prices
* support currency conversion date through params
2021-12-23 15:30:22 +01:00
Victor Feyens 2d98ec42e6 [IMP] product: drop unused pricelist methods 2021-12-23 15:30:22 +01:00
50abe8947a [FIX] website: prepare cover dataset upon color selection
Before this commit the cover dataset was only updated during updateUI()
but if the cover was saved before closing the color palette after
selecting a solid color, the selected color was not confirmed and the
saved cover dataset was based on the previously selected color.

After this commit the cover dataset is updated whenever an option is
selected to handle the specific "save before close color palette" case.

task-2678100

closes odoo/odoo#81835

X-original-commit: ad59cbd33e0eaf5c7c77f9e5c0b0435917e2c155
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-12-23 14:14:57 +00:00
Benoit Socias c5e6a743da [FIX] website: consider cover properties root element as savable
Commit [1] did adapt the selection of savable to include cover
properties detected through `[data-name="Cover"]`, but [2] did rename
the blog cover option block from `Cover` to `Blog Post Cover` therefore
it did not get detected. Because of this, only changing attributes on
the root element of the blog post cover was not marking it dirty, and
therefore not saving it unless other changes also happened (e.g. change
the picture)

Given that the name might even be translated, this commit does not use
the value of `data-name` anymore but relies on either the `s_cover` or
the `o_record_cover_container` class.

[1] https://github.com/odoo/odoo/commit/fc67a3370ab04facff28dd956590e4dfa71f8441
[2] https://github.com/odoo/odoo/commit/27e4f8a3e164cad6814cc8d77e4f46515eab5fb4

task-2678100

X-original-commit: 1a37f57e5cbc9a5557efe3ae281790fadc6498ff
Part-of: odoo/odoo#81835
2021-12-23 14:14:56 +00:00
Prakash Prajapati 16246f8374 [FIX] resource: fix the maximum recursion depth traceback
Maximum recursion depth traceback occurs when the resource is created from planning.
This has been fixed.

Reproducing steps:
         - Planning
         - Schedule by Resource
         - Create new Resource

The issue occurs from this commit -https://github.com/odoo/odoo/commit/18952cdc76070f2a70789f2fa25e4fa0d546d470

closes odoo/odoo#81840

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-12-23 13:14:22 +00:00
Parth Gajjar b52c89ab55 [IMP] payment_mollie: updated user agent string for mollie
This string is used by mollie support.
Read more at: https://docs.mollie.com/integration-partners/user-agent-strings

closes odoo/odoo#81826

X-original-commit: 5e24772304e30c75fe2642a0130a70155134710a
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-12-23 09:37:12 +00:00
David Monjoie 21bec66dce [FIX] web_editor: fix double unload popup
task-2710507

closes odoo/odoo#81820

X-original-commit: c32732c142f3a695703f0c60168e02a86374df44
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-23 09:37:08 +00:00
Rémy Baranx (bar) 828e6468fe [FIX] calendar: use given attendee states at event creation
When an event is created from an external calendar account such as
Google or Outlook, attendee info such as email and state may be given,
and should be taken into account.

For example, if the current user who is syncing his calendar is not
the organizer of the event, his attendee state should be set to
'needsAction' and not automatically set to 'accepted'.

opw-2489815

closes odoo/odoo#81636

X-original-commit: eb1adbd6af4b01a8b3b5b16dbf2d6c32eec852e6
Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-23 08:44:38 +00:00
roen-odoo c011c5464a [FIX] pos_cash_rounding : Unpaid orders when using cash rounding
Current behavior :
When using cash rouding method "HALF-UP" if the difference between the rounded price and the original price was exactly the half of the cash rounding, the order would appear as unpaid.

Steps to reproduce :
- Create a rounding method of 0.5 (half-up)
- Sell a product for 11.25
- The order appears unpaid in the PoS orders list view

opw-2593687

closes odoo/odoo#81830

X-original-commit: 3c452f9f731490ce94331f40ffdbe1957052000e
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2021-12-22 20:55:11 +00:00
JF Aubert 13842ca9ae [IMP] mrp: Add multiple lots components warning to Mass Produce
Mass produce originally prohibited multiple lots components.
Later commit removed this limitation (among others).
This one displays a warning to make sure it is intentional.

task 2633369

closes odoo/odoo#77254

Related: odoo/enterprise#22797
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-12-22 17:55:49 +00:00
JF Aubert f11fcf6bb4 [REF] mrp: split productions
There is 2 major issues with the production of multiple serials number
- Performance issue
- Duplicated code with classic backorder mechanism

The performance issues exist since backorders were create one by one
and `stock.move` and `stock.move.line` are always recomputed. They
are not created in batch neither.

_generate_backorders is removed and replace by _split_productions. The
functionality are the same. Technicaly it does the maximum in batch,
first it creates all the `mrp.production` then all the `stock.move`
and finaly, it splits the existing `stock.move.line` among the new
`stock.move`
It means that the reservation is not recompute anymore during a
backorder process and will remain the same than the splitted production
order.

Performance metrics (10 components):

	|	2   |	10	100	 1000
before	|   0.47s   |  2.84s | 32.25s | 580.53s
-----------------------------------------------
after	|   0.13s   |  0.36s |  2.60s |  35.17s

task 2633369

Part-of: odoo/odoo#77254
2021-12-22 17:55:49 +00:00
Olivier Dony ea0e9ec0aa [FIX] tools.mail: ignore original email during encapsulation
When the system broadcasts an email response to document followers,
if the config parameters `mail.force.smtp.from` or
`mail.dynamic.smtp.from` are defined, it will rewrite the `From`
address to avoid spoofing the sender's domain.
**NOTE**: As of 15.0, this is based on the `from_filter` setting on the
corresponding ir.mail_server, rather than the abovementioned config
parameters, but the rest of the discussion stands.

For example, if the `mail.catchall.domain` is set to `example.com` and
an email response comes from:

   "John D" <john@doe.com>

it will rewrite it to:

   "John D (john@doe.com)" <notifications@example.com>

This will make sure the system never sends outgoing email for an external
domain, as it has no authority for doing so, and that could
break mail filtering/authentication rules (SPF, DMARC, etc.)

During this "encapsulation rewrite step", both the original Sender name
and their email are preserved, and put into the quoted "name" field of
the rewritten address. It seems sensible to preserve as much information
as possible about the original sender.

Unfortunately, the inclusion of the Sender email in the final name makes
it appear to some inbox providers as if the message is trying to
deceptively impersonate another person (as many phishing schemes would).
As of November 2021 GMail at least does this, and will hide the name in
the UI when it happens. It will keep only the rewritten email, which is not
very useful in the case of a notification (even though it's more
technically correct, of course).

This patch removes the original email from the rewritten notification,
keeping only the name, considering that the email is not the most
important part, and it's better to have one of the two than none.

So after the patch, the rewritten address is now:

   "John D" <notifications@example.com>

When there is no name in the original address, we keep only the local
part of the email, to avoid the same display issue. The recipient will
have to identify the sender based on the context / past messages.

closes odoo/odoo#81807

X-original-commit: 3c65ec5a8191a392980ceb0a8c584767eae405f1
Signed-off-by: Olivier Dony <odo@odoo.com>
2021-12-22 15:45:53 +00:00
Benjamin Vray 6b7729a4c6 [FIX] website: fix the position of the ripple effect
Before this commit, the ripple effect did not work when a button was not
in the same location/size when clicked compared to its position/size
when the page was loaded. (e.g. after scrolling the page)

task-2686370

closes odoo/odoo#81756

X-original-commit: 95728886ef3abd4e5809a5749c803c312b9267b8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-22 15:45:49 +00:00
Rémy Baranx (bar) 8153d0b12f [IMP] calendar: inform user about event attendees with invalid email addresses
If some attendees of an event have an empty or invalid email address,
the organizer of this event should be informed that these attendees
won't receive any email notifications.

opw-2667016

closes odoo/odoo#79368

Signed-off-by: Arnaud Joset <arj@odoo.com>
2021-12-22 15:45:46 +00:00
Francisco Javier Luna Vázquez 8023f0dfde [CLA] Add frahikLV as new contributor in Vauxoo
closes odoo/odoo#81799

X-original-commit: a82d56be2caa3dfcf3fe5013b29d8864e3e64490
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-22 14:02:41 +00:00
Thibault Francois 2daa9a1673 [FIX] sale: send invoice only when ready to be send
Issues
------

In the module sale, with the automatic invoicing configured.
Payment transaction generate, post and send the invoice when
they are post process.

In some country the invoice is not directly ready to be sent
due to some edi document

Solution
--------

use the mechanism introduce with https://github.com/odoo/odoo/commit/3a29371eb70309f46e3b8938434287fefc23b351
to delay the sending. Introduce a cron that check invoice to send

closes odoo/odoo#81526

X-original-commit: 97b74d8304337d901d9422418cbd0dcdcc46fcf5
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-12-22 14:02:37 +00:00