Commit Graph
157934 Commits
Author SHA1 Message Date
Christophe Simonis 04487da7c5 [FIX] core: merge scripts found in --upgrade-path
Don't limit on the first directory found in the upgrade-path.

It follow the same behavior regarding scripts found in the `maintenance`
directory and the ones in the local `upgrades` directory of modules.

opw-2868713

closes odoo/odoo#111087

X-original-commit: d2e6c9d5010ab8092eff37775e92b486f89d28fc
Signed-off-by: Christophe Simonis <chs@odoo.com>
2023-01-26 19:55:55 +01:00
mehjabinfarsana 418c46be03 [FIX] sale: Traceback on clearing quotation date in sale order form
before this commit, in sale order form view, while clearing the quotation date it was showing Traceback error. field is already required in the model level, so removing the conditional required attribute from the view

after this commit, the quotation date is required

closes odoo/odoo#111066

X-original-commit: f8db67897c1b533a591eaf48ae18b625b1dd4d33
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-26 18:51:37 +01:00
Martin Maes e084b5dcf9 [FIX] mrp: Workorder timer not updating
This PR addresses a bug introduced in odoo/odoo/pull/109776
The user can indeed modify the timer, but because a started timer is a readonly field,
the timer does not update.
Using isDirty allows to check if the user really modified the timer.

closes odoo/odoo#111064

X-original-commit: 9aa8752da18ed679d7ddae93682c045204083104
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-26 18:51:34 +01:00
xO-Tx 84a445a8e0 [FIX] web_editor: prevent clicking on the page while saving
To reproduce the issue:
- Website page (e.g. "Contact us") > Edit mode > save.
- Try to click on the page right after the save (and before the preview
is blocked) > traceback.

In this specific case, clicking in the page will activate the targeted
snippet and initializes its "SnippetEditor" while destroying the
options and cleaning the DOM, leading to wrong behaviors.

The goal of this commit is to fix this issue by simply ignoring the
click on the page during the save process.

opw-3119347

closes odoo/odoo#111030

X-original-commit: 6bf3823c2996af4ec0534ff69471887ac43a8ddf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-01-26 18:51:26 +01:00
Ahmad Khanalizadeh a62d2c694f [FIX] point_of_sale: not show discount note for price increase
Before this commit, if if the discount policy of the pricelist is set
to "show public price & discount to the customer" and then the unit
price of a product is changed frompoint of sale, a note is added to
the invoice, that shows a "price discount".

This also happens in case of a price increase, which should not happen.

opw-3121143

closes odoo/odoo#110969

X-original-commit: b7b642cf797090c68f659a23a5e11e4fc47ecc43
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
2023-01-26 18:51:21 +01:00
Eteil Djoumatchoua (etdj) 8827e20383 [FIX] web: Get the correct list of actions on hr.leave form view
Steps to reproduce:
- Go to base Runbot and install Time Off.
- Go to Time Off > List View and select a list view item (checkbox).
- Go to Action and notice there is no Archive option.
- Go to the form view and go to Action > Archive.
- See error about not being able to archive leaves.

Issue:
We can see the action archive but we can not run it

Expected behaviour:
We shouldn't be able to see that action archive

Cause:
When computing the value of archiveEnabled we use the wrong variable "activeFields".

Solution:
Give the good one, "this.props.fields"

opw-3079475

closes odoo/odoo#110836

X-original-commit: 122fa724e1f15e8c28a29bbe8a80c089ff954956
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-01-26 18:51:18 +01:00
Adrien Schoffeniels 5c8312a038 [IMP] crm: harmonize layout of activities reporting button in teams
Purpose:
========
The "Activities" button in the reporting section in the dropdown menu
of teams kanban cards is the only button that has a different layout than
the other buttons in this dropdown, and this layout makes the button
difficult to read when the dark mode is activated.

This commit makes the button have the same look as the other ones, by
removing an unnecessary div wrapping this button, and removing the custom
style attribute.

Task-3137791

closes odoo/odoo#110736

Related: odoo/enterprise#35962
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2023-01-26 18:51:10 +01:00
Julien Van Roy f2a64b03e1 [IMP] sale,website_sale: add hooks to the checkout flow
Add hooks before rendering the `website_sale.cart` and
`website_sale.extra_info` templates. This allows to pass flags to
trigger style variation in the checkout wizard (add an extra step). In
addition, add the country_code to the sale_order view form, since it
will be needed everytime we add l10n_* fields in this view (with attrs
based on `country_code`).

