Commit Graph
154854 Commits
Author SHA1 Message Date
xO-Tx b0484d64c4 [FIX] website, *: fix website content kanban views
*: website_blog, website_forum, website_hr_recruitment, website_sale,
   website_slides

The goal of this commit is to set the missing 'view_ids' on some
actions linked to website 'pages' tree/kanban views.

Linking a form view to actions will make the 'Edit' & 'Configuration'
buttons work correctly (on kanban record dropdown for 'hr.job' &
'slide.channel').

The website url on "product pages" kanban should start on a new line
after this commit too.

Related to task-2889981

closes odoo/odoo#101814

X-original-commit: a61e730cd9f92b2c343646f33f3e59cef518c3bf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-03 20:19:53 +02:00
xO-Tx 0d6ca33f5d [FIX] website, *: add multi-edit for jobs pages
*: website_hr_recruitment

After [1], the multi-edit was added on the pages list views not using it
except 'hr.job' records since editing the 'Department' field leads to a
traceback.

The goal of this commit is to fix this issue by setting an invisible
'company_id' (to be available in domains since necessary to change
'Department') and add multi-edit on the view.

The 'home' icon for 'home page' records on list view should be hidden
after this commit (on multi edit mode) to edit the fields correctly.

[1]: https://github.com/odoo/odoo/commit/be58687284884550cc4e6c2ac7255abee4eb1125

Related to task-2889981

X-original-commit: d101be46a2a9c392e2d63f491fcc5ccec2d65c78
Part-of: odoo/odoo#101814
2022-10-03 20:19:53 +02:00
Adrien Schoffeniels 66bf0516ee [FIX] survey: fix sample surveys form view
Purpose:
--------
When opening one of the sample surveys, the name of the survey was not
displayed entirely, and deleting the sample survey didn't do anything.

Specs:
------
Removed "target" parameter of the show sample action which was set to
"main", which clears the breadcrumbs. Since the breadcrumbs were cleared,
when opening a sample, one could not go back to the kanban view and was
stuck in the form view when deleting the sample.

Also removed the "form_view_initial_mode" which was set to "edit", which
is not required anymore since the introduction of the always edit mode.

Task-3004137

closes odoo/odoo#101976

X-original-commit: 519cabbe0202c94027e044dd1b598f1539320e27
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-03 19:22:55 +02:00
tsm-odoo 981459d31f [IMP] mail: restore sign request activity
task-2998137

closes odoo/odoo#101973

X-original-commit: a207d47236a1757018bf7fcd6634b918e53ddc2f
Related: odoo/enterprise#32208
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2022-10-03 19:22:50 +02:00
Xavier ALT 3b6c20805c [FIX] base: fix mock smtplib connection for server with 'starttls' encryption
During tests, when matching ir.mail_server has `smtp_encryption` set to
`starttls`, connect() will crash with an AttributeError as follows:

2022-09-22 07:04:27,882 20445 ERROR tests-150-starttls odoo.addons.base.tests.test_ir_mail_server: ERROR: TestIrMailServer.test_mail_server_send_email
Traceback (most recent call last):
  File "/home/odoo/src/odoo/15.0/odoo/tools/misc.py", line 804, in deco
    return func(*args, **kwargs)
  File "/home/odoo/src/odoo/15.0/odoo/addons/base/tests/test_ir_mail_server.py", line 261, in test_mail_server_send_email
    IrMailServer.send_email(message, mail_server_id=self.server_domain.id)
  File "/home/odoo/src/odoo/15.0/odoo/addons/base/models/ir_mail_server.py", line 575, in send_email
    smtp = self.connect(
  File "/usr/lib/python3.8/unittest/mock.py", line 1081, in __call__
    return self._mock_call(*args, **kwargs)
  File "/usr/lib/python3.8/unittest/mock.py", line 1085, in _mock_call
    return self._execute_mock_call(*args, **kwargs)
  File "/usr/lib/python3.8/unittest/mock.py", line 1146, in _execute_mock_call
    result = effect(*args, **kwargs)
  File "/home/odoo/src/odoo/15.0/odoo/addons/base/models/ir_mail_server.py", line 313, in connect
    connection.starttls(context=ssl_context)
AttributeError: 'TestingSMTPSession' object has no attribute 'starttls'

This commit adds a dummy `starttls()` method to `TestingSMTPSession` to
gracefully handle such case.

closes odoo/odoo#101962

X-original-commit: ec156901dd4db2fc7a2827b1eb78515f6259699e
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2022-10-03 19:22:48 +02:00
Pierre Masereel 0535e86216 [FIX] point_of_sale: display bank statement lines
Since the bank statements have been removed, we don't have anymore a
stat button to show the bank statement.

So we re)introduce a button that display the statement lines.

