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
closesodoo/odoo#134313
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
*: 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
closesodoo/odoo#133031
Related: odoo/enterprise#46992
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
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
closesodoo/odoo#137828
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
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
closesodoo/odoo#137783
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#136252
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
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
closesodoo/odoo#135967
Related: odoo/enterprise#48310
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Name can be edited more frequently than VAT, and we should
have a dedicated method to check whether it can be edited
or not.
closesodoo/odoo#118428
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
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-PATTERNSclosesodoo/odoo#116172
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
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
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
closesodoo/odoo#137812
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#137786
X-original-commit: ea632652be5d4b1cbdf19f68c1a4db1ffc3cfb99
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
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
closesodoo/odoo#137734
X-original-commit: 3ae87df6e39cb8ef279ef62f194edf14858d2edf
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/odoo#137521
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
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
closesodoo/odoo#136924
Related: odoo/enterprise#48515
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
closesodoo/odoo#135577
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
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.
closesodoo/odoo#134679
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
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
closesodoo/odoo#129087
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Victor Feyens <vfe@odoo.com>
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
closesodoo/odoo#125932
Related: odoo/upgrade#4808
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
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
closesodoo/odoo#120953
Related: odoo/upgrade#4654
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
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
closesodoo/odoo#108148
Related: odoo/upgrade#4238
Related: odoo/enterprise#35157
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
__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
closesodoo/odoo#137798
X-original-commit: e41dcde8d66c74c8ad114c76ea6ed9c607e04455
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
**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.
closesodoo/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>
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
closesodoo/odoo#137775
X-original-commit: 95e0be822fab3596b2baa8b19e0a9c1728096047
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
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".
closesodoo/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>
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
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
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/134187closesodoo/odoo#137756
X-original-commit: 68d670a27be7baaaf53b0cf491234f8e0453d7f2
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
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
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
closesodoo/odoo#137735
X-original-commit: a50e73a2ae04fac9fcfea77cbab27e0b5de66fcc
Related: odoo/enterprise#48473
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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.
closesodoo/odoo#137700
Signed-off-by: Josse Colpaert <jco@odoo.com>
Switch to a datetime to avoid a wizard that has been created
at 00:00 to be deleted one minute later.
closesodoo/odoo#137697
X-original-commit: 128e3da4807acbc2275c7e4db3833ce062afae24
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
Group by "Product" was grouping by product
variant instead of product template.
Grouping by "Product Variant" is added.
closesodoo/odoo#137690
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#137684
X-original-commit: d016456c72d7927c10120a556adce9e73227523a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
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
closesodoo/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>
Before this commit, the discount was not displayed on SOL in mobile
view.
This commit adds the discount when it exists.
task-3111127
closesodoo/odoo#137416
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
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
closesodoo/odoo#134966
Related: odoo/enterprise#47200
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
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
closesodoo/odoo#133830
Related: odoo/enterprise#46657
Signed-off-by: John Laterre (jol) <jol@odoo.com>
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)
closesodoo/odoo#124182
Related: odoo/upgrade#4747
Related: odoo/enterprise#42131
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
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
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
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