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
In the grid mode code, the code managing the transformation of a grid
item into a normal column (when it is dropped or when we toggle the
normal mode) is repeated at several places.
This commit fixes that by creating a function doing this conversion
instead.
task-3369695
Part-of: odoo/odoo#136683
Before this commit, when using a `we-input`, there was no way to easily
specify the min and max values that could be entered in the input, which
could be useful when too low/high values could break some behaviors, for
example.
This commit adds the support for the `data-min` and `data-max` data-
attributes in `InputUserValueWidget`. More precisely, when these
attributes are added on a `we-input`, if the user writes a value smaller
than the `data-min` or bigger than the `data-max`, the value snaps to
these bounds. When using the arrows, the value cannot be decreased/
increased beyond them either.
task-3369695
Part-of: odoo/odoo#136683
Co-authored-by: qsm-odoo <qsm@odoo.com>
When cloning a snippet, if it had some previews displayed, the previews
may be cloned with it. This is not a good behavior because the clone
is a new snippet so it should not have all the preview classes that were
added when editing. Moreover, these previews could also cause bugs.
To solve this, an idea could be to call the `cleanForSave` function of
all its options before cloning the snippet. But the problem is that in
some options, the `cleanForSave` function does more than simply clean
the UI (as it was originally supposed to) and so it cannot be used for
that purpose only.
As a solution, this commit adds a new function called `cleanUI` whose
exclusive purpose will be to clean the snippet UI. In the future, it
will replace the `cleanForSave` function.
task-3369695
Part-of: odoo/odoo#136683
Co-authored-by: qsm-odoo <qsm@odoo.com>
Similar to d2edee2f6a6
Before this commit, web crawlers may endlessly index pages with tags,
the number of combinations were very large very quickly and could lead
to thousands of requests
opw-3525473
closesodoo/odoo#138718
X-original-commit: 953ac4bde2258d31c2d2f3f6233fb00c802b6e7f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Followup of odoo/odoo@eb7a32c31c, on large database with lot of
account.move computation still take certain amount of time and database
resources.
This commit limit the computation of `days_sales_outstanding` only
to the commercial partners that we need.
Note: the field is only shown in the Partner form view, so most of
the time we were only computing it for a single record
| Before | After |
|--------|-------|
| 900ms | 20ms |
opw-3530408
closesodoo/odoo#138703
X-original-commit: f968ea2898d7ce314fd575da5446b0dd9d711524
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
This commit modifies the "New Page" dialog so that it displays a list
of page templates to pick from in addition to the possibility to create
a blank page.
task-3381714
Part-of: odoo/odoo#126719
Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
This commit adapts the configurator so that the pages it generates are
composed of the primary templates generated from the manifest by the
previous commit.
task-3381714
Part-of: odoo/odoo#126719
This commit is a preparation for the new page from template feature.
In order to make it possible for new page templates to be customizable
at several levels from themes, it was decided to create several layers
of primary templates.
Those templates are build from the descriptions found in manifest files
under the new `new_page_templates` key.
The same principle is also applied for configurator pages (described in
manifest files under the `snippet_lists` key) because we noticed that
some of the changes that were made in themes for some blocks were not
supposed to impact the "drag'n'drop" version of the block, but only
the version used inside the pages generated by the configurator. (E.g.
connecting shapes between blocks)
The manifest entries now have the following structure:
```py
'snippet_lists': {
'somepagename': ['s_block_name', ...],
},
'new_template_pages': {
'somecategoryname': {
'sometemplatename': ['s_block_name', ...],
},
},
```
This commit finds those entries in the manifests and creates the
following primary templates:
- `s_block_name`: already exists, this is the block that is drag and
dropped using the website builder
- `configurator_s_block_name`: specialization of `s_block_name` used in
all pages generated by the configurator
- `configurator_somepagename_s_block_name`: specialization of
`configurator_s_block_name` for that specific page
- `new_page_template_s_block_name`: specialization of `s_block_name`
used in all new page templates
- `new_page_template_somecategoryname_s_block_name`: specialization of
`new_page_template_s_block_name` used in new page templates of that
specific category
- `new_page_template_somecategoryname_sometemplatename_s_block_name`:
specialization of `new_page_template_somecategoryname_s_block_name` for
that specific template
For the template pages defined in `website` it also creates primary
templates that assemble `t-snippet-call`s of the most specific block
templates. Those templates are named
`new_page_template_sections_somecategoryname_sometemplatename`.
task-3381714
Part-of: odoo/odoo#126719