caused by: https://github.com/odoo/odoo/pull/99092

closes odoo/odoo#101929

X-original-commit: dd21c708cc08d484530bc7c8433ebbb79f59323a
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-10-03 19:22:45 +02:00
Mathieu Duckerts-Antoine c57f839721 [FIX] web: list: do not always keep offset
Have a list view with more records that can be displayed with the current
limit. Go to next page and group by some field that produces fewer groups
that the current offset. Before this commit, no group is shown because
the offset is kept when the list reload. The same thing can happen when
the domain is changed.

We fix that bug by setting the offset to be zero when the list reload.

closes odoo/odoo#101975

X-original-commit: bda0bd21c8e6772cbfb0680a2b8b497dbbcfd628
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-10-03 18:20:03 +02:00
Younn Olivier 0cab2c8deb [FIX] website: remove 'Odoo' prefix on the WebsitePreview document title
Before this commit, the WebsitePreview document title was not completely
replaced with the iframe's one: it was still prefixed by 'Odoo - ' by
the title service.

Now, the WebsitePreview, introduced in [1], is adapted to remove the
'zopenerp' part when replacing the title (and adding it again when
unmounted). While doing this, the backend's favicon is also changed with
the frontend's one, to be consistent with displaying the frontend
document title only.

This commit also adds an effect on the Optimize SEO dialog, so that the
document title matches the user's input.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

closes odoo/odoo#101972

X-original-commit: 52ec7d1279144b9cd38f8444648b8246df694b9c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Younn Olivier (yol) <yol@odoo.com>
2022-10-03 18:20:00 +02:00
Younn Olivier c1afb4156a [FIX] web_editor, website: fix website edition with rtl languages
Before this commit, for the following flow:
- Add arabic language (or any other rtl language),
- On one of the websites, set it as the only website's language,
- Reload and go to the client action,
=> The frontend is correctly displayed in rtl,
- Click on edit,
=> The frontend, in the iframe, is reverted to ltr,

The WysiwygAdapter, introduced in [1], was not passing the correct
direction option to the OdooEditor, which would revert the editable to
the default 'ltr' direction.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

X-original-commit: 2f463ca65b149122c85a04b20b4f82e0be479fc8
Part-of: odoo/odoo#101972
2022-10-03 18:20:00 +02:00
Younn Olivier 4298837dbd [FIX] website: hide "Editor Menu" on translatable websites
Before this commit, the Editor Menu was confusing when opened for a
translatable website: it would list the menus in the user's language,
not in the displayed website's language.

First, this commit shows that menu only for websites in their default
language, as the user should edit his website structure in the default
language.
Secondly, the 'get_tree' and 'save' requests on the website menus are
done with the website's language, not the user's language.

This commit also fixes a bug introduced with [1]: the website override
of the start method of the SnippetsMenu was incorrectly done.
In translate mode, it should not activate snippets on clicks, otherwise,
the LinkPopover was instantiated when clicking on navbar menus, allowing
to edit the menus from the translate mode, and breaking it.

[1]: https://github.com/odoo/odoo/commit/df1869153a90898bad3e0b61e5fc43a9ed3d59c9

task-2687506

X-original-commit: 4266966a9b0fa452b5991d9bea0fe914aca85f4d
Part-of: odoo/odoo#101972
2022-10-03 18:19:59 +02:00
Denis Ledoux 60dc29e0df [FIX] hr_timesheet: _get_view dependent on company.timesheet_encode_uom_id
`hr_timesheet`, and other timesheet related modules,
overrides `_get_view` to change some timesheet time field label
from "Hours" to "Days" according if the company uses hours as
timesheet encoding UOM or days.

Since odoo/odoo#99417, and the fact back-end views are cached,
keys on which the model views depends on for the cache must be added
through an override of the method `_get_view_cache_key`.

Without this revision, if a database has
one company using hours as timesheet encoding uom,
and a second company using days as timesheet encoding uom,
the label for one of the two company could be wrong according
to which user/company accessed first the view,
for which company the view has been put in the cache first.

These overrides of `_get_view` should be replaced by another mechanism,
for instance by a Javascript widget,
as this mechanism doesn't really make sense when browsing
multiple companies at a time
(selecting multiple companies in the companies dropdown menu).
When going from one record to another with the left/right arrows,
the company can depend from one record to another,
and therefore the label should change from one record to another
according to its company, which is not the case with the current
implementation.
It could also be achieved by setting two different labels,
with an invisible attrs based on a related field
of company.timesheet_encode_uom_id.

However, as we are close to release, and 16.0 is already frozen,
no unstable changes should be done,
hence I restore the behavior which was there
before odoo/odoo#99417.

closes odoo/odoo#101964