Related: https://github.com/odoo/enterprise/pull/35050/commits/fce5e682946cfa7d9e19c0c3c6abfab3dcbcc54a.

task-3089169

closes odoo/odoo#108181

Related: odoo/enterprise#35050
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-26 18:51:01 +01:00
Julien Van Roy 0499bc1687 [IMP] website_sale: allow the checkout wizard to have any number of steps
Previously, the columns of the checkout wizard were hardcoded (3 columns
or 4 if the extra step is enabled). Using a bootstrap grid allows us to
support any number of steps. This is convenient, for instance, when we
need to specify some country specific fields in an additional
information tab.

related to task-3089169

Part-of: odoo/odoo#108181
2023-01-26 18:51:01 +01:00
Anita (anko) f5eec1d539 [FIX] sale,purchase,account: Duplicating document_tax_totals
If user would add addictional field in one of reports it could break other
reports as other models do not share all the same fields. Now modules inherit
template and create their version of field.

task-2858097

closes odoo/odoo#106140

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-26 18:50:58 +01:00
Anita (anko) acb192eafb [IMP] payment: require name and image for payment method
Payment methods without image or without name does not make any sense.
Previously created payment methods without a name will be
given default name and ones without an image will be deleted.
Payment icon can no longer be created or edited from payment
provider form view.

task-2853424

closes odoo/odoo#105909

Related: odoo/upgrade#4043
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-26 18:50:52 +01:00
Florian Damhaut 415d1299f2 [IMP] sale: split populate for usage in sale_subscription
This commit split the function confirming SO in populate with
the purpose of adding populate method for subscription SO,
recurrent product, recurrence and pricing in odoo/enterprise#33305

closes odoo/odoo#104269

Signed-off-by: Arnaud Joset <arj@odoo.com>
2023-01-26 18:50:47 +01:00
luve-odoo ac0395a1e8 [FIX] product : UI product.product form was broken
UI improvements for the form of product.product model.

task-3043184

closes odoo/odoo#111052

X-original-commit: d8bc64e6cf04291370e577abe8c58303ae4a9741
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2023-01-26 17:33:49 +01:00
Simon Genin (ges) f5c5e51917 [FIX] web: tooling: fix support for older tooling
Older tooling used prettier config files. The issue was that the
disable command of the tooling was also changed to not remove those
files as they shouldn't exist anymore.
But changing from 16 to master without manually triggering a tooling
"disable" would then left the prettier config and mess with the addons
eslint whitelist.

closes odoo/odoo#110582

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-26 14:19:06 +01:00
Florian Vranckxandxmo-odoo 7dc2190fa4 [IMP] test_lint, * : SQL injection detection
This commit brings a new way to detect sql injection.

Previously, this test was meant to push developers to use the second argument of cr.execute(query,args) for parameters.

However, this also meant that the test will always be green as soon as the second argument is used.

This commit aims to change that by tracking the source of information of all variables used to build a query. Parsing of the AST in reverse, starting from the query variable itself.

However these are some current limitations:
  -The hierarchy of Odoo modules is currently not taken into account. If two functions have the same name, they will both be evaluated to find if their return value is part of the query
  -Object mutation is not supported and is not evaluated
  -Whitelisted values are too wide in order to reduce the amount of false positives.

Even if this test is blocking, it can be disabled by adding #pylint: disable=sql-injection at the end of the line.

closes odoo/odoo#101237

Related: odoo/enterprise#35697
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: xmo-odoo <xmo@odoo.com>
2023-01-26 14:19:00 +01:00
Arnold Moyaux eaf45ab9ca [FIX] sale_stock: user default on warehouse
Use case:
- Create a user default value to set the warehouse as empty
- Create a SO

The SO warehouse is filled. It happens because there is an
extra check to add the warehouse based on the user preference
or first company's warehouse.

However the user default could be use to prevent that behavior
and force the user to choose a warehouse (15.0 behavior)

This commit always respect the user default if it's set.
Also remove a strange condition that could set warehouse of
wrong company

closes odoo/odoo#111033

X-original-commit: 3afb0bae0b48dc152908a2a39b0de7e2f966b54c
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-01-26 12:19:17 +01:00
vlst 4b6ae93133 [FIX] pos_restaurant missing access token
closes odoo/odoo#110932

