Commit Graph
147406 Commits
Author SHA1 Message Date
Nicolas (vin) 08e9798d74 [FIX] [base, account_edi_facturx]: Fix pdf export
There is an issue when exporting pdf using edi documents created before
the PDF/A commit. With the subtype now included, the system would try
to use the subtype given by the ir.attachment which would not be formated
as expected by the pdf file format.

The attachment may get neutered by the ORM, so we may have to force
the mimetype when embedding it.

This fix in two parts will allow to force a subtype when adding an
attachment into a pdf, as well as parse the subtype of ir.attachment
to give them the right format.

xxx/xxx should become /xxx#2Fxxx

opw-2714040

closes odoo/odoo#81898

X-original-commit: 880d7a1c8474a3bee4fd05474788fbd4a63f4ae7
Signed-off-by: Laurent Smet <las@odoo.com>
2021-12-24 13:11:50 +00:00
Laurent Stukkens (LTU) 9ffb0143d0 [FIX] web: order company by their sequence in the company switcher
As JS is not taking the properties in the order they are written,
the order in the rendering was always following the property name
sorting order (=id).

Previous to this commit:

    - The companies were ordered by their id in the company switcher as
      JS is not tacking the object properties order into account.

After this commit:

    - The companies will be sorted by their sequence prior to be used in the
      rendering.

task-2722235

closes odoo/odoo#81893

X-original-commit: 39c678a1ccb50d3a1871a4049a8df26427b27a3c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-12-24 12:25:01 +00:00
Kevin Baptiste 6be63d1d81 [FIX] hr_recruitment_survey: use applicant_id when necessary
When sending a survey invite, applicant_id was populated with whatever
active_id was available, regardless of the origin model.

This was preventing users without Recruitment access rights from sending
surveys.

closes odoo/odoo#81867

Taskid: 2721987
X-original-commit: ac811fc591eb89c8d9dc472c10abb2020e5fc14e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-12-24 11:34:14 +00:00
qsm-odoo 4b3d1b0a9f [FIX] website: review commit [1] about editor views/assets toggling
Some naming errors were introduced a few hours ago, this commit quickly
fixes them hoping it goes unnoticed.

[1]: https://github.com/odoo/odoo/commit/9f56357cc1f4a7b8606ef4d5fd431fc396bdf1e8

closes odoo/odoo#81883

X-original-commit: d8315df6fd733c1331911583f86803bad1718d2d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-24 10:42:48 +00:00
Yolann Sabaux 49e6abe0b7 [FIX] web: no trigger of an onchange
Steps to reproduce:
- Install Argentinian Electronic Payment (l10n_ar_edi)
- Change company (ar responsable)
- Go in Accounting > Settings: in the AFIP section
- delete key and certificate
- click on `generate request`
-> the key is not persisted unless a manual refresh/discard is done

Solution:
In V14 the `onchange` is triggered. Why?
Because this https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L130-L139
works because of the call of the `on_close` function:
https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L534-L543

Why not in V15?
In V15 the onchange can be triggered when the `this.reload` function is called via the `on_closed` function:
https://github.com/odoo/odoo/blob/7ce6d8d70be79c9c626865598b898dce9a18b045/addons/web/static/src/legacy/js/views/basic/basic_controller.js#L472-L482

But to be triggered, in the `wrapSuccessOrFail` (when the `_trigger_up` funciton is called), the `onClose` must be called:
https://github.com/odoo/odoo/blob/fb3878b581b831c13550d40e38a8e8890d82ea0d/addons/web/static/src/legacy/action_adapters.js#L362-L376

In order to do that, we would have to use the `options` (the `params`) sent with the `doActionButton` in the `doAction` function.
https://github.com/odoo/odoo/blob/fee371be291ba3d6f1adc71c08420b6510fdf386/addons/web/static/src/webclient/actions/action_service.js#L1198-L1199

BUT the `options` are not used anymore when `_executeActURLAction`* is called (only the `action`paramater is required):
https://github.com/odoo/odoo/blob/fee371be291ba3d6f1adc71c08420b6510fdf386/addons/web/static/src/webclient/actions/action_service.js#L1098-L1104

Therefore, we find ourselves in a situation in which we cannot call the `on_closed` function in (the `options` are not even an 'option'**):
https://github.com/odoo/odoo/blob/fee371be291ba3d6f1adc71c08420b6510fdf386/addons/web/static/src/webclient/actions/action_service.js#L748-L764

Look again in V14 how the function is called:
https://github.com/odoo/odoo/blob/1723c52d42389a8b5124ab4d15d55dad0d119a8f/addons/web/static/src/js/chrome/action_manager.js#L527-L543

The solution is therefore easily understandable.

*we are in this specific switch_case because the action executed is
https://github.com/odoo/enterprise/blob/6805d2f591237ad17d7db827dcf6fe36c2c2744f/l10n_ar_edi/models/res_config_settings.py#L32
** no pun intended

OPW-2680841

closes odoo/odoo#81881

X-original-commit: cb9dfe107d073aeaf4a6b72818b4c28b11dab0c7
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-12-24 10:42:44 +00:00
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