X-original-commit: b2a9868b4a0db5a091a1faae38b7d4de29dfd2f4
Related: odoo/enterprise#32198
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-10-03 18:19:50 +02:00
csnauwaert 5c6640eb3d [FIX] account: add latest running balance when grouping by in statement list view
In the list view of bank statement, when we group by statement or date
or journal,  we would like to be able to see the latest running balance
in the groupby line.
That way we can easily see the "ending balance" of each statement which
is a huge help for the accountant

closes odoo/odoo#101812

X-original-commit: 002709b75cf3516a7cdc1c2412afa02f40043abf
Related: odoo/enterprise#32127
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
2022-10-03 18:19:45 +02:00
Yolann Sabaux bece0fb675 [FIX] project: filter stages based on the user_id
Steps to reproduce:
- have a project with a stage having the user_id set to Mitchell Admin (in this scenario you would have to add the field in the view)
- create a task in this stage
- log in with Marc Demo
- Try to open the project

Issue:
There will be an access error

Cause:
The domain allows to fetch all tasks from a project; even those from a prohibited stage

Solution:
- As in d4252825f5, we'll restrict the domain and "hide task stages if user is set".
- Prevent the user to create/modify a record to it with with a `user_id` and `project_ids`

opw-2917631

closes odoo/odoo#101965

X-original-commit: fdaef9276b89e2170128e205a4b7fd0b8defc2b1
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Xavier <xbo@odoo.com>
2022-10-03 17:18:31 +02:00
Michael (mcm) d1d9a5f2de [FIX] web: reload correct record after print
Before this commit, printing an invoice which is not
created yet reloaded the view with a new record.
Now, the view reloads with the current record.

closes odoo/odoo#101947

X-original-commit: 0bad6ae4185d9b25684d0c47c9cee7c098053707
Related: odoo/enterprise#32191
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-10-03 17:18:26 +02:00
Guillaume (gdi) aaa0aeb527 [FIX] web_editor: remove old values in the color picker widget previews
This [first commit] removes the addition and removal of classes on the
color picker preview. So far so good, then this [other commit] puts back
the class addition but forgets the removal so the preview of the color
picker widget kept the old values when they were `bg-*` which could lead
to a bad preview of the selected color. This commit fixes that by
removing the old values when a new value is set.
Steps to reproduce the bug fixed by this commit:
- Go to the website app
- Edit a page
- Drop a Picture block
- Change the background color of the block to bg-black for example
- Change again the background color of the block to a custom color

=> The preview of the custom color is not correct, it is still black.

[first commit]: https://github.com/odoo/odoo/commit/212a8bfdd21269b18054200b9e2585e1c95540d6
[other commit]: https://github.com/odoo/odoo/commit/a396f791da94d064d58cce15892e74f45d29b7b7

task-2904507

closes odoo/odoo#101828

X-original-commit: 6da33797798e6112e0dd74a4093f296b6e1b2466
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-03 17:18:23 +02:00
Benjamin Vray 80f174f57b [FIX] website: fix url picker editor dropdown
This commit fixes 2 issues with the position of the dropdown with the
suggested links in the url picker input of the snippet options. (e.g.
redirect url input of the countdown snippet) and the one for the input
of the link editor.

1- Before this commit the dropdown went over the input while editing the
url.

2- Before this commit the position of the dropdown (when above the
input) was a little too low if there were images in the dropdown. It was
because the images are loaded after the positioning of the dropdown and
no height was defined for these images.

task-2900529

closes odoo/odoo#101815

X-original-commit: 774a42ff18651a20b09a5e34222665216b19c8ec
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-03 17:18:21 +02:00
sofiagvaladze 39c14368a2 [FIX] hr: hide create_employee on create user form
Set the default value for create_employee to False.

When coming from employee form, hide the create_employee field.

task - 2990426

closes odoo/odoo#100661

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-03 17:18:18 +02:00
Sébastien Theys cb8583c16e [FIX] im_livechat: prevent crash with avatar of invalid operator
closes odoo/odoo#101948

X-original-commit: f6a01f9d69bd2115ad7e7c0dbb3ffb041fc9e67e
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-03 16:19:08 +02:00
Pierre Rousseau bd71c6ae76 [IMP] spreadsheet_dashboard: grid cursor
closes odoo/odoo#101946

X-original-commit: 26ab6164e92b4ab7149a85b74cbff127c35fb4a0
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-10-03 16:19:05 +02:00
Florian Charlier 8af6e04a76 [FIX] base: use higher res profile pictures
Purpose: Enhance the profile picture of
 * Mitchell Admin and Marc Demo as they
are now sometimes shown in larger sizes (as in appointment).
* Joel Willis, whose picture is used on his eLearning profile

Task-2992949

closes odoo/odoo#101945

