Commit Graph
156874 Commits
Author SHA1 Message Date
FrancoisGe c82cb3b5cd [IMP] base: add widget in tree view rng validation
Before this commit, it was possible to define a <widget/> in the arch of
an x2many in list mode. But this was not supported in normal list views.

So in order to unify the api, we decided to support in the list
view as well.

In a future commit, we plan to improve the widget api to receive only
the necessary props.

closes odoo/odoo#107811

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-13 13:51:48 +01:00
Laurent Smet 990cce2b1b [FIX] point_of_sale: Fix account_bank_statement access rule
The field pos_session_id has been moved from account.bank.statement to account.bank.statement.line. See:
https://github.com/odoo/odoo/commit/7e23eda02fc00b4e4a85e3a71b14fb1081441a04

closes odoo/odoo#107744

X-original-commit: 9e7174475d3da0d238f105ca0603f1a0539ef1b1
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2022-12-13 13:51:40 +01:00
PoMa fda341dc62 [FIX] account,account_accountant: Journal items in kanban not visible
Journal Items menu was not visible out of debug mode, now it is visible

 Closes PR #105704

closes odoo/odoo#107668

X-original-commit: fbedc97a5479bace8b23122fc423abdeb2c1757a
Related: odoo/enterprise#34876
Signed-off-by: Laurent Smet <las@odoo.com>
2022-12-13 13:51:35 +01:00
PoMa 5883317ed4 [FIX] account,account_accountant: bank/cash related links
Before:
In the kanban card of Bank/Cash journals
 - Clicking the title of the journal opened recon widget (kanban) now it opens BSL list
 - Clicking on operations opened recon widget (kanban) now it opens BSL list
 - Journal Items view was opening recon widget (kanban) now it opens Journal Items
 In bank transactions tree view:
 - `Match` button was always visible, now it is visible if line is not matched, otherwise it renames to `View`

 Closes PR #105704

X-original-commit: 178991eafdadfd955a7aa68bdecf94a39ec8e2fe
Part-of: odoo/odoo#107668
2022-12-13 13:51:35 +01:00
niyasraphy b039c16bb3 [FIX] l10n_ma: fix module name
update the module name of l10n_ma. Morocco is the real country name and currently upon searching with country name, app is not listed.

closes odoo/odoo#107650

X-original-commit: f6438dbca6782401f1b23497271398210b113df4
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-12-13 13:51:29 +01:00
Bastien Fafchamps (bafa) 357cd41085 [IMP] Web: SearchPanel, display an empty state when there is no record
Purpose:
When a list view with searchpanel is empty, the searchpanel is completely
empty and white, and it's unclear what it's for. Make it obvious by
displaying an empty state. This will typically happen in some views when
you have no data or don't have the groups needed to show filters.

Spec:
Display the following paragraphs with the bs classes "small" and "text-muted":
"No quick filter available."
"Update the filters in the search bar to display more records."
"Quick filters will become available if the records shown can be filtered."

closes odoo/odoo#107379

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-13 13:51:26 +01:00
Julien Van Roy 463df2506c [IMP] account_edi_ubl_cii: add support for A-NZ Peppol BIS3
Add edi_format "A-NZ BIS Billing 3.0" used in Australia and New-Zealand.
This format is derived from Peppol BIS Billing 3.0.

task-2994014

closes odoo/odoo#103056

Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-12-13 13:51:21 +01:00
lejeune quentin d3ccbe292f [FIX] hw_drivers: In IoT adapt path to filename
From the commit 2ab231bd7af609a751ed8168cc094dfeb1012eda
We introduce a error in the path to read Linux file

In this commit we correct the access to the file
which is in the "home" of the raspberry

closes odoo/odoo#107779

X-original-commit: e427d0a2147896aa4311488ebc13f45b84cb330c
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2022-12-13 12:47:51 +01:00
Matthew Harrison 36191e971a [FIX] payment_paypal: correct dead link
closes odoo/odoo#107703

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-12-13 12:47:49 +01:00
Denis Ledoux 3752b3166e [REF] base: set USD as default currency for the main company
There are three rationales behind this change to set USD as default
currency and to enable it in the demo data, from the beginning.
With a demo database, before this revision:
1. On runbot, with all modules installed, it's already USD the default
   company currency. It's only when you install a module not depending
   on account that it's EUR the company currency by default (e.g. CRM)