X-original-commit: 8e018aa07c9fbfc88b3b4a84840fa02e29c4acd5
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-01-26 12:19:15 +01:00
Martin Trigaux d3b3a30c84 [FIX] mail: remove group when unchecking the box
When activating the option "Restrict Template Rendering" the employee
group no longer gets the group automatically via the Implied Groups
field. However this did not have much effect because
- all the existing employees still had the group
- new users had the group via the template user

Remove the group with active_test=False to include the Default
Template User in the list.

Before this commit it was a bit confusing that new users still got the
group by default, even after deactivating the option in the settings.

closes odoo/odoo#110900

X-original-commit: ea0f674ac15964aaeb3def31758cec558b354a99
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-01-26 12:19:12 +01:00
roen-odoo f28877c481 [FIX] pos_sale, sale, sale_mrp: Correctly compute kit quantities in PoS
Current behavior:
When you imported a sales order with a kit in the PoS, the kit quantity
was not correctly computed.

Steps to reproduce:
- Create a product kit with atleast 1 component with a different UoM
  than the kit
- Update the quantities on hand of the component
- Create a sales order with the kit
- Import the sales order in the PoS
- You will have a traceback

Note : There is no traceback if both components and kit uses same UoM,
but the quantity of component was not correctly computed.

opw-2983703

closes odoo/odoo#110714

X-original-commit: 3000515a1c96c203e644e3d2cf783fe9efd0e45e
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-01-26 12:19:09 +01:00
Walid HANNICHE (waha) 7e0e711e31 [FIX] stock_account: SVL unit price precision
Steps to reproduce:
- Increase decimal accuracy of product price (eg: to 4)
- Create a product with fifo automated valuation and price of 280.8475
- Confirm a sale order of that product and Confirm stock picking
- Create a return on the stock picking

Bug:
rounding error on the stock valuation

Fix:
do not round unit price on currency rounding

opw-2988071

closes odoo/odoo#110112

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-26 10:16:55 +01:00
Kevin Baptiste 2a5b80a6d4 [IMP] hr,resource: automatically compute number of hours
- Automatically compute the average number of hours per day on
   resource.calendar;
 - Don't allow to change the working hours of an employee when they have
   a current running contract;
 - Seperate smart buttons on resources to distinguish Material / Human.

 task-3102517

closes odoo/odoo#109768

Related: odoo/enterprise#35718
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-26 10:16:53 +01:00
Luis Torres 35959e9b0d [IMP] l10n_pe: New identification types requested by the SUNAT
By Sunat regulations a new type of identity document will be accepted:
License Permit Temp. Perman. This applies to a Boleta made to a foreign
customer and also to the operator of the vehicle when creating delivery
guides.

Legal ref:

Website: https://cpe.sunat.gob.pe/node/88
Document with Catalog Update No. 8:
https://cpe.sunat.gob.pe/sites/default/files/inline-files/AjustesValidacionesCPEv20210727%28ultimo%29.xlsx

closes odoo/odoo#108506

X-original-commit: 027bd9b0a1ea93744cc92a88efc1a77d142df23b
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-01-26 10:16:47 +01:00
Jeremy Kersten c4443e31b0 [FIX] hr_holidays: don't remove nothing on new user creation
This commit avoids potential concurrent updates if you create 2 users
simultaneously.
The method is called by an override of the method create from res.users.

In production, we have concurrent update because it writes to the group
no matter if someone is to remove or not. And orm will do a query in all
cases to update the write_date, ...
Now we only execute a query if somebody need to be removed.

closes odoo/odoo#111031

X-original-commit: 5a0cf8bc8a9747e18eca5ddd3f135eb0cfcfd13d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-26 08:18:56 +01:00
Habib (ayh) 29cc267fc1 [FIX] account, purchase: stacktrace when no currency is selected
The tax totals computation requires a currency to be provided. When a user removes the currency deliberately and tries to add a line, an uncaught error is thrown.
The currency_id is required, and the user will not be able to save the move anyway.

To reproduce:
New Invoice or Purchase
Clear the currency field
Add a line
Stack Trace

After this PR:
tax totals are computed based on the journal currency or company currency when not available

No task, discovered thanks to #110920

closes odoo/odoo#111021

X-original-commit: f74f9bc04ed8f18746eb509f3c8dc598b1618230
Signed-off-by: William André (wan) <wan@odoo.com>
2023-01-25 21:53:44 +01:00
Dylan Kiss (dyki) 8889a896f3 [FIX] base: update Spanish address format
Currently the Spanish address format does not include the province/state.