X-original-commit: d0e1360e63efca56c06fad82780ab6a96fb6f0eb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-03 16:19:03 +02:00
Jinjiu Liu d0c828dde7 [FIX] website_sale: calculate the tax for no_variant product in cart
Reproduction:
1. Install eCommerce and accounting
2. Go to Accounting->Configuration->Taxes, add one sale tax 15%, and one
0%. Both taxes are included in the price.
3. Go to Configuration-> Fiscal Position, create a new one “test” which
applies the tax mapping from 15% sale tax to the 0%. Check “Detect
Automatically”, set country group as Europe
4. Go to Website->Orders->Customers, set the country of the portal user,
Joel Willis, as Luxembourg. In Sales&Purchase->Fiscal Information set
the fiscal position as “test”
5. Go to Website->Products->Product Variants, create a new one
“test_tax_prod” with price 110, and sale tax 15%, can be sold, can be
purchased and consumable.
6. Go to Website->Configuration->Attribute, create a new product
attribute “test” with Display Type as Ratio, Variant Creation Mode as
Never. Create a value “a” in its attribute values
7. Go to Website->Products->Products, find test_tax_prod, go to its
variant tab, set attribute as “test” with value “a”, publish this
product
8. Open an incognito tab, login as “portal” pwd: portal, search the
product “test_tax_prod”, set the price list as “public price list”, the
price is 95.65 on the page. Add it to the cart, the price is 110

Reason: When we update the order_line, we should update the price based
on the fiscal position for the no_variant products too. However, based
on the current workflow, the price is computed in method
_website_product_id_change before an order line is created. Thus for
no_variant products, the price is not updated.

Fix:  This issue is fixed in saas-15.3 by rewriting the workflow and
calculating the price through an on_change function here: https://github.com/odoo/odoo/blob/saas-15.3/addons/sale/models/sale_order_line.py#L588-L605

In v13, we don’t have this on_change method to compute the new price, so
a similar price update can be created in the cart update for
website_sale. This fix solution was created here: https://github.com/odoo/odoo/commit/ea259218196b2d9dc71beffea697025580c6d696
However, new price computation issues can happen when combining two
pricelists, here: https://github.com/odoo/odoo/commit/8d6a2ca0f3dcf8f8cf4679da2b3ce582b7826391

Thus the fix is eventually done in _website_product_id_change. Added a
new parameter to force checking the orderlines based on the domain. The
orderline is created but only can be searched based on the domain. This
ensures the price is computed correctly for pricelists and for tax.

Added fiscal position test for no variant product

opw-2856956

Fix by re-writing in saas-15.3: https://github.com/odoo/odoo/blob/saas-15.3/addons/sale/models/sale_order_line.py#L588-L605
First related fix: https://github.com/odoo/odoo/commit/ea259218196b2d9dc71beffea697025580c6d696
Second fix to patch for the first fix: https://github.com/odoo/odoo/commit/8d6a2ca0f3dcf8f8cf4679da2b3ce582b7826391

closes odoo/odoo#101939

X-original-commit: 0ecf2296a8595cf4fb1ba9c5fb7dee876de0a527
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Liu Jinjiu (jili) <jili@odoo.com>
2022-10-03 16:19:00 +02:00
Jorge Pinna Puissant ba8b09c2a1 [FIX] mail: missing a space between two user avatars
this commit, remove the margin 0px to add a space between multiple user
avatars.

closes odoo/odoo#101933

X-original-commit: 6512e002263c23cbdffdecf7ee4f031ad7ea4c55
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-10-03 16:18:57 +02:00
Simon Genin (ges) 76e7dbb532 [FIX] web: kanban groups t-foreach key is always unique
Currently, the keys passed through the t-foreach for looping over the
groups has a flaw. It comes from a method that works as below:
It checks the group has a value => provide a key as group_key_{value}
if not => group_key_{i} where i is the iteration index
But the {value} is acutally just an id of some model. So in some cases,
with low ids (empty DB, tests, ...), you can run into situations where
the keys are duplicates, making owl crash.

This comit fixes the function to make sure it has no duplicates.

closes odoo/odoo#101925

X-original-commit: aadb38e259c25cea69d54c3c62b21d8e747f9b87
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2022-10-03 16:18:55 +02:00
Louis Wicket (wil) d562840f69 [IMP] mail, *: refactor patch API to look like model definitions
Model patches are now defined using the `registerPatch` function. This
function takes an object as argument which keys match those of a model
definition.

Benefits:
+ More consistent shape between model definitions and patch definitions
+ No need to import one function to each type of patch
+ No need to repeat the model name for each type of patch
+ No need to import the original definition

Task-2998282.

* = calendar, crm, hr, im_livechat, note, rating, sms, snailmail,
    website_livechat, website_slides

closes odoo/odoo#101827

