Steps to reproduce:
- Install Documents App.
- Inside Documents, upload a html file.
- Download the file.
Issue:
We won't be able to download the file because an error is raised. This
is because we are blocking every document that has a mimetype of
"text/html" as it is the same mimetype as i.e JSON errors.
Solution:
We can get the headers and try to get the filename of the file without
error even if they are not available, so normally the errors won't have
a filename, so we check that the mimetype is "text/html" and that we
have a proper filename for the file.
opw-3231102
closesodoo/odoo#118990
X-original-commit: bb6ae580dbcc6c46ffa8f89f95c372d8fb9e3a07
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
In order to ease the creation of survey, we simplify the option form in survey
by adding a new field survey_type in survey_survey. Thanks to it, we only
display relevant options in the form depending on the survey type chosen.
We also adapt the "no content helper" which help the user to create his first
survey with an example for each survey type (mostly a renaming).
Technical note: in hr_appraisal, the added survey type is used instead of the
field is_appraisal, which is removed as we don't need it anymore. The value of
the field is_appraisal is used during the upgrade to set the survey type to
appraisal when that field is true.
When changing the survey_type, some fields are updated to guide the users. For
some fields, we also set them in readonly. But in that case, the updated value
is not saved. That's why we have added the force_save="1" attribute for those
field in the form.
Task-3061869
closesodoo/odoo#115297
Related: odoo/enterprise#38268
Related: odoo/upgrade#4464
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
We allow edition/creation of domains with a domain selector via the
search bar facets or the menu "Add Custom Filter".
The domain selector has also been improved and now support expressions
and a new operator "between" for some field types (those for which <=
and >= are valid operators). We also improve the support of the connector
not.
Task ID: 3063564
closesodoo/odoo#112326
Related: odoo/enterprise#37715
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
Some reports require editable expressions to accept other inputs than just a float.
This commit adds support for a string or a boolean.
For string input, we need to specify that formula='text', figure_type='string'.
Boolean input: figure_type='bool'.
task-3098957
closesodoo/odoo#110692
Related: odoo/enterprise#36150
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Steps to reproduce:
- create an expense product, re-invoice: "at cost"
- create a sale order with the product and set an analytic account
- create a purchase order with the expense product and the same analytic account
- create the bill
-> a new line on the SO is created with the same "Quantity Delivered" as the "Quantity Invoiced" for the purchase order
- for the bill, create a Credit Note of x unit
-> the purchase order has the Quantity Invoiced diminished of x
Issue:
- the Sale Order has not taken into account the new quantity after refund
- Since the line is an "analytic" one, the quantity delivered cannot be changed even if we wreate a credit note for the invoice
Solution:
During the processus of creation of new analytic lines, instead of creating new so lines we adapt the analytic line
closesodoo/odoo#120660
X-original-commit: 5258e2ce7d2df915eff02218636aa3272a7d9faf
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
On small viewports, and with the "Same as desktop" option enabled on
header, The "autohide menu" adaptation is disabled and overflowing
menu items are visible.
The goal of this commit is to fix this behaviour by keeping the
"autohide" feature enabled on expanded navbar.
task-3261909
closesodoo/odoo#120430
X-original-commit: 4703ae9446a1e36b70aac13e38e8c57de38fb781
Signed-off-by: loco-odoo <loco@odoo.com>
Steps:
- install project
- run project tour
Issue:
- tip on schedule activity was not visible
Cause:
- position for tip not given
Fix:
- position bottom given
task-3266724
closesodoo/odoo#118575
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
If applied, this commit will solve the 'external id not found' issue while
the user had deleted the 'Logistics' dashboard and then install or upgrade the
spreadsheet modules.
Steps to produce:
- Open the 'Logistics' dashboard from Spreadsheet > Configuration > Dashboards.
- Delete all 'Spreadsheet' from Logistics.
- Now delete the 'Logistics' dashboard from the action.
- Install or Upgrade modules that are using that dashboard like
spreadsheet_dashboard_stock, spreadsheet_dashboard_purchase, etc.
sentry - 4083977216
see - https://tinyurl.com/2az3tqtvclosesodoo/odoo#120528
X-original-commit: 9b295f5e478fc7b9a888ca07de267f0537fb02ae
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Parth Solanki (paso) <paso@odoo.com>
Currently `report.stock.quantity` has a field defined in it called `move_ids`:
`move_ids = fields.One2many('stock.move',readonly=True)`
This virtual field has no corresponding inverse field so when performing a search_read on the model, it fails
in fields.py when trying to do: `inverse_field = comodel._fields[inverse]`
In addition, this field is apparently not used anywhere in the source code and not queried in the SQL View.
This means the model can never be search_read by default.
Since this field is never used, it isn't stored, and the model is `_auto = False`, removing it won't break any database.
closesodoo/odoo#120715
X-original-commit: e3b1a887a772333ebdb1682ffbbb695fe86030c1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Andrew Gavgavian (andg) <andg@odoo.com>
Steps to reproduce
==================
- Open a product form view
- Enter .5 in the Cost field
It is parsed as 5 but it should be 0.5
Cause of the issue
==================
When trying to strip the currency symbol from the input, the leading
decimal separator was also removed
Solution
========
Adapt the regex by adding the decimal separator in the list of
characters to not exclude
For that, we first need to replace the decimal by a dot as it could be multiple
characters long. (The same is done in `parseNumber`)
opw-3270039
closesodoo/odoo#120693
X-original-commit: 59dcd17c2d389d52365a2e2975de800284cd271f
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
The issue with properties fields is that the value in the record
snapshot is not correct. This is caused by convert_to_record()
combining the values with the definition, and in the case of onchange(),
the values don't match the definition, which causes the method to return
the empty list [].
We fix the root cause by changing convert_to_record() to return the dict
itself. The combination of the values with the definition is now only
done in convert_to_read(). Method convert_to_onchange() has only one
hack to retrieve the current definition record from the record snapshot,
as because of cache invalidation, its value is no longer available.
closesodoo/odoo#120457
Signed-off-by: Raphael Collet <rco@odoo.com>
Purpose
=======
When we create a new record, we can change the definition on the definition
record. If the parent had no definition, in `_add_default_values`,
we just return the value. But in some weird cases, if we have
invalid properties name in the value, the will be written in database.
Now, in that particular case, we propagate the value only
if we try to change the definition.
Part-of: odoo/odoo#120457
- process modules to uninstall individually in order to better handle
their state at that point
- uninstall (and reinstall) modules in provided order, rather than
whatever postgres feels like (or a sort which might not match what
we want), mostly useful when uninstalling modules in bulk
- warn if a module is either missing or already uninstalled, rather
than silently do nothing
closesodoo/odoo#120261
X-original-commit: 034b317a908d1aea6dc6d992c489b30ffff8f1ce
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
- switch to `dictConfig` for easier bulk-manipulation of loggers
- set `unlink` and `ir_model` loggers to warning, to limit the
humongous spam that is a normal uninstall session
X-original-commit: bee7898a5af68128b599d30ac7d4c0193e765afd
Part-of: odoo/odoo#120261
Add subcommands to make running the script clearer (as exclusive
switches is a bit weird nowadays).
Keep the old `--uninstall` and `--standalone` switches, but make them
mutually exclusive (and optional) to retain current behaviour.
X-original-commit: 933841eda86292f180170b32da621f55fe6f0b84
Part-of: odoo/odoo#120261
- ensure `test_module_operations` exits with a non-zero status on
failure, as the current makes it a lot less convenient to notice
uninstall / reinstall errors (especially with lots of warnings
crowding the logs)
- allow uninstalling without reinstalling, so it's easier to inspect
db state after uninstall
X-original-commit: 712977faf9bf98d9087368ab4fe95f089a072601
Part-of: odoo/odoo#120261
In this commit, when user has created a transporter from the invoice view and if it's forget to enter GSTIN
Then we throws error to set GSTIN in transporter
transporter always have GSTIN, without having GSTIN any one is not allowed to transport goods in India.
task - 3262215
closesodoo/odoo#120183
X-original-commit: d09c9358f721add6f585735670085d16bcf2766c
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Before this commit, the chart's dataSources were managed by the core plugin
`OdooChartCorePlugin`. This didn't make sense since dataSources aren't
core data:
- they are neither exported nor imported
- they can be different for each user (their ids were generated via uuidv4
at import)
Moved the dataSources management to the UI plugin `OdooChartUIPlugin` and moved
the relevant getters inside this plugin. Changed the ids of the dataSources
to be the same as the chart's id + a prefix, to avoid having to maintain a
mapping `chartId` <=> `dataSourceId` .
closesodoo/odoo#120136
Task: 3293491
Related: odoo/enterprise#40546
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Before this commit, the pivot's dataSources were managed by the core plugin
`PivotCorePlugin`. This didn't make sense since dataSources aren't core data:
- they are neither exported nor imported
- they can be different for each user (their ids were generated via uuidv4
at import)
- managing them required to handle local command in the core plugin
Moved the dataSources management to the UI plugin `PivotUIPlugin` and moved
the relevant getters inside this plugin. Changed the ids of the dataSources
to be the same as the pivot's id + a prefix, to avoid having to maintain a
mapping `pivotId` <=> `dataSourceId` .
This commit also removes the dataSourceId from the `INSERT_PIVOT`
command, which have no place here since this is a core command and the
dataSources are now a pure UI concept.
This is slighly more tricky than for lists, because the datasource need to
be loaded before the `INSERT_PIVOT` command to fetch the table structure.
The component dispatching the command need to make sure it creates a
dataSource with the id given by the getter `getPivotDataSourceId`,
or else the dataSource will be loaded twice.
Task: 3293491
Part-of: odoo/odoo#120136
Before this commit, the list's dataSources were managed by the core plugin
`ListCorePlugin`. This didn't make sense since dataSources aren't core data:
- they are neither exported nor imported
- they can be different for each user (their ids were generated via uuidv4
at import)
- managing them required to handle local command in the core plugin
Moved the dataSources management to the UI plugin `ListUIPlugin` and moved
the relevant getters inside this plugin. Changed the ids of the dataSources
to be the same as the list's id + a prefix, to avoid having to maintain a
mapping `listId` <=> `dataSourceId` .
This commit also removes the dataSourceId from the INSERT_ODOO_LIST
command, which have no place here since this is a core command and the
dataSources are now a pure UI concept.
Task: 3293491
Part-of: odoo/odoo#120136
*: l10n_ae_pos, l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos,
l10n_in_pos, l10n_sa_pos, point_of_sale, pos_adyen, pos_discount,
pos_epson_printer, pos_epson_printer_restaurant, pos_hr,
pos_hr_restaurant, pos_loyalty, pos_mercury, pos_restaurant,
pos_restaurant_adyen, pos_restaurant_stripe, pos_sale, pos_sale_loyalty,
pos_sale_product_configurator, pos_six, pos_stripe, web
Previously, the pos assets included almost the entirety of the
assets_backend. Most of the contents of the assets_backend is completely
useless in the PoS, meaning that the PoS will load slower because it
loads much more JS than it needs. It also means that it gets all the
side effects of this bundle (global event listeners, among other things)
that we don't want.
This commit removes the dependency of the pos assets on the
assets_backend to solve these issues. The pos assets are now their own
bundle with only what is needed in the PoS.
As for the unit testing bundle, the same logic applies but
unfortunately, because the unit testing code from web that we want to
use (eg automatic cleanups, cleaning of registries, etc) depends on the
legacy code, we need to include a lot more files than would otherwise be
needed. This situation will probably be improved as legacy code is
removed from web, but in the mean time, it is not very important for
this bundle to be lean, as it's a test bundle and loading speed is less
important.
Linked to: odoo/enterprise#40502closesodoo/odoo#120070
Related: odoo/upgrade#4626
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This bus will be removed in a future commit. Because busses are very
general purpose and add a layer of indirection through event
dispatching, they are a poor solution to cross component communication.
Generally, child to parent communication is done by calling callbacks
received as props, and parent to child communication is done by passing
props. In rare cases, a child wants to give finer control to the parent
component. In this commit, we replace the use of the bus by a pattern
similar to React's `useImperativeHandle`: the parent component passes an
object to the child component, which the child component then fills with
the imperative API it wants to expose.
Part-of: odoo/odoo#120070
Previously, downloading reports was only possible by going through the
action service. In a few places, we want to download reports from the
PoS, but it doesn't make sense to load the action service and all its
dependencies in the PoS. In order to allow reports to be downloaded
without the action services, some functions are extracted out of the
action service itself and into report utils, which the action service
calls. These utils can now be used from the PoS without requiring the
action service and its dependencies be included in the PoS assets.
Part-of: odoo/odoo#120070
Rounding is considered in the total invoice value in JSON data.
Task id: 3276310
closesodoo/odoo#119851
X-original-commit: 1280b3a21537f24b4928d1314b911398417a7a15
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
*: phone_validation
- Add sample data in the mass_mailing_sms blacklist phone
numbers tree view.
- Update the mass_mailing_sms demo data so that, instead of
the sms being stuck due to a lack of credits, they are
all sent.
- Swap the mass_mailing_sms list view with the kanban view
so that the list view is the main one like in Email Marketing.
- Rename the reset mail template confirm button from "Proceed"
to "Reset Template" to make the action more explicit.
Task-3280602
closesodoo/odoo#119321
Related: odoo/enterprise#40120
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
*: website_event{_meet}{_track}{_track_live}
Purpose
=======
Improve event related module UI
Specifications
==============
- The reporting fields, the chat room and the participant count
of the meeting room form should not be showed while the record
is not created.
- Rewording on event track "Button appears" and "Color" field.
- Remove unnecessary helpers in event track form.
- Remove "Wishlisted By" stat button when the count is equal to 0.
- Add many2one widget avatar on lead rule "Saleperson" field and
event track "Responsible" field.
- Add placeholders in event booth form view, event location
tree view, event tags categories form view and event stages
form view.
Task-3280602
Part-of: odoo/odoo#119321
Using hardcoded ORM commands in tests is cumbersome and not reliable.
This commit introduces the same system as the one used on the server.
closesodoo/odoo#120670
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
l10n_in_edi:
Before this commit : In Accounting settings the documentation link
no longer works.
After this commit : In Accounting settings the documentation link
is updated and works.
l10n_id_edi_ewaybill:
Before this commit : In Accounting settings the documentation link
no longer works.
After this commit : In Accounting settings the documentation link
is updated and works.
task-3247082
closesodoo/odoo#120237
X-original-commit: cb905342c20201501d97ebb2ee2f9c154869f392
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Previously, a user could link his own expenses to a expense sheet
of someone else.
This would not be allowed upon creation but was allowed when updating
the values of the expense.
This commit add a simple check at the beginning of the write()
closesodoo/odoo#120661
X-original-commit: 884510b1496e0a0eba7171f4ef4bb749856cb1bf
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Before this commit, when composer had some text content in
multi-line, arrow up/down was not jumping to previous/next
line.
This happens because the navigable list is active even when not
shown, and was preventing all keydown events.
This commit fixes the issue by limiting handling of keydown
events of navigable list to when it is shown.
Also fixes a bug where the quick edit of last message was triggered
when composer text was non-empty with ArrowUp. This should only
be triggered when the composer text input is empty.
closesodoo/odoo#120657
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
When settling a sale.order from the pos app, it's possible that the sale.order
have different partners assigned to it (partner_id, partner_shipping_id,
partner_invoice_id). After this commit, we are now properly assigning these
partners to the generated invoice.
Additionally, this commit makes the settling of sale.order more robust by
avoiding issue on having multiple incompatible sale.orders in a pos.order (more
than 2 sale.orders and their partners are not the same). After this commit, we
are only reusing the current pos.order as container of the new sale.order to
settle if the sale.order is compatible to the current pos.order. Basically, we
now only allow adding new sale order to the current order if the partner_id,
partner_invoice_id and partner_shipping_id of the new sale.order are the same to
the current pos.order's linked sale.order. In other words, if the new sale.order
to settle is incompatible to the current pos.order, we create a new pos.order to
settle that sale.order.
closesodoo/odoo#120649
X-original-commit: 2782bedafb9fcbe7c65f4c6951ce270c3a5a5bd3
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Issue:
A user has write access rights to modify his own attendances.
However, he can modify the `employee_id` field.
This can cause attendances to be moved to other employees.
opw-3280850
closesodoo/odoo#120632
X-original-commit: 1c25a9b964e9e2acf9d431897e83cf72ecdca1cb
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
The activity view is an aggregation view, meaning that we show all the
activies with no limit of records.
Steps to reproduce:
There is no easy way to reproduce the bug, the database should be
populated with more than 80 records in a model and have an activity
planned for the 81th record.
Current Behaviour:
The Activity view loads all the activities without limit and so the
activity for the 81th record. The problem is that the 81th record does
not have been loaded due to the default limit of the RelationaLModel.
Therefore the activity view crash because it cannot fetch the missing
record for a loaded activity.
Expected Behaviour:
The activity view laods all the activities but also loads all the
records so it can render them.
closesodoo/odoo#120654
X-original-commit: 885c7bb33a3cb25962c090290e6b27bc11a71f41
Signed-off-by: Luca Vitali <luvi@odoo.com>
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
Simplify template so there are less code duplication between
editing state and non-editing state.
Also fixes following small style issues:
- missing opacity-25 when editing message of others
- expanded options of message come on top of jump present alert
closesodoo/odoo#120550
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit allows the server-side form arch parser used in tests to
also include the "end_date_field" defined in the `options` attribute of
daterange widgets in the dictionnary of fields found in the arch.
The daterange widget is currently the only case where the client adds
another editable field dynamically in the list of known fields. This is
not ideal since the server does not know that when computing the initial
arch sent to the client. The workaround is to also include the
"end_date_field" in the arch with `invisible="1"`, and to add a special
case for the server-side form arch parser used in tests.
Ideally we would want a proper way to define field dependencies in the
arch, but since this widget here is the only use case for that feature
it is better for now to handle it in this simple, more naive way.
Part of task 3121497
closesodoo/odoo#112171
Related: odoo/enterprise#38569
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
This commit follows the addition of the OWL date picker and intends to:
- update views calling daterange widgets to use the new syntax (and
remove the end date field from the view in most cases);
- change the remaining components extending the previous DatePicker and
DateTimePicker components.
Part of task 3121497
Part-of: odoo/odoo#112171
This commit removes both DateRangePicker and TempusDominus libraries
from the common asset bundle. The legacy widgets still depending on
these libraries will now load them lazily when instanciated.
Part of task 3121497
Part-of: odoo/odoo#112171
This commit introduces a date picker OWL component meant to handle the
following use-cases:
- date picker
- date & time picker
- date range picker
- date & time range picker
Basically, this component is the union of the two previous third-party
libraries handling these cases: TempusDominus and DateRangePicker.
New components introduced:
* The main addition of this commit is the `DateTimePicker` itself which
handles the display and interactions of the calendar and time pickers.
> see @web/core/datetime/datetime_picker
* The picker can then be coupled to an input using the
`useDateTimePicker` hook. The purpose of this hook is to handle events
on a given input element and syncronize its value to a date picker it
will spawn in a popover.
> see @web/core/datetime/datetime_hook
* Lastly, a simple `DateTimeInput` component will render an input and
call the hook mentioned above to handle it. This component is
effectively replacing the previous DatePicker and DateTimePicker
components (note that it does not handle range values).
> see @web/core/datetime/datetime_input
Another noticeable change of this commit is the definition of daterange
fields in views:
- Previously, the arch would have to define both fields
and bind them via their options, while also adding an arrow between
inputs or other forms of connection.
- In the new implementation, only the start date field must be declared,
and a date range can be spawned by providing an `end_date_field` in its
options.
Example:
```xml
<field
name="start_datetime"
widget="daterange"
options="{'end_date_field': 'end_datetime'}"
/>
```
warning Added limitations:
- this new way of declaring date ranges means that templates have been
revised to declare one field tag instead of two. This means that list
views using date ranges have lost the ability to be sorted on their end
date fields.
> Justification: the current use cases have been reviewed and it has
been decided that it was not needed to sort on the end date on the
affected list views.
> Workaround: drop the date range and declare both fields as simple date
pickers (i.e. without the end_date_field option).
- all modifiers applied to a field using a date range will be copied and
applied to the end date field. There is no way to define modifiers
specific to one field or the other.
> Justification: there was no use case where one of the two fields
needed specific modifiers.
> Workaround: same as the previous point: split the range into 2 simple
date picker fields.
Additional notes:
- the widget="daterange" is not mandatory in form views, but is required
in list views because only fields with explicit widgets will not be
rendered as simple <span> elements. The date range feature will be
available as soon as an end_date_field is specified.
- as the end date field is not explicitly defined in the view anymore,
any modifier depending on it need to have it defined as invisible
somewhere in the arch.
Task ID: 3121497
Part-of: odoo/odoo#112171
Co-authored-by: Julien Carion <juca@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Pierre Pulinckx <pipu@odoo.com>
This commit introduces various improvements to simplify, speed-up and/or
strengthen consistency in the date utility functions and localization
service.
It also takes care of removing luxon<->moment conversion helpers since
they are only used in the date picker, which has been rewritten.
Part of task 3121497
Part-of: odoo/odoo#112171
This commit adds a global listener from the popover controller to close
itself when "Escape" is pressed.
Part of task 3121497
Part-of: odoo/odoo#112171
This commit does the following in the Web module utilities:
- makes the `fieldDependencies` property of the field objects
definitions a function instead of a list of strings: this makes it
possible for fields to extract their dependencies based on the fields
info from the arch;
- adds/improves types and documentation for some utility functions.
Part of task 3121497
Part-of: odoo/odoo#112171
This commit introduces the `ensureArray` function, ensuring that the
given argument is an array by wrapping it in one if it is not.
Part of task 3121497
Part-of: odoo/odoo#112171
This commit makes it possible to use Tab to navigate between interactive
elements inside the cells of editable list views.
Part of task 3121497
Part-of: odoo/odoo#112171