This change adds the province between parentheses after the zip code and city.

task-3147965

closes odoo/odoo#111012

X-original-commit: 2c31ad84137b3a764116bea6a6d765a2c7d03eb7
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
2023-01-25 19:52:43 +01:00
Guillaume (gdi) 4a9d7e5554 [FIX] web_editor: correctly position the blocks tooltips
Since [this commit], a tooltip is displayed on the blocks that can be
dropped in a page so that the user understands that he must not just
click on it but drag and drop the block. Unfortunately, these tooltips
were not well positioned in the email marketing application because the
editor is in an iframe in this application. This commit allows to
position correctly these tooltips.

Steps to reproduce the bug fixed by this commit:
- Go to the email marketing application
- Create a new mail
- Select a template other than "plain text".
- Triple click on a block

=> The tootlip is displayed way too high.

[this commit]: https://github.com/odoo/odoo/commit/a50c09e3b432d7601cd0e02cbbfabe24a67ba70f

task-2777738

closes odoo/odoo#111011

X-original-commit: 42d32a4f40d685e10f2ae4bb678df2009cb4bd21
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-01-25 19:52:40 +01:00
Romain Derie fff73e1fb0 [FIX] website: correctly handle website_visitor with merge partners
Since the refactoring of website.visitor with [1] (upsert), the
`access_token` is supposed to be holding the same value as the
`partner_id` when the visitor is linked to a partner:
- Anonymous visitor: no `partner_id`, `access_token` is a hash value
- Partner visitor: `partner_id` set, `access_token` should be sync with
                   `partner_id`.

`partner_id` is just a stored computed field holding the `access_token`
value if it is an integer value.
There should never be a case where there is a `partner_id` set and the
`access_token` is not equal to the `partner_id`.

For instance, having a visitor with `partner_id` = 4 and `access_token`
 = `e4r3ejkj4` is supposed to be impossible.
It would lead to crash, because the visitor is only searched based on
his `access_token`, meaning that when searching for the visitor of
partner 4, none would be found and a new one would try to be created,
raising the `uniq_access_token_id` SQL constraint.

While the `partner_id`/`access_token` sync might seems weird, it is done
to allow the `upsert` use in SQL to improve perfs of this low level
behavior.
It's actually not as weak as it seems as there is only a single entry
point to update the `partner_id` and `access_token`: the authenticate
override of website.
Those fields are not supposed to be changed elsewhere.

Note that modifying the `access_token` would not be an issue as the
`partner_id` is just a stored compute based on the `access_token`.
But it's only true when modifying through the ORM as if you do that in
raw SQL, it won't go through the `api.depends` which is supposed to
recompute the stored computed `partner_id` field.

But something was forgotten during the initial dev: the partner merge
behavior: it does (on top of other thing) auto discover the m2o field
relations that points to a `res.partner` and modify those values in raw
SQL to the new value.
This is obviously wrong regarding the `website.visitor`'s `partner_id`
field, the `access_token` should also be updated, or when possible
visitors should be merged too.

Note that for DB upgrated from previous version to Odoo 16, this is
ensured through the following upgrade script [2]:
```sql
UPDATE website_visitor
    SET access_token = partner_id::text
WHERE partner_id IS NOT NULL
```

[1]: https://github.com/odoo/odoo/commit/d348bed1ad9d3d16b295f013f015706be6c07820
[2]: https://github.com/odoo/upgrade/commit/0cedcbf70494dfeddeb5a97c13bf875cb6a86886

task-3148111

closes odoo/odoo#111002

X-original-commit: a87b4142dd4a2c05e3e1885b2c54f5e0d3c7ac47
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-01-25 17:50:25 +01:00
Alexandre Kühn 27fabf8da7 [FIX] mail: save record when using chatter on draft record
Before this commit, while creating a new record, the chatter
was disabled and no interaction on chatter was possible until
the record was fully created by saving it.

This was a problem because it's unclear that chatter requires
the record to be fully created. In earlier versions of Odoo,
we had to click on "Edit" and "Save" buttons of Form view, but
now that edit/read-only mode is no longer explictly managed by
the users, they'd expect to be able to interact with chatter,
even while in the process of creating a new record.

With this commit, when clicking on most actions in chatter, the
record is created. In case the record cannot be created, usual
validation errors are applied.

Task-3132931