2. in the base demo data,
   the company is set in the United States but with the currency EUR,
3. before installing account, the company currency is EUR,
   after installing account, the company currency is USD,
   this is due to the fact as the company is in the United States,
   the US Chart Of Account is installed, switching the company currency
   to USD.
4. when you install a demo database with a module not depending on
   account, you are left with a database without any active currency,
   and the monetary fields therefore do not show any currency.
   For instance, install only CRM with demo,
   you have no currency symbol before or after the expected revenue,
   which is not the best user friendly experience.
   On runbot you do not feel it because all modules are installed,
   therefore with account installed, which activated the USD currency.

Additional weird thing with point 2.:
- Unit tests in modules not dependent on account with the
  post-install tag had to handle this sudden change of currency change
  before and after installing account.
  For instance, when running their unit tests with only their module,
  but not account, the company currency is EUR,
  but when executing the same unit test with all modules installed,
  the company currency is USD.
  The unit tests had to handle this sudden change within the unit test,
  for instance by setting a 1.0 rate for their own company currency,
  which shouldn't be the case: the rate of your own currency should
  always be 1.0.

closes odoo/odoo#107113

Related: odoo/enterprise#34613
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-12-13 11:47:49 +01:00
Walid HANNICHE (waha) 96753cc371 [FIX] l10n_gcc_invoice: arabic invoice product name is displayed twice
Steps to reproduce:
-install l10n_sa_invoice module
-switch to a company in Saudi Arabia (SA company)
-create and print an invoice with a product that has arabic translation

Bug:
When adding a product and the Arabic translation.
If we add an internal reference it is added to the template,
Odoo directly concatenates this with the product name.
The result is the product name being duplicated.

Fix:
display line name and add the translation if it's different

opw-2829934

closes odoo/odoo#107798

X-original-commit: ad585bc41f49d047c150ceb9dc88bd9859fa046b
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2022-12-13 10:05:17 +01:00
Ivan Yelizariev a73cb1ca95 [FIX] website_sale: add noFuzzy when it's active
`website_sale` module has custom handler for form submit event. That handler
ignores `noFuzzy` attribute. As result, adding `data-no-fuzzy="1"` to
`input[name=search]` works everywhere, but not on shop product list pages.

STEPS:

1. Settings > Technical > Views > website_search_box_input & website_search_box > Code in data-no-fuzzy="1" into the <input> tag
2. Go to Website >.Shop > Customize > Enable ecommerce categories
3. Search for a product on the main shopping page and enter > Observe the URL > There is no noFuzzy param
4. Go to any product's page on the website > search for a product through the search bar and enter > Observe the URL > there is a noFuzzy param passed

opw-3051319

closes odoo/odoo#107771

X-original-commit: 1df3b14f86bada2e2cf278d2b4e591996e9e8db8
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-12-13 10:05:12 +01:00
Maruan Aguerdouh (magm) fd62ef58b8 [FIX] purchase: no request for quotation views won't overlap dropdown
Steps to reproduce:

