This commit introduces a hook named "useVirtual" which allows to filter
a given list of objects and return only those that are visible in the
current viewport. This effectively allows to use virtualization in lists.
The hook will trim down the list of objects it received to those that fit
in the current viewport (with a fixed margin above and under to allow
smoother transitions on scroll).
The following requirements must be met to use this feature:
- the scrollable area has a fixed height
- along with the list of items, a "getItemHeight" getter must be
provided to determine the actual height of each individual item;
- the items are rendered with a proper offset inside the scrollable area.
This can be achieved e.g. with a css grid or an absolute positioning.
Part-of: odoo/odoo#110819
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
This commit handles 2 things:
1. bring the mock server "copy" handler closer to its actual
implementation, supporting a second argument which is a dictionnary of
default values to be applied to the copied record;
2. make the mock server debug logs more readable, with a nice color code
(blue for requests, orange for responses) so that debug info are easier
to read in the console.
Part-of: odoo/odoo#110819
Co-authored-by: Julien Mougenot <jum@odoo.com>
This commit improves the performances of the mock server "read" handler
by reducing the amount of iterations performed on the current set of
records.
This was needed as some tests (namely: gantt manual performance tests)
mocked huge amounts of records and the main bottleneck was the mock
server, while the actual impact was supposed to be measured on the
rendering process.
Part-of: odoo/odoo#110819
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
The goal of this task is to ease the deletion/archiving of recurrent
tasks by giving the user the option to either continue
or stop the recurrence. The two main use-cases are:
\- You have a recurring task for a weekly meeting.
Next week, the user will be on time off. You are thus deleting the task.
However, you would still like tasks generated for the following meetings
and to keep track of the previous meetings.
\- You have a recurring task for a weekly meeting with an employee
that has just been fired. You are thus deleting the task and
you won't need this recurrence anymore.
(You may or may not want to keep track of the previous meetings.)
The main issue we are currently facing is that we need a task that acts
as a template for the recurrence to continue. This means that a user
cannot delete all of his tasks without breaking their recurrence.
Consequently, we will be using a "task template" for each recurrence,
which will only serve technical purposes and be invisible to the users.
When the recurrence is stopped, the task template is deleted.
This simplifies the technical and functional implementation as the user
won't be able to modify the template themselves.
\- Added task templates to recurrences in the data.
\- Deleted "all tasks" option form recurence update and changed "this
and following tasks" to "this and future tasks". Most of the time, the
user is going to update the most recent task, and it doesn't make
any functional sense to update past ones.
\- Same options for delete and archive.
\- No recurrent subtasks allowed anymore.
\- `date_deadline` is copied. We compute it by adding the delta between
the create date and the `date_deadline` of the template to the next
recurrence date.
\- Added filter to several view not to display task templates.
task-2937565
closesodoo/odoo#98088
Related: odoo/upgrade#4232
Related: odoo/enterprise#30416
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
When starting an onboarding/offboarding plan on an employee, activities
were only created for the users that were part of the HR Officer group.
Regular users can't access the `hr.employee` model and it's not possible
to have activities on `hr.employee.public`.
A new model has been created to manage those activities and is only
accessible to the user and their manager.
task-3151758
closesodoo/odoo#111505
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps to reproduce:
- Install Sales, Project, Timesheets.
- Go to a task inside Project, and to the Timesheets tab.
- Create or modify a timesheet line, and write a very long description.
Issue:
The description field of the timesheet line is not fitting to the parent
instead is fitting for the content inside description making the table
bigger than it should.
Solution:
We have a custom widget for timesheet_ids field when we have
sale_timesheet and the widget is missing the `o_field_one2many` class.
So we add the proper class to the component with `TimesheetsOne2ManyField`
opw-3145298
closesodoo/odoo#112631
X-original-commit: e73d7c4c3cddabdbb5d175681cbfe3789d846239
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
To evaluate the KanbanRecord and the ActivityRecord, a formattedRecord is passed.
What is a formattedRecord:
Before this commit:
The base record + all its fields with the keys value and raw_value.
formattedRecord = {
...Record(),
field1: {
value: ...,
raw_value: ...,
}
}
After this commit:
All its fields with the value and raw_value keys.
formattedRecord = {
field1: {
value: ...,
raw_value: ...,
}
}
This modification avoids giving access to the functionality of the Record
class directly in the arch. The arch should never have access to the
internals of the Record.
closesodoo/odoo#112618
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The purpose of this commit is to no longer calculate the aggregated
value of columns that are not displayed in the list view.
Before this commit, we always calculated the aggregate value of optional
columns that are hidden.
closesodoo/odoo#112542
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Triple click correction failed whenever the triple-click-selected block
was followed by an empty block. The reason is that `getDeepestPosition`
prevents the selection from being placed within a line break (`<br>`)
and therefore returns the block itself (`<p>[]<br></p>` will be
expressed as `(p, 0)`), so the heuristic to determine if triple click
correction in needed in `getDeepRange` would fail as it assumed the
`end` node was a leaf where it wasn't. This fixes the issue by applying
the heurstic to the first leaf of the `end` node instead, and making the
correction for there as well.
task-3180922
closesodoo/odoo#112637
X-original-commit: 81653c320a1e431e4b9ae831bf0b8522588368e6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
After a model in sample mode has fetched sample data, its orm is reset
to be the "true" orm (standard orm service using the real server (prod)
or the mock server (test)). Thus any change in the view parameters that
imply to fetch data will lead to fetch "true" data (possibly none) and
thus present "true" data in the view. The problem is that the graph and
pivot views did keep the class .o_view_sample_data in that case.
Here, we make sure that that class is removed at an appropriate time.
closesodoo/odoo#112612
X-original-commit: ae6ec8dcfb24b86743e3ee14ae2526b4f8b681b9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
before this commit, form view for the model fleet.vehicle.cost.report model was not defined, thus on opening the form view of this model shows odoo generated form view.
after this commit, as the form view is added for the model, on opening the form, clean form will be displayed.
also in the file, there is a record with wrongly aligned corrected that and set create="0" attribute in tree to hide the new/create button.
closesodoo/odoo#110450
Signed-off-by: Kevin Baptiste <kba@odoo.com>
When creating an accrued revenue entry, the same journal will always be
selected by the model (by default: Miscellaneous Operations) even after
selecting and confirming another journal in the view form. This is due
to the computed field that always take the same journal. Converting the
computed function to a default function resolve the issue.
related PR: #109058
opw-3076067
closesodoo/odoo#109516
Signed-off-by: William André (wan) <wan@odoo.com>
Break down payments down per tax. When creating a down payment for a sale order, create one line per tax instead of one line for the enire order.
[Sale Order]
Product Qty Unit price Tax Subtotal
Product1 1 1000 10% 1000
Product2 1 1000 5% 1000
====
Untaxed 2000
Tax 150
====
Total 2150
Make a 50% (1000) down payment :
[BEFORE]
Product Qty Unit price Tax Subtotal
Product1 1 1000 10% 1000
Product2 1 1000 5% 1000
Down pay 1 1075 0
====
Untaxed 2000
Tax 150
====
Total 2150
[AFTER]
Product Qty Unit price Tax Subtotal
Product1 1 1000 10% 1000
Product2 1 1000 5% 1000
Down pay 1 500 10% 0
Down pay 1 500 5% 0
====
Untaxed 2000
Tax 150
====
Total 2150
closesodoo/odoo#105177
Task: 2678531
Related: odoo/enterprise#36331
Signed-off-by: Laurent Smet <las@odoo.com>
Show alert on make invoice wizard if any invoice is still in draft state as draft invoices (and downpayments) will be taken into account into the computing of the amount when creating a new invoice
Task: 2678531
Part-of: odoo/odoo#105177
When wrapping the contents of a paragraph into a newly created div, the
nodes' ouid (unbreakable id) must be reset in order to prevent a
"unbreakable" rollback.
This commit makes such property reset and fixes errors related to changing
the number of columns of a text snippet.
task-3165895
opw-3137951
closesodoo/odoo#112521
X-original-commit: e33b802b05b41df20e13ebc44bc5b78edae50bb8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
How to reproduce
================
1. Create a user with lower privileges then admin
2. Add a new company and a new contact of that company in the contact
app at the sametime
3. Manually save
This will result in a write access denied
opw-3127591
closesodoo/odoo#112595
X-original-commit: 93a37df79fc30c2f9ac31d60dc897452851fd5bd
Signed-off-by: John Laterre (jol) <jol@odoo.com>
before this commit, on clicking the sales calendar view, it allows the quick adding from the calendar view and entered value is going to the name field of sale.order model.
after this commit, quick adding will be disable and on clicking form will be opened with selected date.
closesodoo/odoo#112587
X-original-commit: b82c59bdaffb731172eeb36954e5e46907ac9fcc
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Issue #1: reading textContent
When reading the textContent property of an element, its does not take into
account line breaks introduced by <br> and block elements, whilst innerHtml
does.
This commit solves the issue of updating a link's href to a non-sense url
upon label change. Before this commit, "www.abc.com <br> www.xyz.com" was
being incorrectely parsed as "www.abc.comwww.xyz.com".
Issue #2: setting textContent
When setting the textContent property of an element, all of its child nodes are
removed and replaced by a single text node. While this is fine when the
element contains a single text node, it might not be the desired result when
the element contains other children.
This commit solves the issue obtained when pasting html such as
"link.com<br>link.be" inside an empty inline element such as STRONG or A,
in which cleanForSave was changing its content (removing the line-break) due
to misuse of textContent, when the intended effected was simply removing
ZeroWidthSpace characters. A safer alternative for removing ZeroWidthSpace is
thus provided.
task-3081254
closesodoo/odoo#112579
X-original-commit: 9ff7c2ccff5f959f2a1cd7334c42b7bf0134f5d2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, the "addLabel" and "editable" props type was
not really tested.
closesodoo/odoo#112583
X-original-commit: bb060d012ff9dfe07fa75c851feafc0af2bfc0b5
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit replaces terms in Portuguese with English translations,
and moves the original Portuguese terms into pt.po translation files.
This makes it easier to maintain the module.
task-3116558
closesodoo/odoo#109205
Related: odoo/enterprise#35473
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Since Python 3.11, sampling from a set deprecated, the population must
be a sequence.
This commit applies the suggested fix.
Also, the filtering of the deprecation warning about sampling from set
can be disabled when the python version is not 3.9. This warning was
wrongly triggered since 3.9 because recordsets are bot a sequence and a
set.
This was fixed in python 3.10, see https://bugs.python.org/issue42470closesodoo/odoo#112450
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Since python/cpython#18544, unittest mock is not able to properly find
the "odoo.tools.config".
When trying to patch the `options` dictionnary, it leads to
`AttributeError: module 'odoo.tools.config' has no attribute 'options'`
In order to have the tests
working in python <= 3.11, we have to import the config module and patch
the options in place.
Part-of: odoo/odoo#112450
When python expression is evaluated in odoo form an action or qweb, we
are checking the opcodes generated by the evaluation of this code. We do
such a verification, because the code from actions and templates can be
written by someone having not access to the server and we don't want to
let them perform actions out of the scope of their database.
In python 3.11, some opcodes from previous versions of Python have been
renamed, grouped or sepcified. There are also new ones that have been
introduce.
In this PR, we are whitelisting the new ones that are needed by odoo to
properly work in this version of Python.
Part-of: odoo/odoo#112450
Since 16.0 the `Tax ID` field label is dependant on the company country.
For the US we chose `EIN` as the label.
Since there are multiple sources of tax ids in the US, it is better to leave it as the default: `Tax ID`.
task-3162675
closesodoo/odoo#112561
X-original-commit: f6846f5b9dcae6a0a9e26f3b847593a2e8a3222b
Signed-off-by: William André (wan) <wan@odoo.com>
To Reproduce
============
- create a vendor bill and add an image as attachment
- print Original Bill -> the generated pdf can't be loaded
Problem
=======
when trying to add an image attachment to pdf report, the image needs
a special process.
Solution
========
add the image processing when printing pdf
fix inspired from 15 [commit](https://github.com/odoo/odoo/commit/b82a6cdea21a66588ddcafcdfb5026ec22546745)
opw-3127535
closesodoo/odoo#112596
X-original-commit: 41c79f66cfb5cdb558110d32842198157932397e
Signed-off-by: William André (wan) <wan@odoo.com>
Portal defines the 'portal.mixin' that overrides a method from 'mail.thread'.
However no explicit inheritance is given between those two mixin. Some Odoo
models notably inherit from 'portal.mixin' and not from 'mail.thread'. It
makes no sense to override a method the model does not explicitly inherit.
In this commit we move the override on 'mail.thread' by checking the model
also inherits from 'portal.mixin' before doing portal-specific computation.
This fixes tests introduced previously.
Task-3175768 (Mail: check inheritances / overrides)
closesodoo/odoo#112573
Related: odoo/enterprise#37039
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose is to add tests as there are some broken overrides in mail.thread
inheritance mechanism.
We see notably that bad override in portal make some override not being
called correctly.
Task-3175768 (Mail: check inheritances / overrides)
Part-of: odoo/odoo#112573
Fine tuning of 8eaac97, the `errors` attribute was added in py38[^1]
[^1]: python/cpython@ca7b504a4dclosesodoo/odoo#112588
X-original-commit: c6c19ff6a3093fe64035d9f970ab35522f8080f5
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
This commit fixes the placement of the add icon that could be on top
of the next line in the export dialog, when the name of the field was
too long. This overlapping prevented to press the button of the next
line. This is due to a fix made in commit (1). Now, it is correctly
displayed without overlaying, both in ltr and rtl directions.
Also, because there was not enough padding and some browsers are using
overlay scrollbars on top of the buttons, it was in some occasions not
possible to press the buttons, because the scrollbar was covering the
whole area. In the list of fields, only the first level of elements has
the padding, to avoid having a cascade style when unfolding items.
Static props have also been added to the component, as the component was
introduced without them.
(1): https://github.com/odoo/odoo/commit/f10a4886d2c2bfc0d4643e0e4597e62c2ba4f94eclosesodoo/odoo#112570
X-original-commit: 66207b9ffc353bd52993622cc528494b49eedc27
Related: odoo/enterprise#37037
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Luca Vitali <luvi@odoo.com>
Before this revision, the pivot view used the wrong label for the
headers in the case of the group by value was "0". This was due to
the use of the falsy value of the group by value to determine if
the label should be used or if the label should be "Total".
closesodoo/odoo#112571
X-original-commit: 97db8c975643bb79e95f7506da03c7142651a3cf
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
- Add a new variable to view the initial date in calendar view.
closesodoo/odoo#112548
X-original-commit: e63993764d7e7206ed0bb97de30964b4776d6adb
Related: odoo/enterprise#37031
Signed-off-by: Kevin Baptiste <kba@odoo.com>
A syntax error sometimes caused a traceback when copying a table.
opw-3166159
closesodoo/odoo#112562
X-original-commit: 7fdeced319902e26ce33b5ffd0dd08957c484eb4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Purpose
=======
Prevent the 'Visits' stat button of the Course to
open any content action.
Task-3163777
closesodoo/odoo#112560
X-original-commit: ed064682a1e4aa8131665194a516a0a6652b74f9
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Steps:
Enable recurrence feature.
Go to Project > Office Design > Customer Review.
Enable recurrence on this task > Change month to year.
Issue:
Crash.
Cause:
`_get_next_recurring_dates` is called without a `repeat_month` arg.
Is is supposed to be a string which is going to be found in MONTHS keys.
Except it is False and so it is not in the list.
Fix:
If we don't receive it, deduce it from `date_start` arg.
closesodoo/odoo#112506
X-original-commit: 566c4904129dc7e81458871656d9b20b19b36246
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Audric Onockx (auon) <auon@odoo.com>
Changing the expected payment date for an invoice with several installments is unclear, as there's no clear indication of what is expected when, except in the aged report.
This commit:
- Changes the default label of journal items if there is a payment term that splits it into several installments. Each journal item will now have "installment #<number>" appended to it.
- The installment label is added on all types of moves.
task-3137957
closesodoo/odoo#110955
Related: odoo/enterprise#36266
Signed-off-by: William André (wan) <wan@odoo.com>
Following this PR odoo/odoo#97398 website_slides module was forgotten
This commit add 'sanitize_overridable' parameter to the html_content
field. This will allow one to use the embed snippet in an article
type slide.
Task-3134690
closesodoo/odoo#112534
X-original-commit: 627833e77eb8f7ef7850f1fdeeb115ee8870c7f9
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Before this PR, all this localisation was written in Spanish, but all the localisation have to be written in english and then translated back in the native language. This PR correct that.
closesodoo/odoo#112160
Task-id: 3166093
Related: odoo/enterprise#36801
Signed-off-by: William André (wan) <wan@odoo.com>
Version 16.0 removed the price different account following this pull request #99411
This decision has been made because it was only used anymore by standard cost method and real time valuation.
We thought that standard was not a valid accounting method and we didn't want to maintain code for it.
But:
- Standard could be valid if you manualy complete the accounting entries
by yourself (e.g. employees/machines cost in mrp).
- It's also valid if you record the difference between standard price and
vendo price (price diff)
If you want to have an estimation of your cogs (benefits and loss) during an
accounting period. People just do a manual correction at the end but they have
a real time reporting on the situation.
It's a too big regression to be acceptable. We apologize and reintroduce it for
16.0 and future version.
This PR reintroduce the fields in purchase and the fix module in 16.0 is
not needed anymore.
closesodoo/odoo#109924
Related: odoo/upgrade#4315
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Adds a new picking type code, 'dropship', and adds a new action/menu
item to display only the dropshipping's operations.
task-3076044
closesodoo/odoo#109511
Related: odoo/enterprise#35613
Related: odoo/upgrade#4252
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
In the Inventory's Configuration, the option to enable expiration dates
depends of the activation of lot and serial numbers.
But if the user disables the tracking and the expirations dates were
enabled, they still are.
Also, if the module `product_expiry` is installed directly, the tracking
numbers aren't enabled alongside.
To fix that, this commit modifies the `res.config.settings` onchange
`_onchange_group_stock_production_lot` to disable automatically
expiration dates when tracking is disabled, and this commit also adds a
hook in the `product_expiry` init to enable tracking numbers at the
installation.
Part-of: odoo/odoo#109511
Now, the button "Update Quantity" and the stat button "Qty. On Hand" on
the product's form view will both call `action_update_quantity_on_hand`,
which who can call `action_open_quants` is an advance option is enable
(multilocation, owner or package) or if the product is tracked by lot or
serial numbers.
Also, displays the product's UoM in the `stock.change.product.qty`
wizard and changes its style so labels have more space.
task-3076044
Part-of: odoo/odoo#109511
Makes the `product.packaging` `product_id` required in the model instead
of the view only, since a packaging is supposed to always be relative to
a product.
Edits some views to add the default product in the context and makes the
field readonly if there is no `product_id` (that way, the user can't
no more create packaging without product).
Also, removes the domain in the action to display the packaging list
view so the user can see if there are some packagings without product
and can eventually delete them.
task-3076044
Part-of: odoo/odoo#109511
In `_check_backorder`, changes the condition so it checks if the qty
done is enough compared to the actual reserved quantity (instead of the
demand).
Also, removes an unused bloack of code and makes minor visual changes.
task-3076044
Part-of: odoo/odoo#109511