closes odoo/odoo#110991

X-original-commit: af442bd8d42acad0cb6a49700fc9ec1934751bf1
Related: odoo/enterprise#36284
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-25 17:50:17 +01:00
Kevin Baptiste d534bdc975 [FIX] hr_work_entry: make _error_checking faster
Calls to `_error_checking()` would look for every work entries between 2
dates, even if we were only modifying one employee's.

Because of that the leave creation on big production database would take
a long time.

Now the method allows for filtering to the employees.

task-3142610

closes odoo/odoo#110987

X-original-commit: f54b7c34bc89140e2d31f0b602911ec9cda3ed0d
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-25 17:50:14 +01:00
sofiagvaladze 93ad98bc6f [IMP] hr_holidays,hr_work_entry_holidays: change responsible_id from ma2o to m2m
task - 3060720

closes odoo/odoo#107804

Related: odoo/upgrade#4128
Related: odoo/enterprise#34926
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-01-25 17:50:05 +01:00
Kartik Chavda 26268a50eb [IMP] {hr,sale}_timesheet, project_timesheet_holidays: improve generic UX
Purpose of this PR to do generic improvement for timesheet apps.

So in this PR done following improvements:
- add information about project section on time off type form view so user can better
  understand time off and timesheets relation.
- display 'view timesheets' as button instead of link in sale order portal view.
- add time off link to project settings's time off section so user can easily navigate to
  understand link b/w time off and project apps.
- prevent user to create new timesheet for non active employee by adding context
  depending on employee's active state.

task-2983879

closes odoo/odoo#106047

Related: odoo/enterprise#34171
Related: odoo/upgrade#4056
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-25 17:49:50 +01:00
Kartik Chavda 4dcf11a71d [REF] hr_timesheet: refactor search view of timesheet
This commit uses timesheet search view for timesheet report
search view so that way we don't have to repeat everything
we do with timesheet search view.

task-2983879

Part-of: odoo/odoo#106047
2023-01-25 17:49:50 +01:00
Shawcker 3bcdd1e588 [ADD] base_vat: VAT check for Venezuela
The current VAT check doesn't pass for valid Venezuelan VAT numbers (RIF). Venezuela has a specific method to validate their RIF, very different from the standard VIES check.

This commit adds an implementation of the VAT number validation in Venezuela. The validation is based on
(1) pattern matching
(2) checksum validation

Task id=3094593

closes odoo/odoo#110976

X-original-commit: 4fca8ed270c3406246e259b3aec7eda0b6d2d9ab
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Popeler Antoine (anpp) <anpp@odoo.com>
2023-01-25 16:37:24 +01:00
Laurent Smet 938efa80a0 [FIX] account_accountant: Fix dashboard default bank rec action
Open the kanban view by default when clicking on the journal name.

closes odoo/odoo#110964

Task: 3141127
X-original-commit: 05553202e0a4a59600214fcbf965cfb3c29afbc9
Related: odoo/enterprise#36271
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-25 16:37:19 +01:00
Samuel Degueldre 7c3194ef73 [FIX] pos*: add missing arguments forwarding in _super calls
*: l10n_fr_pos_cert, l10n_gcc_pos, pos_hr, pos_loyalty, pos_mercury,
pos_restaurant, pos_restaurant_adyen

In odoo/odoo#109928 the custom inheritance system of the pos was removed
and a bunch of modules were adapted. In a lot of those places, the
_super calls didn't forward the arguments to the super method, resulting
in broken methods. This commits fixes that.

closes odoo/odoo#110962

Related: odoo/enterprise#36269
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-25 16:37:10 +01:00
Xavier BOL (xbo) 8893454e29 [FIX] project: avoid re-fetching last update on project when re-sequence
Before this commit, when the user drags and drops a task from a stage
to another one in the kanban view of tasks of a project, the kanban
records in the destination stage will be re-sequenced and this
re-sequence will re-render the kanban. For this reason, the
`onWillUpdate` hook in the control panel will be trigger many times
and each trigger will fetch the last project update.

This commit will remove the `onWillUpdate` hook to avoid re-fetching
the last project update when a change is done in the kanban view and
so, the last update of the project will be just fetch when the
component is mounted since the last update is not impacting when a
task changes stage.# Please enter the commit message for your changes.

closes odoo/odoo#110961

