This PR fixes two issues:
- Incorrect write on `channel_member_ids` (trying to link guest instead
of channel member)
- Incorrect condition in `livechatService.leaveSession` that relies on
the live chat to be initialized while it can acutally be called before
if the current session is outdated.
This could result in server errors in the following scenario:
- Open a live chat
- Log in
- Open a live chat from the website app
- Log out
- Reload the page
closesodoo/odoo#137834
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
This PR fixes two issues:
- Incorrect write on `channel_member_ids` (trying to link guest instead
of channel member)
- Incorrect condition in `livechatService.leaveSession` that relies on
the live chat to be initialized while it can acutally be called before
if the current session is outdated.
This could result in server errors in the following scenario:
- Open a live chat
- Log in
- Open a live chat from the website app
- Log out
- Reload the page
Part-of: odoo/odoo#137834
Prior to this commit, when the user experienced an internet
disconnection, after few seconds the PeerToPeer connection state would
change to "closed" and the PeerToPeer connection would be removed
permanently. Consequently, when the user reestablished their internet
connection, the peers would remain disconnected to each other.
With this commit, peers are now re-connecting to each other.
task-3488166
closesodoo/odoo#138510
X-original-commit: b9d96629df5adf37f362eb63107fa5a9a6cd3e0d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The NotificationItem component has been modified to support a new slot
allowing to display some content at the right of the notification item.
It is used in this commit to display an additional 'Install button',
inviting the user to click on the notification. Note that the entire
notification is still clickable, it is only a visual indicator.
Once the notification is clicked, the installation process is triggered:
- In case the system supports the native installation prompt, we now
display it, and the user is free to install the PWA from there.
- On Apple devices, a custom popup is displayed to the user, explaining
the steps to install the website as an application, since iOS and macOS
don't support a native prompt, and won't be using one anytime soon, since
it's a design decision from their side.
Some tests have been added to mock and test the display of the notification.
patchBrowserWithCleanup has been adapted to also remove any BeforeInstallPromptEvent
for every tests by default. This allows to test without the risk of issues with
messaging tests reading the number of notifications, or clicking the first
notification item when the service checks whether the prompt can be shown
or not (depending the availability of a native prompt, the OS, or the
localStorage, etc.).
To test the service correctly, you need to patch the test accordingly.
task-3275275
closesodoo/odoo#135866
Related: odoo/enterprise#48968
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Before this commit, the status bar field could be displayed in 2 ways:
- in small screens: as a dropdown
- in larger screens: as an inline list of buttons
This commit centralizes both of these approaches into a dynamic display
that fits the available space:
- the current stage is always displayed;
- previous stages are displayed behind or contained in a dropdown if not
enough space;
- next stages are displayed behind or contained in a dropdown if not
enough space.
Task 3336856
closesodoo/odoo#124267
Related: odoo/enterprise#48706
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
UX changes to improve the visibility of skills related features
in hr applications:
- install skills by default with HR
- custom button for skills history
- new skills demo data
- inline create for skill type form
- better skill add ux for employee
- no skills --> redirect to skill types form
task 3334909
closesodoo/odoo#122509
Related: odoo/upgrade#4848
Related: odoo/enterprise#43235
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Case:
- create a PO for 3 units of product A
- validate and open the receipt picking
- put 2 in quantity done, validate
- do NOT create a bacjorder
- return on the PO, put 2 in ordrered quantity field
- save
Issue: a delivery picking is created for the 1 unit that was removed from the PO
Before, product_uom_qty was changed on stock move at validation to match quantity_done.
Now it stays the same so another value has to be used in _get_qty_procurement for 'done' stock moves.
This fix ensures that the correct quantity is used depending on the state of the stock move.
closesodoo/odoo#138732
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Case:
- create an SO for 3 units of product A
- validate and open the delivery picking
- put 2 in quantity done, validate
- do NOT create a backorder
- return on the SO, put 2 in ordered quantity field
- save
Issue: a return picking is created for the 1 unit that was removed from the SO
Before, product_uom_qty was changed on stock move at validation to match quantity_done.
Now it stays the same so another value has to be used in _get_qty_procurement for 'done' stock moves.
This fix ensures that the correct quantity is used depending on the state of the stock move.
With that, the float_compare in _action_launch_stock_rule will correctly redirect to continue if necessary.
Part-of: odoo/odoo#138732
Prior to this commit the knowledge icon from the same dropdown was
turned into an inline-svg but the dashboard one was not.
This commit aims to use an inline-svg for that icon and ensure it
renders correctly.
task-3072562
closesodoo/odoo#138279
X-original-commit: 4df55bbc7bfe0bbe62605cd88887d45460814964
Related: odoo/enterprise#48734
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
The aim of this commit is to improve the impact and rendering of app
icons in bright and dark mode. It also reduces the size of svg files.
To achieve that, this commit updates the colors to flat colors. This
change will make the icons stand out and improve their readability.
task-3072562
X-original-commit: 667a19162b74fb6554a2389ba9c6e69de4ff5113
Part-of: odoo/odoo#138279
Previously, when a table was selected on a floor plan other than the
first, clicking on back brought you to the first floor plan, not the
one of the previously selected table.
Now, when you click on the back button, you return to the floor plan
corresponding to the previous table.
Also, the order number is now displayed on the floor screen button.
closesodoo/odoo#138013
Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
The problem is that a mandatory field from the sale module has been
added to the ProductAttributeCustomValue template, but in point of sale
we also use this model without necessarily filling this field.
Previously, the sale module was the only module to use the
ProductAttributeCustomValue model (product.attribute.custom.value).
In the override, a field set to mandatory has been added
"sale_order_line_id", a relationship between the sale.order.line model
and product.attribute.custom.value.
We now remove the mandatory parameter from this field so that we can
create new data without getting an error indicating that a mandatory
field is missing. This has no impact on the operation of the Sale module
as this field will be populated anyway, since the only way to create a
record of this type is via a sale_order_line or a pos_order_line.
Part-of: odoo/odoo#138013
Before, when ordering on the kiosk/mobile, no confirmation page was
displayed, only a notification.
Now, a confirmation page displays the tracking number, the amount paid
and, if present, the customer's table...
Part-of: odoo/odoo#138013
Delivery dates on invoices are a legal requirement on germany. It needs to be
displayed on the header of the form view and will be displayed on the printed
invoices.
closesodoo/odoo#127168
Task-id: 3383318
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Ensured that the reduce function returns the accumulator even when
encountering 0 price lines. This prevents the function from breaking
on subsequent iterations due to receiving 'undefined' instead of the
expected array.
opw-3528223
closesodoo/odoo#138702
X-original-commit: ab2ed83f05d93732b0f6879ab3ca3df86213f6a2
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Before this commit: we assumed an event's recurrence only contains
RRULE, and we were getting the RRULE from the first element in the
list. But it could have EXRULE, RDATE, and EXDATE, so in this case,
the first element could be other items.
The solution is to iterate through all items and return the RRULE.
opw-2797968
closesodoo/odoo#138697
X-original-commit: f2a20457b352026c2dfb50f6a4d48d47211708f9
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
With the option "Reception Report" enabled, a batch may contains
done and ready pickings, which is inconsistent
To reproduce the issue:
1. In Settings, enable Reception Report
2. Operations Types, edit Receipts:
- Show Reception Report: True
- Automatic Batches: True
- Group by: Contact
3. Create two products P1, P2
4. Confirm a delivery with P1
5. Confirm two receipts, one for each product, both with partner P
- It should create a batch
6. Partially process the receipt with P1, with backorder
- It should open the reception report because of the delivery
7. Open the batch
Error: The first receipt is done but is still part of the batch and
the backorder is not attached to it. Worst: if the user now tries to
confirm a third receipt with the same partner, he will got an error
because of an inconsistency with the batch
[1] is incorrect. The code assumes that if `res` is not `True`, there
was an issue with the picking, so it's better to immediately return
`res` without analyzing the batch. However, sometimes `res` can be a
`dict` even when the picking has been processed correctly. This is the
case here: the receipt is marked as done, but we return an action to
open the reception report.
As a result, in the above case, we directly return the report action,
and we don't analyze the batch consistency (i.e., we don't remove
the done receipt and add the backorder). Then, because of the batch
inconsistency, the user is blocked and can not validate another
receipt.
[1] 0c7122d416a3669d1d42f66bef5b397e8b36a91b
OPW-3346255
closesodoo/odoo#138690
X-original-commit: d92c5a594e57cb2574bcf87ab398919c07c9a738
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
This commit improves the live chat bundles:
- `core`
- `common`: hold files that are common to every feature
- `web`
- `standalone`: hold files for the embed live chat and is splitted
in 4 sub-bundles:
- `common`
- `frontend`: should only be added in the Odoo frontend.
- `external`: should only be added outside of Odoo
environment (e.g. support page).
- `cors`: should only be added when the live chat
is requested from a different origin.
This will make live chat folder structure closer than the one used
in mail and avoid code duplication.
task-3537697
closesodoo/odoo#138536
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
1. sudo permission for _totp_check
env.user is still public user which doesn't have access rights for self.login
in Odoo 15 it was not a problem since self.login was in cache
but in Odoo 16 it is not and as a result, returns an access error
2. format_timedelta
the lang was used for `granularity` as the second argument not for `locale`
closesodoo/odoo#138532
X-original-commit: d439fae7a27874ceeaab99cc4db5d28fcbe587c2
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Signed-off-by: Chong Wang (cwg) <cwg@odoo.com>
Steps to reproduce:
1. install l10n_br and set up a Brazilian company with Brazilian
customers
2. go to validate a sale as a Brazilian customer
3. fill in the CPF field w/ 11 digit number
4. error: "invalid CNPJ. Make sure that the CNPJ number is 14 digits"
Issue:
the code only accepts and validates CNPJ codes
Fix:
add support for CPF codes with its validation function according to:
http://www.receita.fazenda.gov.br/aplicacoes/atcta/cpf/funcoes.js
opw-3421476
closesodoo/odoo#137438
X-original-commit: 23a0ca6386590b6dfdbe24602a1a717bfdd84965
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
Steps:
- Install project.
- Create a project and it's task.
- Share this project to portal user with editable rights.
- Open that project from portal user.
- In task description, using `/image`, add one image.
Issue:
- There comes an Access error:
Sorry, you are not allowed to access this document.
Solution:
We are passing `'allowCommandImage': false, 'allowCommandVideo': false,
'allowCommandFile': false}` so that portal user can't have the /image and
related options.
task-3463461
closesodoo/odoo#136799
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Purpose
=======
The goal is to be able to have a hierarchy view to see the organisation of a company, that is, to have organisation chart for `hr.employee` model.
To do that, a new view will be introduced in `web_hierarchy` module, called `Hierarchy` view and it will first be used in `hr_org_chart` module for `hr.employee`, `hr.employee.public` and `hr.department` models.
Implementation details
----------------------
- A new python method will be introduced in the models when `web_hierarchy` module is
installed. That method, called `hierarchy_read`, is created to fetch the data for the
hierarchy view when the view will be loaded.
- The definition of hierarchy view is inspired to the definition of the kanban,
that is, a template called `hierarchy-box` has to be defined in the arch to draw the card
displayed in the node of the hierarchy view.
- Some attributes can be defined on the `hierarchy` tag:
- `parent_field` (default='parent_id') contains the parent field name
to use to fetch the parent record and to be able to fetch the hierarchy.
- `child_field` (optional attribute) contains the child field name
to use to find the child records (it is in fact the one2many field).
If that field is defined then some queries can be avoided since we
directly fetch the children when a read/search_read is done.
- `icon` (default='fa-share-alt o_hierarchy_icon') icon displayed inside the
`Unfold` button (to show the child nodes) in hierarchy node.
- `draggable` (default=False) True to allow the user to drag and drop a
node (= record) into a row or another node to update its parent node.
task-3376776
closesodoo/odoo#131162
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit adds a stat button in the form view `hr.employee` model
to be able to go to the org chart and visualize the hierarchy of
the current record displayed in the form view.
The action used inside that stat button cannot have a domain to filter
the result to just have the current record since the user will not
be able to search into the search view. The alternative is to use
a context used inside the hierarchy view to add the domain only when
we load the view (as it is a default domain).
task-3376776
Before this commit, when the user unfolds a node to display its child
nodes, if that node unfolded has some child nodes then it could be
difficult for the user to clearly see the hierarchy.
This commit adds an opacity to 50% for the sibling nodes when the user
unfold a node in the same row.
task-3376776
Before this commit, when the user unfold a node in hierarchy view,
he has to scroll to be able to see the child nodes added.
This commit adds an auto-scroll when a new row is added to directly
show the child nodes added on the view when the user unfolds a node
in the hirarchy view.
task-3376776
This commit adds a new menu called `Org Chart` in Emnployee menu
to directly have the Org chart view as first view when the user
clicks on that button.
task-3376776
This commit allows the user to drag and drop a record (hierarchy
node) into another one to set the one hovered as the manager of the
one dragged. It also allows to drag a record into a row to define
the manager of the row as the manager of the record dragged.
This commit also adds an new attribute on `hierarchy` tag to use
when we define that view for a certain model to enable the drag and
drop feature.
task-3376776
Before this commit, the icon displayed inside the Unfold button with
the number of child nodes is the default one. In the employee hierarchy
view, since the child nodes are obviously employees, the icon could
be the one displayed users (`fa-users`).
This commit adds a new attribute called `icon` on `hierarchy` tag
to be able to define another icon displayed on that button. By
doing that, the icon displayed inside employee hierarchy view can
changed to have the one expected and more relevant.
task-3376776
Before this commit, the user can unfold a node in hierarchy view but
before clicking on it he cannot know how many child nodes there are.
This commit adds the number of child nodes in the Unfold button with
the default icon.
task-3376776
Before this commit, the icon of the hierarchy view should be rotate
of 90 deg to have an appropriate icon for the view. The problem is
since the icon class is added on button classes, the button will
also be rotated with the icon instead of just the icon.
This commit defines a `i` tag inside the `button` element to select
the view to be able to apply css rotation only on the icon instead
of the whole button.
task-3376776
This commit extends the kanban compiler for the hirarchy view. Some
changes has been done in the kanban compiler to be able to reuse the
existing code.
task-3376776
This commit adds a new view called hierarchy view, that view allows
the user to visualize a hierarchy in a model. For instance, that view
could be used for `hr.employee` to easily visualize the hierarchy
inside the company (the manager and his employees) as an Organization
Chart.
That commit introduces a new method for the hierarchy view, called
`hierarchy_read`, that method will be when the view will be loaded
to get the initial data to display.
Some details for the definition of that new view:
------------------------------------------------
Some attributes can be defined on the `hierarchy` tag:
- `parent_field` (default='parent_id') contains the parent field name
to use to find the parent record of the current to build the hierarchy.
- `child_field` (optional attribute) contains the child field name
to use to find the child records (it is in fact the one2many field).
If that field is defined then some queries can be avoided since we
directly fetch the children when a read/search_read is done.
Inside the `hierarchy` tag, the fields to read can be added and then
a template as to be defined as we do when we define the kanban view.
The template to create is called `hierarchy-box` and that template
will be used to display the card inside a node in the hierarchy view.
task-3376776
Before this commit, the hr presence status icon is hardcoded in
each view in which the icon is needed.
This commit creates a widget for that icon to be able to use that
widget in the views in which the icon is needed to avoid duplicating
the code.
task-3376776
Before this commit, when search menu is not displayed in the
search view, then the border right is missing.
This commit removes `border-end-0` class added in the search view
to always have a border. Even with the search menu, it does not
seem to have an extra border.
task-3376776
Before this commit, `child_of` operator is managed in the mockServer
but not the `parent_of` one.
This commit manages `parent_of` operator in mockServer to be able
to find the record when the domain used contains that operator
task-3376776
This commit introduces 3 new inner snippets: button, image and video.
What sets these snippets apart is that, once dropped onto the page, they
transform into basic HTML code, just like if they were created using the
editor (no data-snippet etc).
task-3248881
closesodoo/odoo#126717
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: bvr-odoo <bvr@odoo.com>
In commit [1], the Banner snippet has been redesigned in order to be
in grid mode by default, to highlight some cool features of the editor.
However, some grid classes and attributes are missing or not well set:
- the first column has a `g-height-4` class despite having 8 rows: this
causes the vertical resize to not work correctly.
- the row does not have the `data-row-count` attribute, which is needed
to display the background grid correctly.
This commit fixes this by replacing the class by `g-height-8` and adding
the `data-row-count` attribute, which is set to 11 rows.
[1]: https://github.com/odoo/odoo/commit/3cbdf754ff8fac8a77887c4307b658cb86b0be1d
task-3369695
closesodoo/odoo#136683
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, toggling the "Text Cover" snippet to grid mode did
not produce a good-looking result: the column containing the background
image loses all its padding and therefore appears smaller and shifted
compared to the normal mode.
This commit adds a background color to the image column. Indeed, with a
background color, and more precisely thanks to the `o_cc` class, the
padding is taken into account when computing the grid items size, making
them look similar to how they were in normal mode.
task-3369695
Part-of: odoo/odoo#136683
The `display: grid` property allows to modify the spacing (or gaps)
between the rows and columns of the grid with the `row-gap` and `column-
gap` CSS properties. When the grid mode was added with [1], these
properties were deliberately ignored and the gaps were forced to 0px.
This commit adds the "Spacing (Y, X)" option that allows to modify these
grid gaps. A grid preview is also added when using this option, in order
to visualize what is being changed in the grid.
[1]: https://github.com/odoo/odoo/commit/cc406afcea7bf5846233a9f97a4a8ac5f618f3ec
task-3369695
Part-of: odoo/odoo#136683