- Go to Request for quotation.
- Make any search that retrieves no values. (So we get the "no request
for quotation found." message)
- Open Filters dropdown menu. (or Any menu which lenghts will be over
this message)

Issue:

The dropdown menu will be under the message, the message is overlaping
the dropdown menu when it shouldn't be.

Solution:

We need to set the message to `position: relative` instead of
`position: static` so we take into account the right z-index for the
message.

opw-3080171

closes odoo/odoo#107409

X-original-commit: 47a6a555c5bcedffdfda7586ecbe4311d2a45e5f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2022-12-13 10:05:09 +01:00
Valentin Vallaeys (vava) 6a0a9f8b3e [IMP] sale: color consistency for sale order status
Before this commit, the color badge for draft and sent quotations had
the same color. Same as the line color in list view.

After this commit, color badges and lines are different between draft
and sent quotations.

task-3010707

closes odoo/odoo#106843

Related: odoo/enterprise#34188
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-12-13 10:05:06 +01:00
Guillaume (gdi) 7bfdea4214 [FIX] website: scroll correctly when the url contains an anchor
When the url redirects to an anchor on a website page, the page must
scroll correctly to the section. This commit allows to do that by taking
into account the size of the navbar. The bug is visible by following
those steps:
- Drop a text - image block on a page
- Drop a picture block under text - image block
- Create a link to target the picture block
- Put link to block picture in the "Learn more" button
- Save
- Right click on the "Learn more" button and open link in a new tab

=> The page is not scrolled correctly to the picture block.
Note that the bug is not present if the header has scroll, disappear or
fade out as scroll effect.

task-2818629

closes odoo/odoo#92777

Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2022-12-13 10:05:00 +01:00
Solan Delvenne (sode) c8b9e70ced [FIX] snailmail: fix follow-up reports layout for snailmails
Follow-up reports were previously not handled by the commit fixing
invoices. This commit aims to fix that.

closes odoo/odoo#107787

X-original-commit: 768cfbe095cd6757771dcc683637fd510b0fbddb
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-12-12 20:39:47 +01:00
Guillaume (guva) e858ce0d86 [FIX] account: card color kanban view
The kanban cards did not take the class
oe_kanban_color.
This is because it was set on the child div
instead of the parent one.

opw-3069024

closes odoo/odoo#107778

X-original-commit: 9078761d10289446cfd3881e9df9061075441440
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2022-12-12 19:18:34 +01:00
Ivan Yelizariev b6b6ce357f [FIX] product: fix pricelist based on product categories
STEPS: Create a Pricelist with price rule discount-based on parent product
category. Result: the price rule discount is not applied if the product is not
directly attached to a parent category.

Fix it by correcting domain in `_get_applicable_rules_domain`.

Also, update tests: use parent category in the pricelist.

https://github.com/odoo/odoo/commit/dc8db07ba718a2de845455efc6e265213537eedf
opw-3080836

closes odoo/odoo#107769

X-original-commit: ce44c045f6b75fa64962625baad322632a9c2979
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-12 18:16:20 +01:00
Kevin Baptiste bbeec32ed8 [IMP] hr_fleet: remove partners from demo data
The demo data were assigning random res.partner as home_address_id for
some employees, this is no longer required since #98027.

closes odoo/odoo#107767

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-12 18:16:17 +01:00
Ayman Adil 6a3444e5bd [FIX] convert.py: skip the creation of a forcecreate=0 record when a reference is missing
When a record is `forcecreate=0` and a reference of one of its fields is missing, the update of the corresponding module fails. In this case, we can skip the creation of this record.

An example of this issue is this [record](https://github.com/odoo/enterprise/blob/6411ae071ace980834befeb8040c94b1a05c8034/documents_account/data/data.xml#L17) in `documents_account` module (enterprise) when the reference of this [field](https://github.com/odoo/enterprise/blob/6411ae071ace980834befeb8040c94b1a05c8034/documents_account/data/data.xml#L20) is missing.

This can be reproduced as follows:
1. Create a DB with `documents_account` module
2. Uninstall `documents_account` module
3. Remove `documents.documents_finance_status`
4. Reinstall `documents_account`

```
Traceback (most recent call last):
  File "/home/ayman/src/odoo/15.0/odoo/tools/convert.py", line 680, in _tag_root
    f(rec)
  File "/home/ayman/src/odoo/15.0/odoo/tools/convert.py", line 567, in _tag_record
    f_val = self.id_get(f_ref)
  File "/home/ayman/src/odoo/15.0/odoo/tools/convert.py", line 663, in id_get
    res = self.model_id_get(id_str, raise_if_not_found)
  File "/home/ayman/src/odoo/15.0/odoo/tools/convert.py", line 669, in model_id_get
    return self.env['ir.model.data']._xmlid_to_res_model_res_id(id_str, raise_if_not_found=raise_if_not_found)
  File "/home/ayman/src/odoo/15.0/odoo/addons/base/models/ir_model.py", line 1943, in _xmlid_to_res_model_res_id
    return self._xmlid_lookup(xmlid)[1:3]
  File "<decorator-gen-35>", line 2, in _xmlid_lookup
  File "/home/ayman/src/odoo/15.0/odoo/tools/cache.py", line 90, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/home/ayman/src/odoo/15.0/odoo/addons/base/models/ir_model.py", line 1936, in _xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
ValueError: External ID not found in the system: documents.documents_finance_status
```

closes odoo/odoo#107766

X-original-commit: 2e4f0667397d2d6670df50b9088fa9c23f1f9f5a
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-12-12 18:16:15 +01:00
niyasraphy 7e01b79b9e [FIX] base: ir.profile qweb field alignment
closes odoo/odoo#107745

X-original-commit: c2c1b9db1c09ab22f0d0a5b70f55696694046986
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-12 18:16:12 +01:00
Lucas Perais 47f5e62288 [FIX] web: sample server grouped by a date range
Have a kanban view by default grouped by a date field, with a granularity
eg: "date:month".

Have no data so that the read group returns with only the groups for the range (fill temporal).
Those groups should have a count of zero, triggering the sample server to make up data.

Before this commit, there were multiple crashes basically because the groupby written
as field:granularity was not handled at least in the case were groups are returned by the server.
That is, from the sample server perspective, groups are reused and records are just made up
matching those groups.
There were two issues in fact:
- the groupBy with granularity (eg: date:month) was not properly handled, sometimes not splitting
the field name and the granularity, sometimes splitting those up where it should not.
- since the RelationalModel's groups are re-used verbatim by the sample server
(which still needs to return what the real web_read_group would), the "__range" data was missing,
since it had been transformed by the RelationalModel after the real call to web_read_group to the server.

After this commit, this use case is supported.

opw-3063067

closes odoo/odoo#107529

X-original-commit: 060b237f3caac5241130915b41a34aab7d28f4cb
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-12-12 18:16:07 +01:00
clesgow b159190c7e [IMP] stock: display right number of labels in a ready pickings
When printing labels in a `ready` picking, if no quantities are set it
will only print the reserved quantities as labels.
Then, if a product has no reserved quantity, it will not have any
move_lines. Which means its initial demand won't be able to be fetched,
and the default behavior will be used, which is to print a single label.

By giving the moves instead of the move_lines to the wizard, we allow to
fetch for moves that have no reservation and print labels correctly
using their initial demand if no reservation is found.

The standard behavior once quantities are set remains untouched.

closes odoo/odoo#106414

Related: odoo/upgrade#4091
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-12 18:16:04 +01:00
Romain Derie c18d94f0c4 [FIX] website_sale: don't use real user as website public user
Commit [1] introduced the creation of a website in the tests, but
wrongly set `user_id` to the current environment user.
It doesn't make any sense as this field is supposed to hold the website
public user, which is not a real user and is supposed to be a public
user, as the field name hints..
On top of that, the current environment user (the demo user for tests,
which is wrongly set as the website public user) is then used to login
into the website, which is then making things even more weird/wrong: you
are not supposed to login with the public user (which is not really a
public user here but still marked as the public user from the website).

It was preventing the fix from this same PR (see previous commit) to be
working, as it was making this tour crash.

Not setting the `user_id` property will simply let the system create one
for you (a real public user..).

[1]: https://github.com/odoo/odoo/commit/3611aaf0983b3d25822022ebeddd781f6d082bf7

closes odoo/odoo#107759

X-original-commit: 68fc99cf944090a37ee2d392990f39adb4899076
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-12-12 17:17:09 +01:00
Romain Derie 7edde2b5a5 [FIX] website: prevent loop if auth=user route used as homepage url
One can very well select a "auth=user route" as homepage for his
website, like /my.

There would then be an issue with such an URL being set as homepage:
- As the user landed in the homepage controller which is auth=public,
  the system will add the public user as env user (see
  `_auth_method_public()`).
```
@http.route('/', type='http', auth="public", website=True, sitemap=True)
def index(self, **kw):
```
- Then, that controller will reroute to the homepage url (/my). The
  request.httprequest.path will now be /my
- Then, that controller will recall the dispatcher stack:
  `request._serve_ir_http()`
- From there, this call won't fail as it should because the user is
  considered as logged in as it went already through the
  `_auth_method_public()`, adding the public user as env.user.
  `_auth_method_user()` won't raise its error.
- The /my page will be rendered despite not being logged in.

Once the user land on that page, the system will actually detect him as
logged out on a page supposed to be accessed when logged in.
It will then:
1. Show a toaster to inform the user
2. Auto reload the page
As the current URL is still `/` (due to the reroute and not a redirect),
the same flow will happen again, and again, looping forever.

--------

Note that accessing /my directly won't be an issue, as it won't go
through the homepage controller (which is auth=public), so there won't
be a user_id set on the env (the public user), meaning that the dispatch
layer will reject the access and raise an access error (through
`_auth_method_user()`.
Also note that the same behavior will occur when going through the first
menu fallback mechanism:
- if the user didn't setup any homepage_url
- and deleted his / website.page
- and his first website menu is /my
In that case, it will go through the first menu redirect fallback, which
will be working fine (as it's a redirect and not a reroute).
With both those 2 flows (going through redirect), the user will
correctly land on the login page (which will redirect to /my once logged
in).

------

Finally, the other solution would be to prevent such a configuration
(/my as homepage_url) but it was not easily doable (if doable at all),
see https://github.com/odoo/odoo/pull/99100#discussion_r963055251

------

A test is also added and over the more complexe case (which should cover
everything):
- With /my as homepage_url
- With the / website.page deleted
- With /my as first menu URL
-> Accessing / as public user should:
   1. Reroute to /my (because of the homepage_url set to it) which
      should fail now thanks to this commit
   2. Since the reroute / re-serve failed, it should reach the
      "first menu fallback" mechanism, which is also /my
   3. That fallback should be a redirect, not a reroute, so the user
      should actually land on the login page
   4. Once logged in on that page, it should properly redirect to /my

opw-3077339

X-original-commit: 4f5899f769266edc27a0b2d812df092b95f43c71
Part-of: odoo/odoo#107759
2022-12-12 17:17:09 +01:00
Romain Derie 4dc960da8d [FIX] website: authorize again the trailing slash in SEO name field
Commit [1] improved the "sanitation" of this field for special
character. For instance, when copy pasting the following terms:

|      Input      |      Before      |       After     |
|-----------------|------------------|-----------------|
| fée d'été à 40€ |    f-e-d-t-40-   |  fee-dete-a-40  |
| Nội dung có Dấu |  n-i-dung-c-d-u  | noi-dung-co-dau |

But it actually came with a bad behavior which was not noticed: it
prevents to type `-` at the end of the input, which sounds good but is
not.
Indeed, when typing `a-word`, you will type `a` then try to type `-`
which won't work as considering a (forbidden) trailing slash, even if
you actually want to type something after.

This commit allows trailing slashes again, it's not a big deal and one
can remove it if he wants to.

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

opw-3075419

closes odoo/odoo#107746

X-original-commit: bb43e343c0ec823dad8b102a81945b4a05a7af85
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-12-12 16:16:43 +01:00
niyasraphy 8ae9212b15 [FIX] purchase_requisition: show button without clicking save button
install purchase_requisition module, and create an RFQ in db, check the alternatives tab in the notebook, currently the button Create Alternatives will not be visible unless user click the save button manually. button no longer needs to be hidden when creating a new PO since v16 added in the auto-save feature

closes odoo/odoo#107733

X-original-commit: a6a830e89c724f993b930442573d8d0c4e692b07
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-12-12 15:17:23 +01:00
luvi 929874e633 [IMP] web: add Unselect all button in ListController
This commit adds a new Unselect all button displayed when at least two
records are selected in a list view. This button appears near other list
buttons. Once clicked, the selected items are deselected and the button
disappears.

Some list view tests have been modified since that change now adds a
button in cases where it was not expected before. Those tests now verify
the behavior when the button is clicked.

task-3081101

closes odoo/odoo#107294

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-12 15:17:15 +01:00
Mathieu (mano) 50568f4467 [FIX] web: updating community icons
The icons of the enterprise applications in the community apps list are
not updated with the new icons.

This commit update the old icons with the new ones from the enterprise
version.

Note: some of the app in the apps list should be deleted as they're
not in the enterprise version anymore:

- Android & Iphone (using same icon as CRM)
- MRP II
- Website Version
- Website Form

task-3062514

[FIX] web: updating community icons

closes odoo/odoo#106587

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-12 15:17:12 +01:00
Kevin Baptiste d20940cfd8 [IMP] hr: add Department org chart
Add an organisation chart on the Department form view.

task-3071039

closes odoo/odoo#106005

Related: odoo/enterprise#34184
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-12 15:17:09 +01:00
Jinjiu Liu dea1e8b68a [FIX] sale_stock: remove redundant css class for correct pdf rendering
Reproduction:
1. Install Sales, Stock
2. Place an order with any product, in the Other Info tab, type in
anything for Customer Reference
3. Confirm the Order, Go to Delivery, Validate the delivery
4. Print the Delivery Slip, and the customer reference part is
overlapping with other text

Reason: the unnecessary CSS attribute <row> is causing an overlapping
when rendering the delivery template

Fix: remove <row> and reformatting the code

A correct example of adding extra info (done without row): https://github.com/odoo-dev/odoo/blob/16.0/addons/delivery/views/report_deliveryslip.xml#L4-L17

closes odoo/odoo#107726

X-original-commit: 863a9cf159da9691744f08a915e12f477342dbc3
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Liu Jinjiu (jili) <jili@odoo.com>
2022-12-12 14:18:39 +01:00
niyasraphy f13c24a1c1 [FIX] payment_authorize: correct the documentation link
currently on clicking the given link return 404 response.

closes odoo/odoo#107722

X-original-commit: 9fe68d2510f4ee4fd05facc64783a32a16d09e9e
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-12 13:19:15 +01:00
Mathieu Duckerts-Antoine 050f258bca [IMP] web: search bar: name_search context
The keys from the action context were not available in the context of
a name_search done when a user expand a one2many field in the search
bar. We add them.

closes odoo/odoo#107660

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-12 13:19:10 +01:00
Victor Feyens 798bf138c6 [FIX] sale_management: reload page on option add
Partial revert of 0beebad

Since the aforementioned commit, if a client updated its order on the portal:
* adding optional products
* removing optional products
* updating optional line quantities
and paid directly after, without reloading the page, the amount he paid
was the amount of the SO when the page was loaded.

Avoiding the reload and only modifying some DOM parts was a bad idea to begin
with.

We'll consider developing a correct and clean way to (re)render the payment part
of the DOM, or use separate pages for orders modifications and effective payment
checkout.

closes odoo/odoo#107569

X-original-commit: 81a9080eb375c31a7766189bb61e1bd8d99d855a
Related: odoo/enterprise#34837
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-12 13:19:05 +01:00
Lucas Lefèvre e6990ed2b8 [FIX] spreadsheet_dashboard: remove currency formats
Some of the dashboard files were using currency formats, which are
hardcoded with a given currency.

Because of that, some amounts are displayed with a $ sign, even if
the amount is in €, according to the record's currency.

It should use the automatic currency formatting of LIST functions
to use the record's currency.

This commits removes the hardcoded currency formats.
Note that the automatic format displays the decimal values while
the hardcoded format did not.
This is a functional change.

opw 3071160
opw 3058192

closes odoo/odoo#107557

X-original-commit: 54c99ede032775b9699ae85f3112de427c4b12b5
Related: odoo/enterprise#34834
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2022-12-12 13:18:59 +01:00
Rémi Rahir ad5b06d316 [FIX] spreadsheet: prevent the selection of an offset without a field
Currently, a user could create a date filter without selecting a field
for a datasource but still select an offset. Notwithstanding the
traceback that ensues, this does not make sense from a a functional POV.

This commit adds a command check to prevent the creation/update of
filters with such payload.

How to reproduce:

From a sheet with a pivot:
- create a date filter
- do not set field
- set offset to any (non null) value
- Save the filter
=> trackback

Task 3002282

closes odoo/odoo#107485

X-original-commit: 0412186a675960a8f4a83398cf95c628203aa3fa
Related: odoo/enterprise#34799
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-12 13:18:57 +01:00
Rémi Rahir e2444be867 [FIX] spreadsheet: need more tolerance on filter command payload
task 3002282

X-original-commit: 3019e24e7abb72af8e16e145a10e3165ebe2bfe4
Part-of: odoo/odoo#107485
2022-12-12 13:18:57 +01:00
Pierre-Yves Dufays 8bf004831f [IMP] crm: add index on phone and mobile fields
This index allows to improve performances of learch searching based on phone
and mobile fields. We currently use those fields are phone_sanitized is
based on both fields, which could lead to information loss and/not not
accurate results, notably when used to find duplicates.

Task-3007714

closes odoo/odoo#105873

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-12 13:18:46 +01:00
Pierre-Yves Dufays 33d23cc246 [IMP] crm: improve lead searching and duplicate detection
Accelerate duplicate lead detection by adding indexes on field involved in the
search.

In this commit we add trigram indexes on email_normalized, partner_name and
contact_name that are used a lot for searching and finding leads.

Task-3007714

Part-of: odoo/odoo#105873
2022-12-12 13:18:46 +01:00
Alexandre de Pape (alpa) 181eabbe58 [IMP] website_sale_product_configurator: add to cart animation
This commit adds an animation when clicking on `Continue Shopping` on the product configurator modal.

closes odoo/odoo#100582

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-12-12 13:18:35 +01:00
Kshitij Nariya d242a07397 [FIX] base: fix website menu to backend when a root doesn't have a xid
When website resolves its menu to the backend, it calls
`load_menus_root`. Unlike `load_menus`, that does not nicely handle
missing menuitems, so *if* one of the root menus was created manually
(hence doesn't have a xid) the website will crash either immediately
or when trying to open the backend menu (depending on version).

Fix by adding a similar fallback to that of `load_menus`.

closes odoo/odoo#107580

X-original-commit: 3a682650cfc96bae0ce4f44a041713a8174a02fc
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2022-12-12 12:18:46 +01:00
Denis Ledoux 15948702e5 [IMP] tools: locate_node, remove useless code
`if isinstance(node, SKIPPED_ELEMENT_TYPES):`
---------------------------------------------

It has been added in
https://github.com/odoo/odoo/commit/31b9bee00676e179c124f3d42539103305cf7423

It's hard to tell why it has been added. Though it seems not useful:
- Has we iter the nodes using the tag of the specification,
  `arch.iter(spec.tag)`,
  this is normally impossible to iter on a node type from that
  SKIPPED_ELEMENT_TYPES node type list
  (`etree._Comment, etree._ProcessingInstruction, etree.CommentBase, etree.PIBase, etree._Entity`),
  as those node types do not have a tag (`spec.tag`).
  In addition, in the place calling `locate_node`,
  we already do this same check on the specification node:
  https://github.com/odoo/odoo/blob/48109c15d319ae69a8fcdd4a6c3b19172a2de6d9/odoo/tools/template_inheritance.py#L144-L150

Version spec should match parent's root element's version
---------------------------------------------------------

It has also been added in the same revision:
https://github.com/odoo/odoo/commit/31b9bee00676e179c124f3d42539103305cf7423

This has been added in 7.0 to handle `version="7.0"` in xml views.

However, these `version="7.0"` have been removed in 8.0, in revision
odoo/odoo@faa09da325
After the above revision, there were still some leftovers,
but which have all been removed in 11.0 in revision
odoo/odoo@70942e4cfb
during an improvement of the RNG validator.

This is therefore enough evidence to say this code
checking for the `version` attribute in `locate_node`
is no longer useful since a quite long time now.
It can therefore be removed.

closes odoo/odoo#107340

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-12-12 11:22:32 +01:00
Romain Estievenart 36f2d1688f [ADD] web: Android mobile app feature detection
This commit adds a proper way to detect the Android OdooMobile app using
the User-Agent.

closes odoo/odoo#107392

Related: odoo/enterprise#34088
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-12-11 17:42:57 +01:00
Shawcker 6826fa3ed2 [FIX] account: 'Browse available countries' link style
Currently, the style for the link 'Browse available countries' you have on the accounting dashboard when no chart of accounts is installed for your company has no link style. This means it has the same styling as any other text, and makes it hard to actually know it's a link.

This commit adds a class to this link to give it a distinct style.

Task id=3094593

closes odoo/odoo#107653

X-original-commit: cc431997944ba90f61e543c73caaac5aeeb6f5c1
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-12-09 22:05:57 +01:00
Arnaud Baes 436b82d86c [IMP] website: Allow override on FeatureSelectionScreen
Needed for task-3046679

closes odoo/odoo#107654

X-original-commit: 82c8638251bf90d21eb335ec2013c0c9ef0ad355
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-09 21:00:57 +01:00
Lucas Lefèvre 5265c5a046 [IMP] spreadsheet: update o_spreadsheet to latest version
### Contains the following commits:

https://github.com/odoo/o-spreadsheet/commit/1419e570 [FIX] collaborative: don't endlessly dispatch new revision
https://github.com/odoo/o-spreadsheet/commit/45bf0472 [FIX] renderer: overflowing cell in Y have wrong overflowing background
https://github.com/odoo/o-spreadsheet/commit/3ce6151f [FIX] renderer: correct separator of overflowing cells

closes odoo/odoo#107645

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-09 19:45:55 +01:00
Ricardo Gomes Rodrigues (rigr) 4884445c19 [FIX] l10n_multilang: write access error when translating the CoA
To reproduce the bug:
1. Create two Belgian companies
2. Load the Belgian CoA for both of them
3. Go to the translation settings and add the French language
4. Access error

This is because we translate all the CoAs of all the companies, and not just the current company's COA. Therefore an access error is thrown because we modify the CoA of another company.
We can bypass this error by using sudo such that we translate every CoA and not just the one of the current company.

closes odoo/odoo#107643

X-original-commit: aac37b0de831e9d3b1ec8d4cead58c975bf06c5c
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
2022-12-09 19:45:52 +01:00
Benoit Socias 63bb3cb16a [FIX] base: avoid concurrent deletes when generating assets
Since [1] when website was moved to the backend, the `DELETE` SQL
statement introduced in [2] can fail in situations where it happens in
several workers at the same time.

To avoid this, this commit filters the deleted ids to only keep the
ones that are not locked.

Steps to reproduce:
- Revert commit [3]. (It avoids this scenario by returning to the root page.)
- Start with only `website` installed.
- Access a non-existing page. (e.g. `/@/a`)
- Click on "+New".
- Click on "Blog Post".
- Click on "Install".
=> Popup with traceback when reloading the page.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[2]: https://github.com/odoo/odoo/commit/0b22f4deee3129a84daa7113393da6e7200de6ff
[3]: https://github.com/odoo/odoo/commit/886900c33d18f647016e596ba41c193f5fcf8a43

closes odoo/odoo#107635

X-original-commit: 5390199b1b3dcee1cbfb28ea9bbdeba0469a75d2
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-09 19:45:50 +01:00
Olivier Dony 4fb4964fc3 [FIX] web, website: /web/login should simulate auth=public
The /web/login route is historically defined to be auth=none, which
means that it is available even when no database is selected (yet), and
no db_filter is set to automatically select one.
This is done mainly to be able to redirect users to the database
selection screen (cfr ensure_db()) instead of showing them a 404 until
they manually go to the /web/database/selector page.

The conversion of this mechanism in odoo/odoo#87571 can cause
problems because the user environment used to render the login page uses
the superuser ID. In certain configurations of installed modules, it was
possible to have the /web/login page showing "OdooBot" as the logged in
user, despite no user being actually logged in at all.

To fix this, we override the env that was set by auth=none:
- with the current session user, if there is one (like `/web` does)
- with the public user otherwise (as auth=public would do)

closes odoo/odoo#107613

X-original-commit: 6e42a07d7637070d45be81dcbf7261eda08425b4
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-09 19:45:47 +01:00
pedrambiria ccaecba252 [FIX] delivery: accept regex in the zip prefixes field
In the country of Bahrain, they have 3 and 4-digit zip codes. With the
current implementation of the delivery module, they can not add 3-digit
zip codes because they will be matched with some 4-digit zip codes,
which is incorrect.

For example, consider '101' and '1011' as two different zip codes related to
two separate zones. If you add '101' to a delivery method, it would also
accept '1011'.

The solution is to accept regular expression to allow them to use $ to
define the end of the zip code.

opw-3072592

closes odoo/odoo#107636

X-original-commit: 0a68d171af2645d3047d561acb354730aebfa753
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-12-09 18:37:50 +01:00