X-original-commit: 6117f41f52c45710d313c128bbce1d364dc40b93
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-01-25 16:37:07 +01:00
Rémy Voet (ryv) 5a870462e0 [REM] base: remove _patch_method and _revert_method
There is only one legitimate usage of `_patch_method` (base_automation)
and none of `_revert_method`. The other uses are in tests and they are
all wrong: if the test crashes between the `_patch_method` and the
`_revert_method`, the method will not be reverted.

For the only proper usage of `_patch_method`, move the code to this
place. Correct tests using `_patch_method`/`_revert_method` by calling
the `patch` method of `BaseCase`.

Also, remove the `api.returns` from the `create` method of `BaseModel`
as it is useless and confusing. In fact, we never use it because we
have a special treatment at the RPC level for the `create` method
(see `_call_kw_model_create`).

closes odoo/odoo#110370

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-01-25 16:36:53 +01:00
Thibault Delavallée 01c2146d13 [FIX] hr_recruitment_survey: protect against ill-formed default values
'survey.user_input' model has an inherit in hr_recruitment_survey module to
link survey answers to applicants. The field is named 'applicant_id' which
leads to issues with 'default_applicant_id' is present in context. This
happens quite often when going from a kanban view notably, as it adds this
filter in context when displaying applicants. Trying to send a recruitment
survey to this applicant fails as it tries to set an ID in a o2m.

In this commit we simply remove the default value in context to avoid issues.
As anyway this model is technical it should not depend on default values.

In master we will rename the field to avoid issues.

Followup of odoo/odoo#63946

Task-3093257 (Mail: The Composer Update)

closes odoo/odoo#110958

X-original-commit: e215ae152d0d2cad315d87ef03c58599f6d20e13
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-25 15:31:01 +01:00
Thomas Lefebvre (thle) 35224583f4 [FIX] hr_holidays: prevent double confirmation of allocations
Steps to reproduce:
Create a leave allocation for a group of employees
via the "By Employee Tag" mode.

Issue:
Employees have more allocations than expected.

Cause:
The allocations are confirmed automatically when
the "base" allocation record is created
(if there is not validation required).
And the "CONFIRM" button is also clicked
which does the same operation a second time.

Solution:
Do not start the validation process if the allocation
is already validated.

opw-3096138

closes odoo/odoo#110942