X-original-commit: 7d23491b44b7372209057ea2abc565a95710b316
Related: odoo/enterprise#32136
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-03 16:18:49 +02:00
Didier (did) a00d53d9ff [FIX] mail: reintroduce missing overflow on discuss sidebar
In https://github.com/odoo/odoo/commit/9cbbb0248110acb1f85c8721d8ce8ce459217341
the overflow auto for the o_Discuss_sidebar class is missing making the sidebar
impossible to scroll.
This PR reintroduce this overflow-auto.

task-3004063

closes odoo/odoo#101931

X-original-commit: ce4dccf6e314dbd688dda1757781dd43ad47a601
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Debondt Didier (did) <did@odoo.com>
2022-10-03 15:19:34 +02:00
Romeo Fragomeli 15494e434c [FIX] web: inputs should be below labels in xxs_form_view
A rule was missing from the copied legacy rules

Note:
`form-break-table` was not only applied for small screen but also for
other case like quick edit in Kanban.

Steps to reproduce:
* Open Project
* Select a project
* Click on the Create button => BUG

closes odoo/odoo#101930

X-original-commit: de78e8bcbbc02be9024a1dd08379306ae56b0a2a
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-03 15:19:32 +02:00
William Braeckman fb6e9a9ec0 [FIX] website_sale: fix crash when using unsplash in extra images
The way we request images for the product's extra images feature did not
work properly with the patch made by `web_unsplash` since we did not
call the super function.
It is now called properly making it work with unsplash as expected.

TaskId-3003948

closes odoo/odoo#101928

X-original-commit: da23f3ad52179c145cbf9a19db20ed6a46193f0d
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-03 15:19:29 +02:00
Kevin Baptiste 9950101b7b [FIX] lunch: show translated description
The records' description in the cashmove report was showing the raw json
data, now it's showing the English translation.

closes odoo/odoo#101927

X-original-commit: bcc9b5504f84729ccb5522742a2b6404c14be2d1
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-03 15:19:26 +02:00
Paolo (pgi) 7aa8ac004a [FIX] account: When filling gaps, create button has bad default journal
When using the "Holes in sequence" shortcut on a journal
in the Dashboard, the "Create" form shows the Miscellanous Entries
journal as a default instead of the same Journal that the user
trying to fix.

https://watch.screencastify.com/v/kUorLSIHwoy97UKuDJBC

closes odoo/odoo#101926

X-original-commit: a8f9950d6d55137f9c9de15042f6cb717e4a7140
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2022-10-03 15:19:24 +02:00
Horacio Tellez a7ddc7af78 [FIX] payment_stripe: validation operations treated incorrectly
When saving a payment method from the `my/payment_method` page
validation is used as the type of operation. In the present
validation operations were incorrectly filtered and treated as a
payment.
After this commit validation operations are processed in the
`_stripe_create_checkout_session` function as it should.

Task - 3001168

closes odoo/odoo#101923

X-original-commit: 7f371db1af160a5e89f9476540aee35f79769068
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-03 15:19:21 +02:00
Horacio Tellez e13088b62e [FIX] loyalty: amount conversion of rules without company
In the present when in a multi-company environment it is possible to create loyalty programs without a company associated to it. This cause a problem when computing conversion rates as conversion rates are associated to a company.
After this commit if no company is setted on the loyalty program then when computing the amout to deduce on the loyalty program we fallback to the env company (this is the same way the company is initially deduced on the loyalty program).

Task - 3001177

closes odoo/odoo#101922

Forward-port-of: odoo/odoo#101631
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-10-03 15:19:18 +02:00
Valentin Vallaeys (vava) 6fc58cd0c6 [IMP] payment: remove duplicate chatter message
The confirmation message for the sale order appeared twice in the
chatter: first with the confirmation and second with the posted payment.
The second message is now rephrased in order to avoid any confusion for
the user (no double payment).

task-2965158

closes odoo/odoo#101921

X-original-commit: c1faff69db2a66e249bfbc5ea77644da0957d401
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2022-10-03 15:19:16 +02:00
Arnold Moyaux 32f516fbd6 [IMP] stock: prepare quantity done to partialy create sml
Due to a last minute request we add this store to handle a difference
between the quantity done and the `stock.move.line` sum. The remaining
of the feature (mainly javascript) should arrive soon. We do it at this
time since the previous fixes also add a store attribute, and the user
on existing deployed server will only face once the issue.

closes odoo/odoo#101905

Task: 2960983
X-original-commit: 05a2e5b7b9af58eea931dd9d80c506186e4131a8
Related: odoo/enterprise#32172
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-10-03 15:19:02 +02:00
Triet Ngo a0e94b2e80 [IMP] mrp: convert mrp_should_consume to wowl
task-id 2885757

