Purpose of this PR to improve generic usage of project app.
So, in this PR done following changes:
- In project.project form view :
- Divided settings into sections
- In project.update.search.view :
- Added author, description and status in quick search
- Added ancestor task in group by and replaced parent task with ancestor task
in search view
- In project.task search View:
- the filter for unread messages should be visible only if the current user
managing his notifications in Odoo
- Added my private task filter
- In project_task_view_graph
- Added a default project > stages group.
- In project.task form view:
- If stage is_closed added decoration-muted
- Replace/Add parent task with ancestor task' in group by and quick search
- analytic-tags set on project should be automatically applied to it's tasks
task-2844212
Part-of: odoo/odoo#93676
If you insert an odoo chart, match a filter with one of the
chart field, then delete the chart
=> the field matching is not removed and is still exported
The same goes for pivot and list matching when they are removed
closesodoo/odoo#100390
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
This commit removes the 'bg-white' and 'pt-3' classes used in
the Notebook template since commit https://github.com/odoo/odoo/commit/68f1c90a031a7c2f751d9c8eca7ff525e9f7e206.
Now that the component is used by other components, such as the
media dialog from web_editor, it is not appropriate to add such
style in the core component.
Also, removing the bg-white class has no concrete effect in form
views, so it can be removed safely.
closesodoo/odoo#100253
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, following this flow:
- Drop a text_image snippet,
- Upload images from the media dialog,
- Change the image to an icon,
- Double click on the icon to open the media dialog again,
- Click on the 'image' tab
- The previously uploaded images are not correctly sized
To fix that, the media dialog component template is changed: instead of
rendering all the tabs and hiding the inactive ones, it only renders
the active one. This way, the images are correctly sized at all time.
Since commits [1] and [2], the design used by tabs and the Notebook
component is more consistent, which allow us to replace that part of the
template by the component.
The Notebook component receives the list of pages to render, and will
generate the right subcomponents in the content part of its template.
[1]: https://github.com/odoo/odoo/commit/68f1c90a031a7c2f751d9c8eca7ff525e9f7e206
[2]: https://github.com/odoo/odoo/commit/ff0b2d441252560a076a3609d81c369f0ce42d19
Part-of: odoo/odoo#100253
This field is needed in l10n_mx_edi, as the dependency of a computed field. However, this module only depends from account_accountant, not account. The field thus needs to be moved to a more generic place.
closesodoo/odoo#100281
Related: odoo/upgrade#3804
Related: odoo/enterprise#31375
Signed-off-by: Laurent Smet <las@odoo.com>
Scenario:
Open a record that is invalid in database (a required field is
empty), and click on the pager to go to another record.
Before this commit, we prevented the user from leaving the record,
marked the field as invalid and displayed a notification. This is
a weird UX experiment, since the user changed nothing (he did not
even enter edit mode). In this situation, since the record hasn't
been modified, the user should be allowed to leave. This is how
the legacy form view behaved.
closesodoo/odoo#100442
Signed-off-by: Géry Debongnie <ged@odoo.com>
Following https://github.com/odoo/enterprise/pull/31202, it happens that the query for the contract history returns several times the same id if the employee has several contracts.
This commit fixes it by adding a DISTINCT to the SQL query so that ID returned are unique.
task-2974531
closesodoo/odoo#100027
Related: odoo/enterprise#31202
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The tour test_01_admin_widget_x2many was failing because of a missing
discussion. This discussion was in fact coming from a patch
during at install tests
This wasn't detected on runbot during merge since at_install and
post_install are executed in different builds. This was detected
during the nightly "all no auto tag" build.
Simply use a proper patch to avoid keeping the default value at the
end of the test.
closesodoo/odoo#100491
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Before [1], only string channels were allowed for polling. This
ensured no one could send a server-side channel from the frontend,
this PR restores this behavior.
[1]: odoo/odoo@a5623d2closesodoo/odoo#100309
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Steps to repoduce:
- create a customer with a private address (first select "individual" to show the selection field)
- create a quotation (and/or invoice) and select this customer
- this customer cannot receive an email and cannot be contacted afterwards (this behavior is intended)
Issue:
- it's possible to choose this type of client
Cause:
- there is no address type filter for this field
Solution:
- add a condition in the domain of the field
opw-2909395
closesodoo/odoo#100487
X-original-commit: a24384b7ede2a132125d24681cba7056bc64ccbe
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
Since [1], a call to getView no longer returns the all models the
list of all their fields, because a lot of them aren't necessary.
However, it caused an issue in the following situation:
- have a form view with an x2many displayed as a list
- in the list, have a field using the widget many2many_tags
along the color_field option
- in the arch, the x2many form view isn't inline
list must be present, without the color_field option,
and the color field must not be present,
- in readonly mode, the user clicks on a row, which will open
the x2many form view
- since the form view isn't inline, a call to getView is done
- in the returned form view, the color field isn't present,
the field using many2many_tags/color_field in the
list is present, and without the color_field option.
Since [1], it crashed at this point because A wasn't part of the
known fields in the form view (but it was in the fieldsInfo,
since they are shared between the x2many list and form).
This commit fixes the issue by adding the color field not only
in fieldsInfo, but also in fields.
[1] odoo/odoo@4636620004closesodoo/odoo#100479
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
When we were loading pricelists for POS, we were putting the
base_pricelist of an item in it. It comes from the prveious
implementation on javascript side when it was the reference to the
object that was shared.
As we have put it in python in a dictionnary and we need to serilize the
data.
We also only take the fields we need in POS
ISSUE-2968489
closesodoo/odoo#100425
X-original-commit: f15ac2b2688f68a049cdaa0580bb54f1e7784cab
Signed-off-by: Masereel Pierre <pim@odoo.com>
This commit also adds the necessary tests in oder to ensure that
`timesheet_uom_factor` is taken into account/ignored in the right widgets.
task-2974145
closesodoo/odoo#100378
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Changes made in #98380 were missing an extension on the factor
computation although already used.
This commit introduces the needed extension.
task-2974145
Part-of: odoo/odoo#100378
Oversight in odoo/odoo#100376
The web client sends `list` rather than `tree` when requesting
views.
However, once they went through `get_views`, they are converted back
to `tree`.
https://github.com/odoo/odoo/blob/master/odoo/models.py#L1653
So, here, we should check against `tree`, not `list`.
Could be seen in Lunch > Manager > Today's Order.
With the `id` field missing, an error is raised
```
Uncaught (in promise) Error: The following error occurred in onWillStart: "field is undefined"
```
closesodoo/odoo#100474
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Before this commit, when trying to create or edit a product from
add a line and open the 'Create Product' popup, the label 'Sales Price'
is not visible.
This issue happened due to this commit
https://github.com/odoo/odoo/commit/46526f629f7645eaac8ce86e81e806cfa392b8b8
Due to the above fix, in the product template, the label for the
list_price field becomes invisible. So here we replaced it with
a label of the lst_price field.
task-2983733
closesodoo/odoo#100197
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Adds a new option to display whether VAT is included/excluded next to
the price on product pages.
TaskId-2906053
closesodoo/odoo#99628
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Due to the new way of handling qweb assets, one file was missing from
the editor bundle, throwing a traceback when clicking on a product in
the product grid.
closesodoo/odoo#100477
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
The colspan attribute was missing for the form view making it look like
there was a label for the org chart widget, which should not be there.
closesodoo/odoo#100469
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Printing an invoice no longer saved the ir.attachment on the
move.
This is due to the refactor in ffc525419a,
since the render methods are now `api.model`, `self.attachment` was always
Falsy. To get the attachment name of a report, we need to call
`self._get_report(report_ref)`.
closesodoo/odoo#100363
Signed-off-by: Laurent Smet <las@odoo.com>
Due to how drag and drop works in grouped kanban views now, no event is
triggered when dragging and dropping, this fix listens to mousedown in
order to define whether the element is going to be dragged.
Part-of: odoo/odoo#98837
The progress bar parsing code was inside a big block of code making it
impossible to override to add custom behaviour.
It is not in a separated function.
Part-of: odoo/odoo#98837
Use the `prefix` slot to give a prefix to KanbanAnimatedNumber, making
it possible to add text while not needing to extend the class/template.
Part-of: odoo/odoo#98837
The generate coupon button would appear after the export button prior
to this commit.
closesodoo/odoo#100463
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Supplier invoice demo data was badly initialized with sales taxes. This
was given problems in some VAT reports. Fixed and they are all purchase taxes
Document type "Despacho de Importación" xml id demo_despacho_1
closesodoo/odoo#100327
Signed-off-by: Josse Colpaert <jco@odoo.com>
When a module extends model 'base', the database schemas of all models are
checked, including indexes. And a log message appears for "unexpected index
mail_message_subtype_id_index on table mail_message_subtype". The index indeed
exists, but not for the table mentioned in the message. The ORM actually makes
a confusion between:
- the index mail_message_subtype_id_index for subtype_id on table mail_message
- the index mail_message_subtype_id_index for id on table mail_message_subtype
The fix consists in logging the message about the unexpected index only if the
index is on the expected table.
closesodoo/odoo#100297
X-original-commit: fe8d0024897208e876f097564d50e6795df2c1d3
Signed-off-by: Raphael Collet <rco@odoo.com>
Steps to reproduce:
- Accounting > journal entries > misc
- add entries (draft) with empty journal name
- resquence those entries with entries that have names
Bug:
calling min or sort on the names fails when some are strings and others
are bools (False for empty strings)
Fix:
replace names that aren't set with an empty strings
opw-2957750
closesodoo/odoo#99772
X-original-commit: 0f90852818a334d66ed8a6781f5abdc022f76ff7
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
On the employee page, the employe's remaing leaves
were computed using the allocations. Now that leaves
and allocations are not linked directly, the value
needs to be computed differently.
task-2971148
closesodoo/odoo#100458
X-original-commit: adc29a685ed934f45f8c4bbc482866e8a4f49471
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Issue:
When creating time off timesheet from the timesheet app,the newly
created timesheet is connected to a leave request while it shouldn't
be linked to any leave request and in consequence you can only delete
this new timesheet by deleting the leave request.
Explanation:
To create the new timesheet timesheet_grid makes a copy of another
timesheet on the same line and that makes that the holiday_id (used
to link timesheet and leave request) is also copied.
Solution:
When copying a timesheet the holiday_id is not copied
opw-2951062
closesodoo/odoo#100211
X-original-commit: e1e6ba48bb43ebfe9644368287f9bdf2fd1d561c
Related: odoo/enterprise#31347
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Check state before execution in _set_pending()
When using webhooks, _set_pending() can be called two times (when the
user comes back and when the webhooks notify the db). To avoid doing
the same treatment twice, we add a check in _set_pending to see if the
transaction is not already pending before doing anything else.
Part-of: odoo/odoo#100186
When payment providers receive a notification from a webhooks and log
something in the chatter of transactions, sale orders or invoices, the
message is shown as from 'Public User'.
Now, all messages will be logged as 'OdooBot'.
Part-of: odoo/odoo#100186
In hr_holidays, the banner disappears when the number of days taken is more than the days allocated.
Also, the count of the days is based on all existing allocations.
This commit fixes the banner by allowing to display negative days remaining when there are more days taken than days allocated.
It also fixes the count of the days by couting days only for active allocations.
task-2983188
closesodoo/odoo#100452
X-original-commit: efb351f86a3645ad292fdaaa6b223ff80096b63c
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
Since https://github.com/odoo/odoo/pull/76722, it is possible to cancel an approved time off.
However, the calendar event created when the leave is validated is not archived when the leave is cancelled.
This commit archives the calendar event when the leave is cancelled.
task-2965754
closesodoo/odoo#100413
X-original-commit: d292891997a378578e072cfb01bba612501aa82a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: phwa-odoo <phwa@odoo.com>
Before this commit, when a record from a relational model would start to
load, it would empty its `data` object. The issue is that a rendering
process can be initiated right after a record started loading. In kanban
views, this causes a crash since all records are always assumed to
contain values in their data objects.
This commit takes care to only clean strictly unwanted data when loading
a record instead of removing all the values, ensuring that records
always contain data.
closesodoo/odoo#100414
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Fields param is actually not a kwargs. This cause a stack trace when opening a chat window (other than a chat with yourself) from a Kanban user avatar icon.
closesodoo/odoo#100315
X-original-commit: 95d3f4b0ea4dd5f1f9403b6e5ba97e1e2a510f65
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit, on compiling the field, a search is done to find the
label to link to the field. To do this search, the following field's
attributes were used: the `id`, which is encoded on the arch of the
view; if the `id` wasn't set, the `field_id`, which is an internal
technical attribute, is used, and if neither of these were set, the
'name', which is also encoded on the arch, attribute is used. These
attributes are compared with the content of the `for` attribute on the
label.
The issue with this, is that as the `field_id` is an internal technical
attribute and could never be found on the view arch, neither on the
content of the `for` attribute on the label. Leading to empty labels, or
labels linked to the wrong fields. This principally occurs when two
fields with the same name are found on the view.
Now, only the `id` attribute and the `name` attribute, which both can be
found on the view arch, are going to be used to search the correct label
to link to it's corresponding fields.
closesodoo/odoo#99399
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*: auth_password_policy, bus, calendar, event, mass_mailing, stock,
survey, web_editor, web_tour, website, website_event, website_forum,
website_mass_mailing, website_sale
This commit is a first step towards a potential deletion of the
assets_common bundle, although that step would need more work, specs and
discussions as some layouts kinda only use the assets_common bundle
(some take the full assets_common but parts of the assets_backend one
for example).
The main goal of this commit is to have the assets_frontend bundle
directly include the "common" files we need. As a first step, this
commit only blindly duplicates them all into assets_frontend (without
removing the potentially useless ones). The goal is to have those
advantages:
- Reaching a frontend page only calls two main JS files (one normal and
one lazy-loaded) instead of 4 (two normals and two lazy-loaded). This
may help reach a better google page speed (which is becoming more and
more strict).
- The frontend CSS is built as one: the common SCSS which was using
bootstrap variables, or even Odoo-based SCSS added by mistake in
common instead of both backend and frontend is now computed with the
right bootstrap customizations. E.g. the tempusdominus datetimepickers
use bootstrap grays... after this PR, they use the right grays as
customized by the user on the website.
It was also chosen to not have a common "sub-asset" which is included in
assets_frontend. Making assets_frontend completely independent makes
sense (as it probably will for other "main" asset bundles): we can focus
on adding the files each layout needs without the need of worrying if it
impacts unrelated layouts. Sub-assets (when not strictly necessary) is
also a source of errors: extending the "main" bundle instead of the
right sub-asset it may use (like it was the case with the sub-assets of
assets_common: _assets_common_scripts and _assets_common_styles as
explained in the previous commit). So this is indeed a small drawback of
not factorizing the code for the inclusion of "common" files in bundles
but it seems more explicit and easier to maintain that way. Note that
adding "common" file is not the most common usecase anyway, apps
generally only need files in backend or frontend.
The __manifest__ declaration will also likely evolve in more and more
uses of wildcards to match entire directories. In the future, adding
"common" web-app files in both backend, frontend and other "main"
bundles could just be about one line duplicated into each bundle.
closesodoo/odoo#100314
Related: odoo/enterprise#31394
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
The "web._assets_common_scripts" and "web._assets_common_styles"
sub-assets were useless, confusing and prone to errors. Especially with
the refactoring done by the next commit in this PR where common files
will be put directly inside the frontend bundle.
Indeed, their standard purpose was only to be included in the
"web.assets_common"... but making them sub-assets suggests you could
reuse them for something else... which you actually could not since most
"web.assets_common" extensions by other apps were done in the main
bundle directly instead of the correct sub-assets one.
Part-of: odoo/odoo#100314
Currently the exception is not logged using the logger meaning that the
only indication of the failure is the "module not loaded" error message.
Catching the exception to log it the proper way will help identifying
the cause of the issue, mainly for uninstall tests.
closesodoo/odoo#100431
X-original-commit: b16f850d9aa438aea91b8cbd7c33692e1e1b2f90
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Emptying the domain should be setting it to False, not empty string,
which is saved in DB as such.
This was not problematic at all before but since [1] the domain must be
unique. As we removed the "multi website by domain" feature, we then
were able to add that constraint.
But since then, having two website with domain == '' would raise the
constraint error, while null values (False in python) would not.
[1]: https://github.com/odoo/odoo/commit/507db4e179514d171ec82e8ea0cbaf2323a6c30d
runbot-5041
closesodoo/odoo#100430
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>