Commit Graph
165899 Commits
Author SHA1 Message Date
Christophe Monniez 15b6cf888c [IMP] packaging: adapt packaging for current distros
As Odoo, now, needs at least python 3.10 have to build it against the
current distros.

closes odoo/odoo#136904

Related: odoo/documentation#5940
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-06 21:11:52 +00:00
Christophe Monniez 163fb3ae61 [IMP] core, requirements: bump minimal python version to 3.10
Now that the Debian 12 ("Bookworm") is out with Python 3.11 as the
default, it's time to update our requirements.

Reminder of the constraints for our requirements:

We try choose the smallest version from the Ubuntu/Debian corresponding
package (python3-...).

Also, if we find that one of the package was patched by the
Debian/Ubuntu maintainer, we choose the version from which the patch is
coming.

So, before this commit, the version were choose between Debian 11 and
Ubuntu 22.04. With this commit, we can simplify the requirements because
of a better matching between "Jammy" and "Bookworm".

About the choice of the python version:

* Ubuntu 22.04 ("Jammy") provides 3.10
* Debian 12 ("Bookworm") provides 3.11
* Some features that only exists in 3.9 will be needed in a near future
* 3.9 is a small release

Part-of: odoo/odoo#136904
2023-10-06 21:11:52 +00:00
Xavier ALT e61dd019e4 [FIX] website_hr_recruitment: fix typo in 'All Offices' dynamic url
Add missing '#' that prevent correct evaluation of the dynamic href
attribute.

To reproduce:
- To to /jobs
- Ensure 'Office Filter' page option is enabled
  (if not edit the page and enable it)
- Click the office dropdown and hover 'All Offices'

We ends ups with a URL like:
`/jobs?{'all_countries=1' if is_remote else current_country_path}`

closes odoo/odoo#137907

X-original-commit: 8f3277c32f750a04dbfcfb3dd817b15bf0720574
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-10-06 18:18:33 +00:00
Lucas Lefèvre (lul) ad5c1e7370 [REF] spreadsheet: rename button class
Commit odoo/o-spreadsheet@adcda84 renamed the button
class.

closes odoo/odoo#137902

Related: odoo/enterprise#48560
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-10-06 18:18:32 +00:00
tsm-odoo a97abef2d2 [IMP] im_livechat, mail: allow livechat visitors to upload attachments
Since [1], live chat visitors are using the mail guest system for
authentication. With this change, visitors are allowed to reach the
attachment upload routes (even if nothing allows it in the frontend
for now). This commit restricts attachment upload for guest and portal
users with the `allow_visitor_upload` field that can be toggled.

At the same time, this commit enables file upload when authorized
on the frontend and for cross origin live chats.

[1]: odoo#129770

task-3332628

closes odoo/odoo#137574

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-06 18:18:29 +00:00
nikj-odoo 2719b2100d [IMP] sale: add improvements in fields & reporting in sale app
Improve following feature :

-  visible if someone signed the quotation and it should be readonly on the
    quotation.
-  make optional field "customer reference" in list view.
-  make optional field "Expiration" in list view.
-  add sub-menu under the reporting menu:
       1. "Sales" :- redirect to the current report.
       2. "Salespeople" :- redirect to the current report but grouped by
                           salesperson.
       3."products":- redirect to the current report with group by produts.
       4."Customer":- redirect to the report with group by customers.

task-3369999

closes odoo/odoo#133780

Related: odoo/enterprise#46641
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 18:18:26 +00:00
Pierre Pulinckx (pipu) 844448320d [FIX] web: fix bus of loading indicator
We do not clean the event handlers properly (because we do .bind()).
So we have another version of the handlers and they are not unbinded.
In this commit, to remedy this, we use the useBus function which
resolves this problem.

closes odoo/odoo#137885

X-original-commit: 7e2e2e0b257d44ce051a3ee8f60e9e03f5d14739
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-06 17:11:27 +00:00
Pratik Raval (PRRA) c2a98bf2e8 [FIX] website_forum: fix js template string translations
Some strings were not translated in website_forum because translation marks
inside backticks will not be extracted to be translated.
i.e., Markup`${_t("Please translate me"}, OK` will not work.

This commit fixes the issue by explicit translation before putting it inside the
backticks.

Task-3462273

closes odoo/odoo#137857