X-original-commit: fee7330e5f8a6d75a7fe90d178d715a873c7c5fd
Part-of: odoo/odoo#101905
2022-10-03 15:19:02 +02:00
Arnold Moyaux 709d3ca147 [REF] mrp: timer to wowl
X-original-commit: 816212516340bf66e16f3fc9915293ab18f8cf4c
Part-of: odoo/odoo#101905
2022-10-03 15:19:02 +02:00
mafo-odoo 20927c946b [FIX] pos_restaurant:save new split order on payment proceed
Steps to reproduce:
-Activate split order option
-Create an order with two products
-On the splitting bill screen select one product and click on
payment
-Don't validate the payment and click on back
-Refresh the page

Current behavior:
There is only one order with the unselected product

Expected behavior:
There is two orders with one product

Explanation:
When on the spliting page we remove product from the first order
to add them to a new one if they are selected but the new order is
not saved yet. We need to make the new order order on payment proceed
so that all new changes are saved.

opw-2989858

closes odoo/odoo#101903

X-original-commit: a43a9fa3178caa2a2a7d5b6dd6aff5de6409f285
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-10-03 15:18:58 +02:00
Denis Ledoux 99a9cce9ba [IMP] base, web: set can_create/can_write only on editable nodes
Setting the attributes `can_create` and `can_write` in views
which are not editable is useless as you cannot edit the record
in these views.

This allow to gain some KB when serving the view to the web client,
as well as making the view cleaner.

e.g. the graph view in the CRM > My Pipeline menu

Before:
```xml
<graph string="Opportunities" sample="1">
    <field name="stage_id" can_create="true" can_write="true"/>
    <field name="user_id" on_change="1" can_create="true" can_write="true"/>
    <field name="color" modifiers="{&quot;invisible&quot;: true}"/>
</graph>
```

After:
```xml
<graph string="Opportunities" sample="1">
    <field name="stage_id"/>
    <field name="user_id" on_change="1"/>
    <field name="color" modifiers="{&quot;invisible&quot;: true}"/>
</graph>
```

This revision takes the opportunity to port the `editable` concept
from the server to the web client MockServer,
in order to be able to test the removal of these attributes from the views
in the QUnit tests.

The `_editableNode` JS function added here is the translation of the
existing `def _editable_node` method in `addons/base/models/ir_ui_view.py`

https://github.com/odoo/odoo/blob/f5edde3624f4fe40f87cc7fed7dcfc4bbce1f19f/odoo/addons/base/models/ir_ui_view.py#L1282-L1301

closes odoo/odoo#101902

X-original-commit: f0beddf534a57e972ac3a7bef6afa1caae1dcff3
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-10-03 15:18:55 +02:00
Ernad Husremović 871c430c47 [FIX] base: Bosnian language settings
Uses the non-SI continental style (groups of 3 digits, comma decimal
separator, period group separator).

Closes #101723

closes odoo/odoo#101888

X-original-commit: 10b89303dfec2b668ad896ac36627741dddde708
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-10-03 15:18:52 +02:00
Ernad Husremović 12b135e03c [CLA] signature for hernad
X-original-commit: 7cf7d94cbc943d7a56377de44079d2d19bfb99cf
Part-of: odoo/odoo#101888
2022-10-03 15:18:52 +02:00
Nasreddin Boulif (bon) 0fc02b136b [FIX] sale_project: Allow user to cancel SO linked to project
Steps to reproduce:

- Go to Projects and find one having field "sale_line_id" set
  (example "AGR - S00048" with
  "S00048 - Senior Architect (Invoice on Timesheets)")
- Go to Sales -> Quotations and :
  1/ cancel
  2/ set in draft
  3/ edit Project to "AGR - SO00048"
  4/ confirm again (see attached)
- Alter Marc Demo access right to have:
  Sales -> Administrator
  Project -> User
- With Marc Demo, go to Sales -> Quotations and open S00048
- Try to cancel it

Issue:

  Access right error.

Cause:

  When canceling a SO, we remove the related SO line on the project
  however the current user have access to edit SO but not the project.

Solution:

  Use sudo().

opw-2959627

closes odoo/odoo#99736

X-original-commit: fab2bd4428dcfec26b644351951f0855ad98fcd9
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-10-03 15:18:46 +02:00
Nasreddin Boulif (bon) fa3e8d1b74 [FIX] sale_loyalty: allow cancel order with coupons of pos
Steps to reproduce:

  - Install POS Loyalty
  - Create a loyalty program with a coupon
  - Create an order with the coupon
  - Try to cancel the order

Issue:

  Access error raised because have no access to POS lines model.

Cause:

  During the cancel process, we are trying to get `use_count` of the
  coupon, that trigger compute func `_compute_use_count` that is also in
  pos_loyalty. This last one will try to find related POS lines while
  user have no access to POS.