X-original-commit: 7d4e0c0bb3762bb5b05871b07bdb15f0f242ab0a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-01-25 15:30:58 +01:00
CarmenMiranda 27fed3392b [FIX] pos_restaurant: Timezone inconsistency in draft orders
Right now when you create an order (order A) in a POS with tables the
`date_order` is being set correctly (in UTC, so is shown in the back-end
with the user's timezone), but after you return to the Floor Screen or go to
another order (order B) and then go back to the order A and you add
another product and the order is saved (not paid) when you check that
order in the back-end now the `date_order` it says another value not the
one of the user's.

This is happening because when the JS received the back-end information
to open the order for the second time the date come in the User's
timezone and the server's timezone, and that info was saved but taking
it like UTC.

Now instead of storing inconsistent information in the DB (server side), we
are going to modify the information that is shown in the POS (client side),
so that both sides show the same date.

This will only apply in the POS where tables are being used since the
orders are only synchronized (back-end) when the option `is_table_management`
is set in the POS (`pos.config`).

closes odoo/odoo#110832

X-original-commit: 168d0e12120ced7b1093d39b10cd79c85c56aad0
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-01-25 14:20:55 +01:00
Alexandre Kühn 64210e5870 [FIX] mail: no crash when uploading file on chatter with preview
This happended because when reloading the chatter, the chatter
changed position and its identity changes (i.e it's no longer
the same chatter). The old chatter was  removed, therefore it's
invalid to access relation on removed records, e.g. with
`chatter.webRecord`.

The underlying problem was that chatter should stay the same,
even with reposition. The chatter was not properly passed
between aside to bottom position.

This commit fixes the issue by properly passing chatter in
form controller.

closes odoo/odoo#110912

X-original-commit: f04bb66c0714bf732202873e2de82bcbc767a43f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-25 12:24:55 +01:00
Arnold Moyaux 607824fa50 [FIX] purchase_stock: cogs without stock.move
Usecase to reproduce:
- Create a product with real time valuation and AVCO or FIFO
- Create an invoice for this product without stock.move
- Validate the invoice

Traceback

It happens because it tries to check if there is a difference between
the invoice line value and the value of associated stock.move. However
in this case there is no purchase line to do the link.

Since we can't associate a picking to an invoice line magicaly. We skip
this part and let the user do his own journal entries

closes odoo/odoo#110906

X-original-commit: 8ea41cba3911fb8bcc351a4c53d2aa6c5bf7bdde
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-01-25 12:24:52 +01:00
Lucas Perais 12b2a7ef46 [IMP] web: Record: improving Record and RelationalModel for usability
The Record component becomes more and more used, but its API and the flows
it can support are both a work in progress.

Its specs become a little clearer, we probably want two things:
- be able to display some values via Fields widget and interact with them, in
particular relational fields.
- fetch, display and interact with a proper record in the db.
- disconnect it from the use of model in Views (via the hook useModel), because Record's
feature are simpler.

This commit aims at clarifying at least 2 aspects:
- how to pass the values to the record, that is, without reading anything from the db
=> a `values` props contains server formatted data, it supports changing them via the props

- when to reload the data from the db, when not to.
=> when props did not change, don't reload anything.

We expect further improvements on this component, as the feature is still very basic at this point.

See 475f8aa for earlier improvement

closes odoo/odoo#110122

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-25 12:24:50 +01:00
Florent de Labarre e2a4df4bfb [FIX] website: don't translate exemple of rule
- Install website and set in French
- in the robot wizard you see:
Exemple de règle :
Refuser : /web/login
Autoriser : *

closes odoo/odoo#110911

X-original-commit: 10e50eeeb4c3c83da2c671bd600561679fdacd44
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-01-25 11:16:46 +01:00
Laurent Smet 19d999b7e6 [FIX] web: Allow select or not by default the dynamicFilters
On the bank reconciliation widget, we are using 2 dynamic filters "Receivable" and "Payable".
Otherwise, only one should be selected by default.

Enterprise PR: odoo/enterprise#35801

closes odoo/odoo#110831

X-original-commit: 2504a623f90022dfa1c64436b7bd6e113f82e82d
Related: odoo/enterprise#36207
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-01-25 10:18:32 +01:00
det 42c1d2a6d3 [IMP] hr_expense: button to register payment on expense view
Before this commit, the user had to go over each expenses to
register a payment.
He now  has the possibility to do so from the expense report
tree view via the "register payment" button.

task-id: 3116195
[community](https://github.com/odoo/odoo/pull/109671)

closes odoo/odoo#109671

Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-01-25 10:18:29 +01:00
Eteil Djoumatchoua (etdj) 6186dc2266 [FIX] sms: don't get error when sending an sms on sale order
steps:
- Go to Rental app
- Open a rental Order
- Click on Action
-  Send an SMS text message
-  Fill phone number and message
- Sens SMS
Issue:
Traceback

Cause:
Sale order doesn't have a phone or mobile field so the sms.composer tries to write on it use "False"

Solution ensure the field name isn't false before writing

opw-3103232

closes odoo/odoo#110038

X-original-commit: 70a9995c9e02f36dc15d2723151ef0a205ebc12b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-25 09:16:47 +01:00
Samuel Degueldre ef67615e97 [FIX] web: correctly destroy apps created for legacy MockServer
A recent change in owl exposes live (non-destroyed) apps on the window.
This change causes the memory used by the QUnit test suite to balloon
out of control. The reason is that when creating a mock environment, we
create a standaloneAdapter to serve as the legacy MockServer's parent,
but this standaloneAdapter creates a dummy owl application and this
application is never destroyed. This commit fixes the problem by
registering a cleanup to destroy the application at the end of the
running test.

closes odoo/odoo#110889

X-original-commit: 27ff522cd6b0c3be32be623e375052e63bb1a04f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-01-25 08:18:04 +01:00
Jorge Pinna Puissant a9d3cc036f [IMP] *: use the new setting tag on the form view.
*: hr_timesheet, point_of_sale, pos_epson_printer, project,
    sale_project, sale_timesheet

closes odoo/odoo#110432

Related: odoo/enterprise#36050
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-25 08:18:01 +01:00
Jorge Pinna Puissant 4cdd74fc58 [IMP] web: allow the use of setting tags on the form view
The setting tag was introduced in [1], it was restricted to the setting
view (the js_class : base_settings).

This commit move the setting tag to the form view, to remove the
restriction and allow the use of the setting tag in any form view.

[1]: c7c2959449

Part-of: odoo/odoo#110432
2023-01-25 08:18:01 +01:00