X-original-commit: 5f33cdb8120661dad58eae9be1d6a511dc712bbd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-06 16:10:00 +00:00
Rodolpho Lima d8a3374c43 [FIX] web_editor: node insertion from different document
Steps:
- on website or mass_mailing, insert an image via the "/image" command,
- a text node containing "[object HTMLImageElement]" is pasted instead
  of the expected content.

Since [1], when inserting a node, the instanceof operator is used to
compare that node to the Editor's document global `Node` object. While
it fixed cases where there was as mismatch of `Node` objects (nodes
created by the top document x nodes created via the iframe's document),
it revealed errors elsewhere. Notably, the MediaDialog inserts an image
node created by the top document, regardless if the editor is mounted in
an iframe.

This commit makes the `insert` command more permissive when resolving if
'content' is a Node or a string.

task-3543003

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

closes odoo/odoo#137872

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-10-06 14:33:47 +00:00
Thomas Lefebvre (thle) 3ca93ec14b [FIX] sale_timesheet: update is_so_line_edited
Steps to reproduce:
-------------------
- go to project form view;
- edit the sale order item of a task;
- make `is_so_line_edited` visible in Timesheet list on the form;

Issue:
------
The `is_so_line_edited` field is not set to `True`.

Solution:
---------
Use the widget designed to correctly update
the `is_so_line_edited` field.

opw-3476614

closes odoo/odoo#137854

X-original-commit: f74e8085e578820283d4be158a5156dd3d6d35c6
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-06 14:33:46 +00:00
Aaron Bohy 9e46a8a58c [REF] web,*: remove owl.App.validateTarget override
The motivation of this commit was to remove the override of owl
that disables the validateTarget check, which we believed was
necessary for the renderToString function.

Fun fact: renderToString doesn't seem to need the override, as
validateTarget is only called when mounting an app and when
completing a fiber, which renderToString doesn't do. It was instead
probably necessary for the legacy compatibily layers that have now
been removed.

So this commit removes the validateTarget override.

This commit also simplifies the setup of the renderToString fn by
lazy creating the app itself, instead of requiring the application
setup to set the main app as renderToString app (e.g. main.js in
web).

Part of task~3508223

closes odoo/odoo#137807

Related: odoo/enterprise#48514
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-06 14:33:45 +00:00
Martin Trigaux 22ab49e343 [IMP] *: use file_path and file_open
Replace all the calls to get_resource_path to the better file_path or
directly use file_open when not needed

Doing both a get_resource_path and file_open means checking twice that
the file exists.
Doing a simple path concatenation before a file_open is safe.
If given to another method (e.g. etree.parse), calling file_path is
the prefered method.

Note that get_resource_path used to return False when the file does
not exists while file_path/file_open raises a FileNotFoundException

closes odoo/odoo#135607

Related: odoo/upgrade#5187
Related: odoo/enterprise#47475
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-06 14:33:43 +00:00
Martin Trigaux 9e253bbe63 [IMP] module: deprecate get_resource_path
file_path is superior and can replace every (often unnecessary) calls
Merge check_resource_path that is no longer needed

Part-of: odoo/odoo#135607
2023-10-06 14:33:43 +00:00
Victor Piryns (pivi) b01835ac63 [PERF] project: add an index on create_date
Description:
In eedf37d6e2 the index on
`create_date` was removed, but it was still left on our production
database. After recent analysis on the usage of the index over the
span of 2 months (start July 2023 -> end of August 2023), this index
was hit over *100M* times. It's heavily used in custom filters when
grouping by `create_date`. So the goal of this PR is to add it back
in standard code.

Reference:
task-3263544

closes odoo/odoo#134313

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-06 14:33:40 +00:00
Robin Lejeune (role) e38808e1a7 [IMP] website, *: add user profile to website navbar
*: test_website_modules, website_sale

When one starts a trial with the website app, they arrive on a webpage
in edit mode. Many users struggle to understand they need to save before
accessing the Odoo navbar (app switcher, creation of new page, etc.).
Additionally, if they want to navigate through Odoo, not having to
discard could save some time.
It was therefore decided to land on the homepage without editor after
creating a website. The first step of the homepage tour should then be
to click on the edit button.
When creating an empty website (skipping the configurator), the website
loader is shown until the page is ready, to avoid the user leaving the
page before the first step is displayed.

On another related note, if one wants to try out the Odoo website
builder, they might create multiple DB, one per website, which is OK. In
such a case, the link to 'my database' is not visible from the website
app because the user profile was hidden.
The user menu is therefore added to the navbar on the website app.

In order to make sure the header and its dropdowns always stay on top of
the website's elements regardless of their z-index, `.o_website_preview`
is blocked in its own stacking context with `isolation: isolate;`.

task-3381773

closes odoo/odoo#133031

Related: odoo/enterprise#46992
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-10-06 14:33:38 +00:00
FrancoisGe e1f71525ee [FIX] web: create record with properties in Calendar
Before this commit, creating a record in Calendar view that has a
properties field in its form view causes a crash.

How to reproduce:
----------------
- Go to the Project app
- Go to a task
- Add a property
- Go to the Calendar view of the project
- Create a record

Before this commit:
    An error is displayed

After this commit:
    The form dialog opens so that you can create the record

closes odoo/odoo#137828

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-06 13:09:02 +00:00
FrancoisGe 2e735d2832 [FIX] web: mockServer onChange should only return fields from view
Before this commit, when calling onchange, the mockServer returned all
the changes present in the onchanges functions defined on fields.
The expected behaviour is to return only the changes required by the view.

Part-of: odoo/odoo#137828
2023-10-06 13:09:02 +00:00
niyasraphy 4e3710879f [IMP] product: add system parameter to control maximum product limit
before this commit, if the entered attribute combination in
template is creating more than 1000 product, the operation
is prevented by raising UserError.

as of now, there is no option to increase or decrease the
limit if user need to do so.

system parameter:  product.dynamic_variant_limit

after this commit, if user needs to increase or decrease
the limit, it can be done by adding a system parameter
and set the needed value

closes odoo/odoo#137783

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 13:09:01 +00:00
Claire Bretton (clbr) 743b2436b0 [IMP] account,l10n_{cl,ec,pe}: demo data for auto-reconcile
Adds demo data for auto-reconcile.
We now have data that can auto reconcile:
- in both modes (zero total balance or opposite
balance one-by-one)
- on payable and receivable accounts
- by filtering on Azure Interior and/or Deco Addict

task-id:3517768

closes odoo/odoo#136252

Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2023-10-06 13:08:56 +00:00
Yash Vaishnav 96f7738439 [IMP] hr, hr_hourly_cost: clean up demo data
This commit message cleans up the demo data.
First of all, it's good to have a good organization model, and secondly,
it's important for the demonstration of  the org chart view
(that will be deployed in 17).

In particular, here we:
-create a department hierarchy, and assign colors to each department
-add the manager to each department

task-3510243

closes odoo/odoo#135967

Related: odoo/enterprise#48310
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-10-06 13:08:55 +00:00
Valeriya(vchu) ac18850621 [FIX] account, portal, sale, website_sale: fix name editing
Name can be edited more frequently than VAT, and we should
have a dedicated method to check whether it can be edited
or not.

closes odoo/odoo#118428

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 13:08:53 +00:00
Valeriya(vchu) d9c7ff69a4 [IMP] website_sale, base: use invoice address at checkout
at checkout use the invoice address as billing address instead of
main address if the invoice one is defined. Add the functionality to
add new billings addresses at checkout.

task-3258835

Part-of: odoo/odoo#118428
2023-10-06 13:08:53 +00:00
kedwards 4015f90bde [IMP] core: improve behaviour of Odoo on Postgres 15+
Postgres 15.0 has started enforcing a [long-standing
recommendation][secure-schema] of the `public` schema not being
`CREATE`-granted to every user, as in users which are neither
administrators nor owners of the database can not create DDL objects
(tables, views, ...) in the schema.

As Odoo [recommends using a non-admin non-owner user][configuring]
this would be the normal deployment mode of a production Odoo system,
following which Odoo would be unable to initialize the database and
install new modules.

Although the official recommendation is to create a schema with the
same name as and owned by the low-access user, the threat model does
not really affect Odoo as it always connects to the database with the
same user (or close enough). Odoo's behaviour is much closer to usage
pattern 5.9.6 ¶ 3:

> the database has a single user or a few mutually-trusting users

It also would not really work, as one could create and possibly
initialize the database with one user (e.g. using the command line),
then per [guide][configuration] run Odoo using a different user, which
would not be able to see the schema created for the first user and
thus would have to perform their own setup in an unrelated
schema (which it would have to create first). Resulting in an unused
full installation (with the modules and configuration the original
creator wanted) and a separate empty installation at best.

Thus implement the setup for 5.9.6 ¶ 3:

> grant privileges to create in the public schema

[configuring]: https://www.odoo.com/documentation/16.0/administration/install/deploy.html#configuring-odoo
[secure-schema]: https://www.postgresql.org/docs/15/ddl-schemas.html#DDL-SCHEMAS-PATTERNS

closes odoo/odoo#116172

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-10-06 13:08:52 +00:00
Kwasi Edwards 34370699ae [CLA] cla agreement for sundaebytes / Edwards Kwasi
Part-of: odoo/odoo#116172
2023-10-06 13:08:52 +00:00
william-andre 314ec8aed2 [IMP] l10n_*: autofill sequence field
closes odoo/odoo#85750

Related: odoo/enterprise#24956
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-10-06 13:08:51 +00:00
william b83c4fff34 [IMP] convert: autofill sequence fields
Motivations:
* `sequence` is not super intuitive for new devs
* It makes "useless" noise in data files
* It is redundant when what we want to see in the file is the same as
  what we want to see on the user screen.
Do you understand anything related to sequences in here?
https://github.com/odoo/odoo/blob/15.0/addons/l10n_lu/data/account_tax_report_line.xml
Explicit is not always better than implicit.
* It is not implicit like using `id`  it is natural and visual and saves
  a lot of chore for adding and maintaining sequences.

Implementation
* It is optional, with the option set on root xml tags

Part-of: odoo/odoo#85750
2023-10-06 13:08:51 +00:00
zel-odoo 78f6b83b34 [IMP] im_livechat: add/move config to user_setting
Enable livechat language setting for operators
Move livechat_username into res_user_setting

task-3390821

closes odoo/odoo#133142

Related: odoo/upgrade#5113
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-06 11:21:47 +00:00
niyasraphy c638913df1 [FIX] sale_pdf_quote_builder: traceback on printing report
before this commit, on printing the report if there is an
exception happens on rendering the header and footer,
traceback is shown to user without skipping the exception

AttributeError: 'sale.order.template' object has no
attribute '_message_log'

the exception come from _get_form_fields_mapping function,
format_date function is called by passing tz but the function
doesnt have this argument.

after this commit, if exception happens on rendering the
header or footer, a message will be added in the log and
report will be printed without traceback

closes odoo/odoo#137812

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 09:39:29 +00:00
Djamel Touati c8445d32ae [FIX] stock: print ZPL label with “product.product” price
Steps to reproduce the bug:
- Create a storable product “P1”:
    - set sales price: 10
    - Go to attributes & variants tab:
        - Color: red & blue
        - Size: S

- Go to Red attribute and add extra price: 5
- Go to the product variant “P1 red S”
- Print label:
    - ZPL with price

Problem:
The product.template price is printed instead of the product variant
because we use “list_price” instead of “lst_price”

opw-3537277

closes odoo/odoo#137786

X-original-commit: ea632652be5d4b1cbdf19f68c1a4db1ffc3cfb99
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-10-06 09:39:28 +00:00
Jay Savaliya fed6bb12c1 [FIX] mail: email/sms error icon overlap
Before this commit:
-While reading chatter notifications in the chat window, SMS and email icons are
not accessible to click due to action list overlap.
-While reading a reply on any message or attachment in chat widow,
the attachment link is not accessible to click due to action list overlap.

After this commit:
-When SMS and email icons are visible, time and that icon will display to the
following line so user can click on it easily.
-Attachment links will display to the following line of mentioned so user can click
on it easily.

Task-2713371

closes odoo/odoo#137734

X-original-commit: 3ae87df6e39cb8ef279ef62f194edf14858d2edf
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-06 09:39:27 +00:00
Loukas Wets (lowe) 6504de0f94 [IMP] point_of_sale,l10n_in_pos: various pos.bill changes
This commit:
- Changes the order of bills and how the values are displayed in the
pos_bill_view.
- Adds a 500 bill for India localisation.
- Changes the tree view of pos bill to be editable and set the bill
to all the pos_configs if no config is linked to the bill.
- To prevent inconsitancy, 'pos_default_bill_ids' field is removed from
the res.config.settings view since if no pos config is linked to the bill, the
bill is accessible to all the pos configs.
- Removes the amount in the open session button in opening cash control popup.

Task-3537655

closes odoo/odoo#137521

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-06 09:39:26 +00:00
FrancoisGe c830d9bc9d [FIX] web: Record.update with onChange
The goal of this commit is to resolve:
=====================================
1. When you edit a Char or Boolean field with an onChange that returns
   the value before editing, you must display the value of the onChange.
2. In the model, html fields are always Markup fields. But when we evaluate
   a modifier containing an html field, we use the server value (a string or false).
3. When we edit a field and its onChange returns an server error, we want to
   revert its value to the valuea before edition.

Solution:
=========
1. Always render when applying a change, even if the value does not change,
   because onChange returns the initial value. To do this, we'll apply
   the changes to record.data, then apply the changes from onChange.
   The value will therefore change, which will cause all the components
   observing the value in record.data to render.
2. When we update an html field, its value will always be markup and
   we'll store it as a string in _textValue so that we can evaluate the
   modifiers without the markup. For changes coming from the onChange, we
   will store the value in _textValue and apply markup on it for record.data.
3. When an onChange returns an server error, we will apply the changes and then
   revert them directly. This will have the effect of triggering a rendering
   on all the components observing to the record.data corresponding to
   the changes and so displaying the values before editing.

How to reproduce:
=================
Case 1:
------
- Go to a form view containing a boolean field with an onChange
- Check the boolean field
- The onChange returns with the value false

Before this commit:
    The boolean field is always checked

After this commit:
    The boolean field is no longer checked

Case 2:
------
- Go to a form view containing an html field and an field "x" with
  invisible ="not html_field" and an onChange
- Edit the field "x"
- The onChange returns the value false for "html_field".

Before this commit:
    The field "x" is always displayed

After this commit
    The field "x" is no longer displayed

Case 3:
------
- Go to a form view containing a char field with an onChange
- Edit the field
- onChange returns a server error

Before this commit:
    The field is marked as invalid and contains the value after editing.

After this commit:
    The field contains the pre-edit value

closes odoo/odoo#136924

Related: odoo/enterprise#48515
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-06 09:39:24 +00:00
niyasraphy 3b4e8ea422 [IMP] point_of_sale: copy combo lines on duplicating a combo
before this commit, on duplicating a combo product, the
combo lines are not copied to new records

after this commit, the combo lines will get copied
during the duplicate

closes odoo/odoo#135577

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2023-10-06 09:39:22 +00:00
David Monnom (moda) 4ab79fff7a [IMP] point_of_sale,pos_restaurant: primary btn payment, order & review
Previously, the order, review and pay buttons were in btn-primary at the
same time, or not at the right time.

Changes have been made to the current behavior:
- If there is no order line, both buttons are gray
- if something needs to be sent, the Command button takes priority
- if nothing is to be sent, the Payment button takes priority

A fix has also been made to the number of items to be sent to the
kitchen, both for the category list and for the number of products.
The number of products per category was erroneous, so the number of
products has been changed to an absolute value.

closes odoo/odoo#134679

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-06 09:39:20 +00:00
shag-odooandVictor Feyens bf95b1f2ad [ADD] sale: new wizard to apply discounts on sale orders
Replace the magic js logic applying the discount of the first line to all
the lines by a dedicated wizard, providing three kind of discounts:

* Discount on each sale order lines
* Discount on the global order amount
* Fixed discount amount

task-3369680

closes odoo/odoo#129087

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
2023-10-06 09:39:19 +00:00
Jurgen (jugj) fb320856c0 [IMP] (website_)hr_recruitment : Improve UX
In this PR we'll add the following UX improvements :
- Drop the useless responsible_id field from hr_job
- Include applicant attachments in the meeting when scheduling an interview
- Several tooltip and default value changes
task-3380150

closes odoo/odoo#125932

Related: odoo/upgrade#4808
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-10-06 08:25:19 +00:00
Abderraouf Ghrissi (abgh) 56073896a6 [IMP] project: merge date_deadline and planned_date_end
Before this commit:
- The existing of two dates behaving as and end date for project_task
(date_deadline and planned_date_end) is confusing.

In this commit:
- The main goal is to simplify the interface by having one field/widget
that acts as both the deadline and the end date, instead of having two separate fields.
So we removed planned_date_end (changes can be seen in the enterprise related pr (link at
the end) and changed the date_deadline type from date to datetime in project_task and
report_project_task_user

Related PRs:
Enterprise: odoo/enterprise#40866

task-3084978

closes odoo/odoo#120953

Related: odoo/upgrade#4654
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-06 08:25:14 +00:00
Dossogne Bertrand 8f87e102a9 [IMP] hr_holidays: see future allocations + refactoring
This commit adds the feature to select a date in the future
in order to see future allocations, would it be for accrual plans
granting new allocated days, lost days due to expired allocations
or allocations that are not yet available to the employee.
The date selector only appear when the employee has accrual allocation,
in which case the feature is more relevant.

This feature comes with a major refactoring of hr_holidays
methods to handle some edge cases in the management of leaves.
The refactoring also includes the removal of the 'draft' and 'cancel'
state in allocations.

This commit also removes unused imports and implements some linting fixes.

task-2675380

closes odoo/odoo#108148

Related: odoo/upgrade#4238
Related: odoo/enterprise#35157
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-06 08:25:12 +00:00
Julien (jula) 41d135d860 [FIX] web: use correct date in py_date.js
__Current behavior before commit:__
When `context_today()` is in a domain, UTC is used. However this is not
consistent with [the legacy method](https://github.com/odoo/odoo/blob/81183495a07eb5928b29ae56f3f86671234d602c/addons/web/static/src/legacy/js/core/py_utils.js#L232) used before OWL migration.

This has the consequence that filters with this method in their domain
will not behave correctly and use UTC date instead of the actual date
of the user.

__Description of the fix:__
Switch the UTC methods calls to regular ones.

__To reproduce:__
(Reproducible only in Odoo 16, since the old method is still used in 15)
1. Change computer date and timezone so that UTC date is not the same as
your date (e.g. if timezone is CEST, set the hour to 1am)
1. On any record, schedule an activity with the due date to today.
1. In the Activities notifications panel, click on **1 Today**
1. The page display nothing because it will filter by the previous day.

opw-3423316

closes odoo/odoo#137798

X-original-commit: e41dcde8d66c74c8ad114c76ea6ed9c607e04455
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-06 07:12:21 +00:00
Bruno Boi a9a8dd6795 [FIX] web_tour: fix tour tips bad positions
**Before this commit**
1. When passing to the next step the new tour tip target stays
   the same element (could happen in certain conditions through
   owl's dom patching), the tour tip pointer is positionned at the
   [0, 0] bottom-left coordinates instead of near its target.

2. Under certain conditions, when the tour tip pointer's content
   changes, the dimensions of the opened tip is not properly stored
   in the instance of the tour pointer. This lead to a weird looking
   tip when you hover on it, triggering its opening state.

**After this commit**
The above issues are fixed.

closes odoo/odoo#137792

Taskid: 3502704
X-original-commit: f169130a31646dabb201cd4e1e54bbd0754b3fdf
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-10-06 07:12:19 +00:00
Nguyen Hong Quang 495fb457c5 [FIX] website: add missing role in parent elements on submenu
Currently, <ul> and <li> is missing `role` in navbar. This thing can
effect on accessibility point on Lighthouse report.
https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/menuitem_role

This PR will fix this problem

closes odoo/odoo#137790

X-original-commit: 21ce76703a9b1496e6824be7aa19946c37cca37c
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-06 07:12:16 +00:00
Walid 055b8d2153 [FIX] website_sale_comparison: restore compare button
Exact steps (or video) to reproduce the issue (on runbot):
1. Go to Website > Shop > Open a product with specifications table (Customizable Desk).
2. Open Editor > Set Specification to None > Compare button is removed from Product page

Fix:
display the compare button under add to cart if spec disabled

opw-3329219

closes odoo/odoo#137775

X-original-commit: 95e0be822fab3596b2baa8b19e0a9c1728096047
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-10-06 07:12:14 +00:00
Djamel Touati ad253ef4c2 [FIX] purchase: set the correct price in alternative PO
Steps to reproduce the bug:
- Create a storable product “P1”:
    - Price at “Wood corner”:
        - $5, min qty =1
    - Price at “Open wood:
        - $6, min qty = 1
        - $4, min qty = 10

- Create a purchase order at wood corner:
    - 100 units
> the price is automatically computed at $500

- Go to Alternative tab in the PO:
   - Create a one for “Openwood” and copy lines

Problem:
The price for 100 units is computed as $600 instead of $400.

When we create the alternative purchase order, in the "create" function
of “purchase.order.line,” we receive only the quantity as "qty=100" in
the values. Therefore, the missing fields should be prepared.

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1102

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1102

First, the line is created with the received values (“qty=100”), and
the price_unit is computed correctly as $4.

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1400

So, the price_unit is computed correctly at $4

However, the “onchange_product_id” function is then called, resetting
the price_unit and product_qty to 0.

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1401

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1176

Afterward, the “_suggest_quantity()” function is called

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1180

suggesting a minimal quantity based on the seller (so=1).

https://github.com/odoo/odoo/blob/a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab/addons/purchase/models/purchase.py#L1363

Therefore, the price_unit is computed based on qty=1, resulting in $6.

Finally, the price is returned because it is the only missing field.

opw-3497825

closes odoo/odoo#137774

X-original-commit: 0781198f1b5e5d6a4e2722ea3c663b74fb131bc3
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-10-06 07:12:13 +00:00
Brice bib Bartoletti a5f01f9d7a [IMP] l10n_dk_oioubl: allow import
The aim of this commit is to allow import of OIOUBL einvoice.

Documentation source: https://oioubl.info/classes/en/index.html

The test xml files are those provided in the OIOUBL documentation.
The testing xml files are those provided by the Danish administration
with the documentation.
You can download the documentation here: https://oioubl.info/documents/en/allpdf.zip
The xml are in the folder "Eksempelfiler".

closes odoo/odoo#137758

Task-id: 3420748
X-original-commit: b6a060b60e6755af4e6029eb7b23d417a3c4a774
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-10-06 07:12:12 +00:00
Brice bib Bartoletti b818c83e9c [FIX] l10n_account_edi_ubl_cii_tests: wrong variable name
I introduced a wrong variable name in commit 70f252ed99c6c9596cd909bede8ef21cdd0df718

I believed `get_resource_path` was wrongly named and retrieved a file
but `etree.parse` is actually retrieving the file by itself.

Task-id: 3420748
X-original-commit: 3954a517eab1cef6154414fa40f8c730071b987a
Part-of: odoo/odoo#137758
2023-10-06 07:12:12 +00:00
Brice bib Bartoletti ecaa7833af [FIX] account_edi_ubl_cii: ubl2.0 import tax retrieving
During the work done on OIOUBL einvoice import, we saw that the
`Percent` node is always located below a `TaxCategory` node in UBL 2.0.

Task-id: 3420748
X-original-commit: 71d8bf93be472bdcf232e25e42f818e2df89cf8b
Part-of: odoo/odoo#137758
2023-10-06 07:12:12 +00:00
Walid 5cf635f55f [FIX] mrp: SN sequence
Since commit[1] Serial number sequence rule takes priority over already
existing Serial numbers

Bug:
when disabling default Serial number sequence rule a validation error
is thrown since lot name is now empty

Fix:
fall back on the previous behaviour (get next SerialNumber) if sequence
is not set
(also added a clearer user error if neither is set)
note also updated the .pot file

opw-3514794
[1]:https://github.com/odoo/odoo/pull/134187

closes odoo/odoo#137756

X-original-commit: 68d670a27be7baaaf53b0cf491234f8e0453d7f2
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-10-06 07:12:11 +00:00
Josse Colpaert 93eae53c6f [IMP] l10n_es_edi_sii/tbai: use l10n_es_is_simplified field
instead of just checking the simplified partner

closes odoo/odoo#136164

Related: odoo/upgrade#5191
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-10-06 07:12:08 +00:00
Josse Colpaert 7756811110 [IMP] l10n_es: add simplified checkbox on invoice
In order to allow in the PoS to put a partner, but
still do a simplified invoice, we added this field
l10n_es_is_simplified so you can force a ticket
instead of having to download the invoice.

This could also be used to only do the check for
a NIF when the invoice is not simplified.

Related to task 3413182

Part-of: odoo/odoo#136164
2023-10-06 07:12:08 +00:00
nikj-odoo 093b2f56fb [FIX] web,sale: Add domain & show action helper when there is no data
In this commit, show action helper when we had not data show in graph view.
same as we have in pivot view.

- add domain for cancelled records to not showing in reporting.

task-3500508

closes odoo/odoo#137735

X-original-commit: a50e73a2ae04fac9fcfea77cbab27e0b5de66fcc
Related: odoo/enterprise#48473
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 06:14:13 +00:00