Commit Graph
165887 Commits
Author SHA1 Message Date
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
Antoine Dupuis (andu) dc3a0994b4 [FIX] l10n_br: Make sure credit notes use same sequence as invoices
Bugfix.
Steps to reproduce:
1. Create a fresh DB with the Brazilian localization.
2. Create a new Credit Note (directly from the menu, not from an
   invoice). Confirm.
3. Observe that you get a ValidationError: "Another entry with the same
   name already exists." because the name of the Credit Note is
   NFe 00000001, and an invoice called NFe 00000001 already exists.

Analysis:
The credit note should be called NFe 00000002, because in Brazil the
same sequences should be used both for invoices and for credit notes of
a given document type.
However, because the `refund_sequence` field is set to True on the
'Customer Invoices' journal, the sequence mixin doesn't consider
invoices and credit notes as using the same sequence, and therefore
doesn't consider the existing invoice when finding a new name for the
credit note.

Solution:
Set the field `refund_sequence` to False on the journal created by the
l10n_br template.
We also take the opportunity to move the code that provides a default
name to the demo invoices to a separate file demo/account_demo.py, for
consistency with other localizations.

closes odoo/odoo#137700

Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-10-06 06:14:09 +00:00
Claire Bretton (clbr) 2a4bdce1a7 [FIX] account: wrong date method in account_move_send cron
Switch to a datetime to avoid a wizard that has been created
at 00:00 to be deleted one minute later.

closes odoo/odoo#137697

X-original-commit: 128e3da4807acbc2275c7e4db3833ce062afae24
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-10-06 06:14:07 +00:00
Anita (anko) 50af195669 [FIX] sale: report grouping fix
Group by "Product" was grouping by product
variant instead of product template.
Grouping by "Product Variant" is added.

closes odoo/odoo#137690

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 06:14:06 +00:00
maad-odoo 0a5e138b32 [FIX] mail: activities creation date according to user timezone
Before this commit:
When any activity was created, the displayed created date was in UTC time
and not adjusted to the user's timezone. The time was not converted
according to the user's timezone.

After this commit:
The activity's created time now displayed is converted from the UTC time
stored during the activity's creation.

task-3483695

closes odoo/odoo#137684

X-original-commit: d016456c72d7927c10120a556adce9e73227523a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-06 06:14:05 +00:00
Didier (did) f1abc4e4f3 [FIX] mail: selfFollower should be included in the followers
Before this PR, the current user was not considered has a follower, regarding
the mention suggestions.
This lead him to be lower than other entries.
This PR fix the issue by adding him back to the follower list.

Task-3531111

closes odoo/odoo#137583

X-original-commit: 50a785fedc5b5c7fd826548e52385bdf458c97a2
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Didier Debondt (did) <did@odoo.com>
2023-10-06 06:14:04 +00:00
Valentin Vallaeys (vava) 8e3ffe7800 [IMP] sales: add discount on SOL in kanban
Before this commit, the discount was not displayed on SOL in mobile
view.

This commit adds the discount when it exists.

task-3111127

closes odoo/odoo#137416

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-06 06:14:02 +00:00
hupo-odoo 45b95c12db [IMP] account_report: new option for favorite filters
Adds a new boolean field on accounting report to enable the user to select user-defined filter on accounting reports. If activated, the user can visualize its own favorite filter (defined on journal items list view) on a new option selector on top of accounting reports (see enterprise commit). When selected, the domain of the user-defined filter is added to other selected options' domain.

task-3444246

closes odoo/odoo#134966

Related: odoo/enterprise#47200
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-10-06 06:14:00 +00:00
oco-odoo 791bbfc7c6 [IMP] account: reports: introduce current_groupby field
This field is needed by the enterprise counterpart of this commit. It is used to store custom-defined groupby on the report lines without overriding the standard value that's given in data files.

Task 3413437

closes odoo/odoo#133830

Related: odoo/enterprise#46657
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-10-06 06:13:59 +00:00
Odoo's Mergebot ae01d6488d [REF] mail, various: simplify 'mail.tracking.value' model, keep trackings at field removal
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled. Keep tracking
when removing fields.

SPECIFICATIONS

Remove 'tracking_sequence' on tracking values in DB. Consider insertion order
should be done accordingly and display them based on ID DESC. Sequence is now
used only for order records to insert in DB and can be used to resequence
them using the field description at any time. Feature is still the same (order
based on sequence) but without having to store the sequence itself. It was
never updated anyway.

Remove 'field_desc' and 'field_type' from 'mail.tracking.value' model. Those
can be retrieved when necessary, as it is mainly used for frontend display
in Chatter.

Remove 'old_value_monetary' and 'new_value_monetary' as float value can be
used instead.

Rename 'field' to 'field_id' to better indicate it is a m2o, and not a char
field holding a field name.

When removing fields set the field to False instead. Add a new field to
store fields information allowing to keep name, type and groups information
to allow displaying removed tracking values. Use this field only when a
field is removed to avoid duplicating field information when not necessary
and polluting the table.

Improve support of o2m / m2m tracking.

Cleanup overall tracking code: try to make methods more consistent with I/O,
cleanup formatting methods.

While working on tracking, let us cleanup a bit tests and various code
bits.

Task-3345979 (Mail: Simplify tracking model)

closes odoo/odoo#124182

Related: odoo/upgrade#4747
Related: odoo/enterprise#42131
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-06 06:13:55 +00:00
Thibault Delavallée a88381cc12 [IMP] mail: keep tracking when unlinking fields
RATIONALE

Currently when an ir.model.fields is removed all tracking linked to it is
lost. Indeed field is required and has an ondelete cascade attribute set
to it. However we should keep tracking values as those made sense when
used and one could want to have access to this information.

SPECIFICATIONS

When removing fields set the field to False instead. Add a new field to
store fields information allowing to keep name, type and groups information
to allow displaying removed tracking values. Use this field only when a
field is removed to avoid duplicating field information when not necessary
and polluting the table.

Task-3499067 (Mail: keep tracking when unlinking fields)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00
Thibault Delavallée e147d35590 [REF] mail: rename 'field' to 'field_id' on tracking value
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

Rename 'field' to 'field_id' on tracking model. It better indicates it is a
many2one and not a char field holding a field name for example.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00
Thibault Delavallée b2d7f03398 [REF] mail: remove 'monetary' values from tracking value, use float
PURPOSE

Simplify 'mail.tracking.value' model and code. Remove unnecessary fields and
computation. Make code easier to handle and more batch-enabled.

SPECIFICATIONS

Remove 'old_value_monetary' and 'new_value_monetary' fields on tracking model.
Float fields can be used instead as anyway what is important is the type
of value stored, not their actual purpose.

Task-3345979 (Mail: Simplify tracking model)

Part-of: odoo/odoo#124182
2023-10-06 06:13:55 +00:00