Solution:

  Do sudo on coupons before filtering.

opw-2959627

X-original-commit: 503945600c15ab49700c7cf00cd61dedc554d4a4
Part-of: odoo/odoo#99736
2022-10-03 15:18:46 +02:00
Pierre Paridans 16ddf96e0f [IMP] web: cleanup notebook's styling in Form & Kanban examples
This commit removes unecessary overrides of the Notebook component
styling in the Form and Kanban columns examples.

Additionally, it also moves the most generic styles (like responsive)
into the Notebook component itself.

closes odoo/odoo#101868

X-original-commit: c1b9905b2e17ca0fda3aeb152c2927031d1662c4
Related: odoo/enterprise#32158
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-10-03 12:00:41 +02:00
Benoit Socias dc0ffd2015 [FIX] website: adapt cookies bar buttons to match security concerns
The cookies bar default templates are designed in order to guide the
user towards selecting the option that will provide the best user
experience.
This raises security concerns (see discussion in PR for details).

This commit adapts the buttons of the default cookies bar templates so
that both options are shown with the same style, forcing the user to
take a decision.

task-2800976

closes odoo/odoo#101845

X-original-commit: 32d88f47a67679b7e90fa58e25089846484b48ca
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-03 10:56:59 +02:00
Jeremy KerstenandBenoit Socias 878351d840 [IMP] base, web, website, *: differentiate essential & optional cookies
*: im_livechat, survey, utm, website_crm_iap_reveal, website_forum,
   website_livechat, website_sale, website_sale_comparison

Before this commit all cookies were considered essential.

This commit makes some of them optional. It also makes it possible for
the website visitor to only accept the essential cookies.

task-2800976

X-original-commit: 9a8a9463289a7446e9be0ef62ff895feb37a4de4
Part-of: odoo/odoo#101845
Co-authored-by: Benoit Socias <bso@odoo.com>
2022-10-03 10:56:58 +02:00
Florian Vranckx 6a9b612a1d [FIX] web: tagline rendering box repport pdf vs preview
Steps to reproduce:
	- Go into settings > Configure Document Layout
	- Choose layout boxed
	- set a company tagline
	- click "download PDF Preview"
Issue:
	The styling of the company tagline is not the same on the pdf and
	the preview
Cause:
	Module lxml from etree would not interpret the html the same way as
	the browser. In the browser, we would have a 'p' markup inside of the
	'h4' for the title. Effectively applying the style from the css
	sheet. In the pdf, the lxlm module place the 'p' markup after the
	'h4'. Therefore it would not receive the styling of the 'h4'.
	Reproduction:
```
	>>> from lxml import html
	>>> html.tostring(html.fromstring('<div><h4><p>hi</h4></div>'))
	b'<div><h4></h4><p>hi</p></div>'
```
Solution:
	Modify the structure so we have a `<div class="h4"/>` element that does
	not have this issue. In version before 16.0, a CSS hack was used
	to keelp the structure the same.

opw-2846247

closes odoo/odoo#101666

X-original-commit: 5aaf60809f596f4ec3ae9c3bc4795b3044da0281
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2022-10-03 10:56:55 +02:00
JF Aubert 5cd16398a7 [FIX] stock: fix inventory report
This commit addresses a screen refresh problem.

closes odoo/odoo#99123

Task: 2961768
X-original-commit: e78849c156dd2e199d29c1a388d25c7d481096b5
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-10-03 10:56:50 +02:00
Younn Olivier bd443138d2 [FIX] web_editor, web_unsplash: fix media dialog search
This commit fixes three issues regarding the top left search input of the
Media Dialog.

First, following this flow from the website builder:
- Start the Media Dialog with no images,
=> A visual indication to guide you to use the search input is there
- Type a search query in the top left search input,
- Erase completely the search query,
=> The visual indication is not displayed again.
When [1] reworked the Media Dialog with components, it wrongly
defined the ImageSelector web_unsplash patch to load unsplash images: if
there was no query string, the state.isFetchingUnsplash variable was set
to true and never to false, therefore the component was acting as if
there was still some fetching in progress.

Secondly, pressing 'enter' when the input was focused would trigger a
reload of the window. This was due to an obscure html spec described in
[2]: "When there is only one single-line text input field in a form, the
user agent should accept Enter in that field as a request to submit the
form."
When [3] reworked the design of the Media Dialog, it added a t-if on the
second "url" input, making the form with a single input.
This commit fixes this wrong behaviour by using div elements instead of
forms.

Lastly, [3] also removed the position-fixed on the loading images,
which was preventing to modify the container height before resizing
them. This led to visual glitches before seeing the resized images. This
commit adds back this class to prevent that visual glitch.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://www.w3.org/MarkUp/html-spec/html-spec_8.html#SEC8.2
[3]: https://github.com/odoo/odoo/commit/ff0b2d441252560a076a3609d81c369f0ce42d19

