Before this commit if you would call phone_parse() but not pass along a
country code it would crash. This is reproducable by calling the phone_parse
function and not setting a country on the contact. In this case you would get
the following traceback:
AttributeError: 'bool' object has no attribute 'upper'.
This happens because the phonenumbers library tries to upper() the region but
if Odoo doesn't have a country set it passes along False. By doing a fallback
to 'None' the phonenumbers library will natively handle this and the user in
the UI does not get a traceback.
Task-2852953
closesodoo/odoo#112699
X-original-commit: 9b75d7ac1a912ff3d15c393a6a23018a18b3b9bb
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Thibault Delavallee <tde@odoo.com>
Before this commit, opening a user profile in website does not show the
tabs like About, Questions, Answers, Activity, Votes.
After this commit, it will display all the tabs in user profile.
closesodoo/odoo#112695
X-original-commit: 44cd55b5df3a08ae24e86796c69ab361f4f53fe4
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
- Install stock, purchase
- Create a product with a long name without whitespace
- Create a purchase order with that product
- Go to portal and access the purchase order
Current behavior:
- Product description overflows when accessing the PO from the portal
Behavior after the PR:
- To fix the problem in the Portal we add table-responsive to the table
opw-3133407
closesodoo/odoo#112672
X-original-commit: 5abccc5efc6e333c8a889a1c24419dadc9c6e7f0
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When a td has the `o_selected_td` class, it should be included in the
traversed/selected nodes, along with all its descendants. A syntax error
made it so that the descendants weren't in fact included.
closesodoo/odoo#112669
X-original-commit: 9f9279babbd98c343f51028fc719d7d9f1b2f887
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When selecting across table cells and changing block style, we applied
the block style to the traversed blocks which included the ones we want
to change but also their parent cell (`<td>`). This resulted in invalid
nested blocks like `<td><p><h1>...</h1></p></td>`.
task-3177014
X-original-commit: a6aff77af82066630f9d3b887beed288d2bdafaa
Part-of: odoo/odoo#112669
Steps to reproduce:
Add a record in the "Contacts & Addresses" tab of a contact.
Issue:
There are missing spaces in the information display.
Cause:
The kanban view compilation removes the spaces
(and line breaks) between the different tags.
Solution:
Add spaces on the template.
opw-3131806
closesodoo/odoo#112667
X-original-commit: 7bada7fc942cee0bcfd6447665640ee29a4b5752
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Before this commit, if the user mousedown a snippet, it would start a
timer of 1500 ms and a the end of the timer, it would show a tooltip to
help the user indicating him that he should drag & drop and not click.
The drag & drop code would (sort of) stop that timer if a drag was
detected, to not show the tooltip if the user is correctly drag &
dropping.
But it feels weird, as when you fail to realize you should drag & drop
but click instead, you only have the hint 1.5s later.
Some internal people would actually use triple click on snippet when
trying to show this tooltip, because it's probably not easy to figure
exactly what the trigger is.
The change is then made to show the tooltip directly on mouseup.
If the drag & drop code did not indicate that a drag happened, we can
safely assume it was a simple click and not a drag.
closesodoo/odoo#112666
X-original-commit: 00becd38ac5f43e2586b258d01c7af2825f75ddc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, in the partner portal, all CRM stages were displayed for an
opportunity, even the non-relevant ones.
Now, only the stages that apply to this opportunity are displayed
Task-3133070
closesodoo/odoo#112665
X-original-commit: 9b385f034058d18608c9873a8a1e8fe44e220f1e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Fixes the bug animation of the add to cart.
closesodoo/odoo#112663
Task: 2943578
X-original-commit: ef28650a94ac638676cb0ed5e14599416185faa8
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
The images of users in the livechat team were overlapping
with their ratings on the front-end page of the livechat channel.
Remove negative gutters to fix this.
task-3135733
closesodoo/odoo#112661
X-original-commit: 619a39e2f1fe50f5c76f2b54a578598e1540ef8d
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Steps to reproduce:
- Add a pubic holiday record, i.e., From 6 Feb 2023 to 7 Feb 2023
- Add a leave with the date conflicting the public holiday, i.e. From
3 Feb 2023 to 8 Feb 2023
- Regenrate the work entries and check the work entry in form view.
Current behaviour:
Missing leave_id on some work entries
Expected behaviour:
It should linked to the corresponding leave for the work entries that is
created by the leave, while public holiday work entries should keep leave_id
empty.
Explanation:
After calling contract._get_interval_leave_work_entry_type, the leaves should
be filted out the not related leaves so contract._get_more_vals_leave_interval
can get the correct vals. Otherwise public holiday will always return
{'leave_id': false} in contract._get_more_vals_leave_interval which will replace
the correct leave_id value.
closesodoo/odoo#112641
X-original-commit: 66b65074671063e762e09589c3977dec311fc9b3
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, there was a hack done in Field.js to handle
a special case of the Many2ManyTagsField which sometimes require
an additional "color" field to be fetched. This field is given in
option on the many2many field, in the arch.
It wasn't possible for the Many2ManyTags field to add that field
on its "FieldToFetch", because this object was static (it didn't
depend on the arch). This commit allows it to do so as FieldsToFetch
can now be a function that receives the fieldInfo (extracted from
the arch) in arguments.
So with this commit, fieldsToFetch can be either an array of fields
(instead of an object as before), or a function returning an array
of fields.
Part of task 3179751
closesodoo/odoo#112518
Related: odoo/enterprise#37020
Signed-off-by: Georis François (fge) <fge@odoo.com>
Conversion of the gantt view to OWL.
Along the way the UI has been changed:
- hover a pill does not make a popover appear anymore. It is now
necessary to click on the pill to make it appear. A button "Edit" in
the popover still allows to edit the pill (if edition is available).
The unused arch attribute collapse_first_level has been removed.
Technically:
- complete revamp of the DOM and class names to trim down dead code and
needless nesting;
- the gantt view now makes use of the CSS display "grid" property in
several places (most importantly in the main row container), further
simplifying the DOM and allowing for list virtualization;
- this virtualization process ensures that only visible rows (and
their related elements) are effectively rendered in the DOM. This is
done using the newly added "useVirtual" hook.
The rendering process of the new gantt view should thus be a lot quicker
as a result.
Note that the legacy gantt view is still available since its extensions
are not yet converted (through the js_class legacy_gantt).
Its class name is now o_legacy_gantt_view.
Enterprise counterpart PR: odoo/enterprise#36202
Task Id: 3105022
closesodoo/odoo#110819
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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>
Community counterpart of the enterprise commit having the same name.
This commit acts as a setup to allow for the reworked gantt view to work
properly.
Task Id: 3105022
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 adds several improvements and overall changes the way
draggable builders can be built, adding some helpers to temporary
manipulate DOM elements during drag sequences and making some changes
on the way drag callbacks are handled.
The current implementations of draggable hooks built with this feature
have been adapted.
The drag test helpers have also been reviewed to more accurately
mimick real-life scenarios and allow for more flexiblity (i.e. moving an
element to a certain point during the drag sequence before being
dropped).
Part-of: odoo/odoo#110819
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Before this commit, some QUnit asserts and test helpers taking a
"target" param (or equivalent) would try to evaluate it, among other
possibilites, as an HTMLElement.
This is too restrictive however, as all these helpers can also be
performed on 'Element' instances (querySelector, classList, etc.), which
covers other sub-classes than HTMLElement, such as the whole range of
SVG Elements.
This commit changes the checks for `instanceof HTMLElement` to
`instanceof Element` instead to allow the helpers to be used on the
whole range of native Elements.
Part-of: odoo/odoo#110819
Co-authored-by: Julien Mougenot <jum@odoo.com>
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