task-2687506

closes odoo/odoo#101788

X-original-commit: 8ce4036364de2d65921962357b11d905ca3676e0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Younn Olivier (yol) <yol@odoo.com>
2022-10-03 09:57:16 +02:00
mafo-odoo 8e65a39c82 [FIX] event_sale event_booth_sale: add no event to the so template
Steps to reproduce:
- Add an event product to the template order
- Create an so
- Select the template order you just created

Expected behavior:
you get a popup to configure the event

Current behavior:
There is no popup and the product event is not
fully configured

opw-2971168

closes odoo/odoo#101456

X-original-commit: 33062d9561e9cb4a680dfc36e0c8931a0647e5e8
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
2022-10-03 09:57:05 +02:00
Adrien Widart 8cdcc933ca [IMP] barcodes{,_gs1_nomenclature}: interpret GS character
Let's say the company use a GS1 nomenclature and a user scans such a
barcode:
`(01)11111111111113(10)xyz(30)40`
It means a product P:
- that has the barcode value '11111111111113'
- for the lot 'xyz'
- with a quantity equal to 40

The GS1 nomenclature explains that a lot consists of a prefix `10` and
of up to 20 alphanumeric characters. In the above example, we could
believe that the lot is actually `xyz3040`. To prevent this kind of
issue, the GS1 standards use a special character: the Group Separator
(its hex value is `\x1d` and does not have any visual representation).
So, when reading the barcode of the above value, the barcode reader will
detect the GS between `z` and `3` (so we know that this is the end of
the lot name).

Because GS has no visual representation, the way the GS character is
given by the scanner to the device depends on the scanner itself. For
instance, some barcode readers try to encode GS thanks to its unicode
input (as used on a Windows device): it enters Alt+0+2+9 (i.e., the
unicode value of GS). This is an issue since we filter out all keydown
events with the `Alt` key pressed.

Also, our way to interpret the barcode value depends on the device: on a
desktop device, we listen the events. As explained above, this could be
an issue (for instance with Alt+029). On a mobile device, we let the
barcode reader write in an hidden input and we then extract the written
value. There is also an issue here: the GS is not present in the
extracted string.

For these reasons, some changes are need. The idea is to let the user
lists the ways his barcode readers will encode the GS character (the
scanners often give the possibility to set a value manually.). There is
already a field for this:
https://github.com/odoo/odoo/blob/320025ee630acadd4a5cbd32f425cddee4f81c1e/addons/barcodes_gs1_nomenclature/models/barcode_nomenclature.py#L18-L20

However, this is not correctly working. Suppose we now stop to filter
out the `Alt` keys: in the above example, the scanned value becomes
`011111111111111310xyzAlt0293040`(as you can see, there is an `Alt029`
at the end of the lot). Suppose also that we defined
`gs1_separator_fnc1` with `Alt029`. When parsing the barcode value, we
have:
https://github.com/odoo/odoo/blob/1c0dec6d5813fa81a0fec8668ee13d8036cde5c5/addons/barcodes_gs1_nomenclature/static/src/js/barcode_parser.js#L91-L98
So, when we try to extract the lot name, the values will be:
- barcode: `10xyzAlt0293040`
- regex: `^(10)([!\"%-/0-9:-?A-Z_a-z]{0,20})(?:(Alt029))?`

And here is the issue: `Alt029` will be caught by the second capturing
group of the regex (instead of the third one), so it will be considered
as part of the lot name, we still have an issue => considering the
`Alt`/`Control` keys and defining some values in `gs1_separator_fnc1`
are not enough, we need to parse twice:
- The first parsing is used to convert all occurrences of
`gs1_separator_fnc1` into the hex `\x1d`. Then, it is also used to
remove all useless `Alt`/`Control`/`Shift`.
- The second parsing is the already-existing one and this parser is
already able to catch all `\x1d` as group separators:
https://github.com/odoo/odoo/blob/1c0dec6d5813fa81a0fec8668ee13d8036cde5c5/addons/barcodes_gs1_nomenclature/static/src/js/barcode_parser.js#L90

For the mobile device, it means that the users will have to define a
special character that stands for GS (e.g., `#`), so we will retrieve it
in the input.

OPW-2930873

closes odoo/odoo#99730

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-10-03 09:57:02 +02:00
Sébastien Theys 0612f6c080 [FIX] mail: move activity mark done inside popover and clean overflow
Part of task-2998139

closes odoo/odoo#101834

X-original-commit: 5900068e1de250284c11ee14b3642ba3d31d2583
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-10-03 09:00:02 +02:00