Commit Graph
157975 Commits
Author SHA1 Message Date
Thibault Delavallée c712998f00 [FIX] mail: be more defensive when previewing fields
Sometimes due to new ids / not existing records for previewing crash may
happen when rendering the preview of templates. In this commit we rewrite
a bit the computation to try to be more resistant.

Task-3093257 (Mail: The Composer Update)

Part-of: odoo/odoo#107356
2023-01-27 19:56:02 +01:00
Thibault Delavallée b77af1760b [FIX] mail: fix 'res_domain' usage in composer
Using 'res_domain' should always activate the batch mode, either in mailing
or comment mode. In this commit we fix some glitches linked to the usage
of this new mode recently introduced.

Followup of odoo/odoo#99482

Task-3035101 (Mail: Support batch-posting from composer)

Part-of: odoo/odoo#107356
2023-01-27 19:56:01 +01:00
Thibault Delavallée 74b59bab26 [FIX] mail: improve 'subtype_is_log' composer computation
As subtype has no usage in mail mode, let us consider subtype_is_log as being
True in mail mode, as it eases display of buttons. This is its main usage
aka display "Log" instead of "Send" on composer. In mail mode it should
always be send.

Followup of odoo/odoo#99482

Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#107356
2023-01-27 19:56:01 +01:00
David Monnom (moda) 7c415e972f [FIX] pos_loyalty: fix data format of reward_id in the pos_restaurant
Previously, reward_id was an array of two elements containing
the ID and name of the reward. But in the frontend,
reward_id is supposed to be an int with the ID

Adaptation of the _prepare_order_line function in the following modules:
- point_of_sale
- pos_restaurant
- pos_loyalty

Now the data is correctly sent to the frontend and the error
is no longer present.

closes odoo/odoo#111048

Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
2023-01-27 18:48:45 +01:00
smdc-odoo 4f7d03829e [IMP] account,account_debit_note: Change credit / debit note buttons
Debit Notes are a type of financial documents that is not very often used. Even though it's an official document type, in many countries their usage is not

Odoo does not come with a preinstalled Debit Note management, but it can be added by installing the module account_debit_note. The module as mostly been developped following localisation requirements, and while it's a corner case, it appears all the time in one of our most critical screen. Let's make it a bit more discrete.

task-3125955

closes odoo/odoo#109539

Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-27 17:29:16 +01:00
maximilien(malb) a7b205d48d [IMP] l10n_nl: translation
All the localisation should be written in english and then translated to the native language of the country. In this case, the Dutch localisation was written is Dutch, this PR translate all the module in english and add the corresponding PO file in Dutch.

closes odoo/odoo#108954

Task-id: 3115909
Related: odoo/enterprise#35345
Signed-off-by: Laurent Smet <las@odoo.com>
2023-01-27 17:29:11 +01:00
Maximilien (malb) 75caf0eb9a [IMP] l10n_fi: translation
Before this PR, all this localisation was written in Finnish, but all the localisation have to be written in english and then translated back in the native language. This PR correct that.

closes odoo/odoo#111107

Task-id: 3151267
Related: odoo/enterprise#36338
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-01-27 16:14:58 +01:00
Maximilien (malb) 9dda3965f0 [IMP] l10n_cr: translation
Before this PR, all this localisation was written in spanish, but all the localisation have to be written in english and then translated back in the native language. This PR correct that.

closes odoo/odoo#110930

Task-id: 3149070
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-01-27 16:14:55 +01:00
Maximilien (malb) 1c3e4e9387 [FIX] l10n_pa: Translation
All the localisation should be written in english and then translated to the native language of the country. In this case, the Panama localisation was written is Spanish, this PR translate the module in english and add the corresponding PO file in spanish.

closes odoo/odoo#110656

Task-id: 3127385
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-01-27 16:14:53 +01:00
Maximilien (malb) b0cee984ca [IMP] l10n_uy: Translation
All the localisation should be written in english and then translated to the native language of the country. In this case, the Uruguayan localisation was written is Spanish, this PR translate the module in english and add the corresponding PO file in spanish.

closes odoo/odoo#109504

Task-id: 3126154
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-01-27 16:14:49 +01:00
Walid HANNICHE (waha) 360ec46b16 [FIX] purchase: unit price order line price_precision
Steps to reproduce:
- increase price_precision in decimal accuracy (in debug mode)
- create a product with multiple digits
- create a PO with that product
- unit price is rounded to 2 digits (currency pricision)

Bug:
in previous versions conversion was only done if currency
was different

Fix:
do not round during conversion and round to the highest digits
(alternatively we could revert to only converting if currecy is
different and accept the loss of precission in that case)

the wrong currency was used also for the conversion

opw-3050044

closes odoo/odoo#111223

X-original-commit: 2e46bf073c2251ce3d3ab5d5184feceb741df6db
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-01-27 15:11:18 +01:00
Rodopho Cammarosano de Lima (rcdl) 74cf214cd8 [FIX] mass_mailing: fix toggleLinkTools
The lack of a default `options` parameter for `toggleLinkTools` led to a trace
when this method was called without parameters.
This method was introduced by [1].
This commit fixes it by adding an empty object as default parameter.

[1]: https://github.com/odoo/odoo/pull/106796/commits/862d93f9eef16ec45b0d27b246fae560f7feaf1e

task-3149496
opw-3149496
opw-3151829

closes odoo/odoo#111222

X-original-commit: 24293e2a3217d0b851a3ab1c083f2984efb31d60
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2023-01-27 15:11:15 +01:00
Yolann Sabaux 125a981465 [FIX] hr_holidays: correct start and end time off
Steps to reproduce:
- In Time Off, select a day in Month or Year view
- Save your time-off

Issue:
In the Week view, the time off starts at 7 and ends at 19

Cause:
The default_get uses the default start and end given on JS side https://github.com/odoo/odoo/blob/d2f3275eee6d3a8a7f5e69ff938d36ceda771346/addons/web/static/src/legacy/js/views/calendar/calendar_model.js#L74-L75.

Solution:
Use something like https://github.com/odoo/odoo/blob/master/addons/hr_holidays/models/hr_leave.py#L104-L110
from this pr: https://github.com/odoo/odoo/pull/77036

For that to work I had to add also the function used in it.

opw-3010846

closes odoo/odoo#111189

X-original-commit: c3d8925be33a9c596a6f6455e75e0e0ca545c62b
Related: odoo/enterprise#36391
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-01-27 15:11:07 +01:00
Guillaume (gdi)andBenoit Socias ba4bb36081 [FIX] web_editor: avoid flicker when browsing through items images
Since [1] when selecting item images, the 'Blocks' tab is displayed
while the options are refreshed. This is visible because the image
selection awaits an RPC which therefore allows the browser to render
the 'Blocks' tab selected version of the display.

This commit prevents the return to the 'Blocks' tab to be rendered by
waiting for the image info to be obtained on start.

Steps to reproduce:
- Drop an "Items" block.
- Click on an image.
- Click on another image.
=> The options panel flickers on the 'Blocks' tab before showing the
second image's options.

[1]: https://github.com/odoo/odoo/commit/0acc5e784b15d9c963660da3781763448503f33e

task-2821398

closes odoo/odoo#111094

X-original-commit: d5cb2810968476b82f30582cd0d6cfdbaf351b2b
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
2023-01-27 15:11:02 +01:00
Chong Wang (cwg) 3a99c36ae9 [IMP] base: support batch for import_lang
Before this commit:
Importing multiple translations was failing due to concurrent update

After this commit:
1. `translation_importer.save` is moved out of the `try except` to prevent
`UserError` overriding `OperationalError`. So the service can retry the
transaction.
2. batch import is supported to allow RPC to import multiple translations at
once, which is faster and has lower chance to trigger OperationalError

closes odoo/odoo#111211

X-original-commit: 0545f323a67a3bf42d76c94c4d4c375245a69417
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-01-27 14:03:40 +01:00
mehjabinfarsana ecf083d0a4 [FIX] sale: pricelist required attribute issue
before this commit, when try to create a sale order without inputting pricelist field it was showing exception like "The operation cannot be completed:
- Create/update: a mandatory field is not set."

after this commit, user cannot save the record without filling pricelist field

closes odoo/odoo#111209

X-original-commit: 5ff011912e7dac8177d4a03ff51534e29fa4ddb4
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-27 14:03:37 +01:00
Nasreddin Boulif (bon) c87a9ecd92 [FIX] l10n_din5008_sale: update translation
Update translation of `Sales Order` from `Aufträgen` to
`Verkaufsauftrag`.

opw-3052426

closes odoo/odoo#111200

X-original-commit: 512391b3fd47ceabc3a40bc83b3de37672f0bef2
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-01-27 14:03:35 +01:00
Andrea Grazioso (agr-odoo) a660e8ab3e [FIX] purchase_stock: price difference currency conversion date
Have a product P configured with:
* Product Type: Storable Product
* Product category:
    * costing method: standard
    * Inventory Valuation Automated
    * Price Difference Account: "500000 Cost of Goods Sold"
* Cost $100

Activate Multicurrency:
* USD main currency, CZK foreign currency
* On CZK set the rates
    * date1, Unit per USD: 30
    * date2, Unit per USD: 25 (date2 > date1)
    * date3, Unit per USD: 26 (date3 > date2)

Create a purchase order:
* Date: date2
* Currency: CZK
* Order line:
    * Product P
    * Quantity 10
    * Unit price 3000
Confirm, receive product on date2 (svl needs to be in date2)
Create the vendor bill with:
* Bill date: date 1
* Accounting date: date 3
Confirm the bill

Issue

Check the bill journal items. Price difference account is debited with 4000 czk.
This amount is not correct.
The valuation layer price unit is 100$
At the receipt date the price unit should be 2500czk
The price unit difference 3000-2500 = 500czk
Price difference 500*10 = 5000czk
The issue occur because the price difference unit is converted at bill
accounting date, resulting in 4000czk

opw-3063809

closes odoo/odoo#111199

X-original-commit: bbc0b003f6ff08a50196e07b66083ee7e8896150
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-27 14:03:32 +01:00
qsm-odoo 5a8c7a17b2 [FIX] web_editor: remove dead code linked to ready_to_save
Commit [1] removed the last listener to the 'ready_to_save' event and
commit [2] removed the trigger of that event once and for all afterwards
... but it kept local code related to awaiting the operations the event
induced. This commit removes that dead code.

[1]: https://github.com/odoo/odoo/commit/00080f4b736c84eedd3f15e99004c1473cb78f37
[2]: https://github.com/odoo/odoo/commit/10af6e83bf318db7fe245038f0c66d68b9fa7957

closes odoo/odoo#111167

X-original-commit: 36c69b851771225ddd31a09d606dcac3c9e910e5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-01-27 14:03:27 +01:00
Tommy (tong) 25dbddc945 [IMP] payment_asiapay: update api_url based on country
Issue:

Merchant account created inside Philippine will use PesoPay,
created inside Thailand will use SiamPay, and created inside
Indonesia will use BimoPay. Currently. only PayDollar is
available.

Cause:

Missing PesoPay, SiamPay and BimoPay.

Solution:

Add a brand setting on payment provider to allow user to select
which branch will be used.

More:

- What is PayDollar, PesoPay, etc. to AsiaPay?
PayDollar, PesoPay, SiamPay, BimoPay is the same system under AsiaPay
but is for different countries to apply.
PesoPay is for the PH market
SiamPay is for the TH market
BimoPay is for the ID market
while PayDollar is for all other market likes HK, CN, MO, TW, SG, MY,
IN, VN, NZ and AU

- Why are there multiple endpoints for a given API?
Below reasons are from AsiaPay side
Local regulators requirements for BimoPay
Branding purposes to localize for the users for PesoPay and SiamPay.

- Why didn't we integrate all these endpoints in the first version of
our AsiaPay implementation?
We got in touch with AsiaPay after our first integration. Therefore
after partnership established with AsiaPay, they provide more
integration guides on the whole development

- If many customers ask for these endpoints?
Right now, there is no customers asking for these endpoints. However
if they register AsiaPay under certain countries, they have to use
the other endpoints otherwise they will not able to use AsiaPay on Odoo at all.

task-3073748

closes odoo/odoo#110357

Related: odoo/documentation#3423
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-27 14:03:24 +01:00
Thomas Lefebvre (thle) ea96e51e9e [FIX] hr: duplicate employee without keep the same contact
Steps to reproduce:
- create an employee and fill in the email address;
- duplicate this employee;
- change the email address of the new employee.

Issue:
The email address is changed on both employees.

Cause:
When we duplicate an employee, we keep the same contact.
By modifying the email address, we will modify the contact's email address.
Then we "synchronise" all employees with their contact
using the contact information.

Solution:
When an employee is duplicated, a new contact must be created.
Therefore it is necessary to avoid copying the `work_contact_id` field.

opw-3144129

closes odoo/odoo#111201

X-original-commit: 1582f6834bee2123f8703b2ae52996b0978e2311
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-01-27 12:58:46 +01:00
Aaron Bohy 865bd89eba [FIX] web: fix record test failing randomly
Before this commit, the changed test sometimes failed because the
autocomplete dropdown wasn't opened yet when we tried to click on
one of its items. Setting the autocomplete delay to 0 doesn't
remove the setTimeout, but overriding the setTimeout method from
browser like this commit does ensures the callback (i.e. the
dropdown opening) is called directly.

Fixes runbot error 15715

closes odoo/odoo#111178

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-01-27 11:53:07 +01:00
Victor Feyens 509b30853e [FIX] web: field wrongly considered as always invisible
If a field is present twice in a view, the field information
stored in the relational model `activeFields` holds and consider
only the latest xml node found.

Therefore, a field is sometimes considered alwaysInvisible
when it is visible and editable.  This means that you might click
on the 'Save' button and get a server error because a required field
is not set when you should the required field should have been
highlighted and requested before making a `create` rpc request.

This commit makes sure that for the alwaysInvisible logic,
both nodes are considered.

closes odoo/odoo#110959

X-original-commit: 3d490a264b2fe837f9dc5138f8605f5466b7c312
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-27 10:47:41 +01:00
snd a073438cce [FIX] mrp: set default qty_producing
When opening a work order and the quantity_producing is set at 0 by default, and since it is not possible to record 0 as done, the user always gets an error message when trying to carry on without manually editing that quantity producing field. This is not very user friendly as a manual input there on any device is burdensome.
This fix automatically sets qty_producing to be equal to qty_remaining in workorders for non-unique serial products when opening a workorder if the quantity is zero.

task 3113153

closes odoo/odoo#111156

X-original-commit: ff96659e7f8d4a239ff641d1b3541226ae3cb9e5
Related: odoo/enterprise#36369
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Diez Stéphane (snd) <snd@odoo.com>
2023-01-27 09:18:14 +01:00
Aaron Bohy 7416cdca33 [FIX] web: debug: View Metadata dialog: format dates in user tz
Before this commit, the creation date and last modification date in
the metadata dialog (in debug, in any form view, click on the debug
item, then View Metadata) were displayed in UTC, whereas they
should be formatted in the user timezone. This commit fixes the
issue.

closes odoo/odoo#111153

X-original-commit: 104e17211be9098b48eac842d65b1c378af5c05a
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2023-01-27 09:18:06 +01:00
William Braeckman 43ba296046 [FIX] calendar: fix invalid function call
This commit fixes a function call that was trying to call on `this`
while the function is imported and not assigned to the object.

closes odoo/odoo#111138

X-original-commit: b01be3ea8f77d42d5162648a078f09328491c102
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2023-01-27 09:18:01 +01:00
Thomas Lefebvre (thle) 7337d9ef11 [FIX] hr_holidays_attendance: check overtime deductible during write
Steps to reproduce:
- install Time Off and Attendances apps;
- making sure an employee doesn't have extra hours;
- create a time off type which is "Deduct Extra Hours" (A);
- create a time off type which is not "Deduct Extra Hours" (B);
- create a time off with the type (A);
- save;
- edit the time off with the type (B);
- save.

Issue:
The time off is modified and it is possible to approve it.

Solution:
Check that the employee has enough extra hours
if the type of time off used is "Deduct Extra Hours".

opw-3141108

closes odoo/odoo#111166

X-original-commit: 2a1db0d803ea04a6d94f3d07ba3ea7ddcb24828e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-01-27 08:17:52 +01:00
Thomas Lefebvre (thle) a3e6b5caae [FIX] hr_holidays: use the language format to display dates
Steps to reproduce:
- go to Time Off app.

Issue:
Dates in the dashboard do not respect the language format.

Cause:
We give a date format to the `format_date` function.
This function applies this format and not the language format.

opw-3138369

closes odoo/odoo#111130

X-original-commit: 432f146884d0a8b302b8f322f775087da027152b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-01-27 07:18:00 +01:00
bat-odoo 31463afc8c [IMP] l10n_in_edi_ewaybill: Send E-waybill button only show in Indian company
Currently, the `Send E-waybill` button show in all company no matter what
company is installed.

So In this commit, we check whether the invoice company country code is `IN` or not,
based on that we hide/unhide the `Send E-waybill` button.

closes odoo/odoo#111017

X-original-commit: 4aadca32da4e983f707b0f9eaa812b530c971666
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Bhavin Patel (bat) <bat@odoo.com>
2023-01-27 05:43:39 +01:00
tsm-odoo 180a7783d1 [FIX] bus: do not use dbuuid
Before this commit, the dbuuid was added to the session info in order
to reset the last known notification id.

This is not necessary since #103025. Indeed, if the last notification
passed to the server is superior to the last one, the last notification
default to 0.

This commit removes this information from the session info.

closes odoo/odoo#111154

X-original-commit: 80c2d32009e07bef05cce0b53221c6a8ca024fb0
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-01-27 02:41:48 +01:00
Stefan-Calin Crainiciuc (stcc) 62a71da538 [FIX] mass_mailing*: made demo mailing editable
*: _sale, _crm

Steps to reproduce:

- install Email Marketing
- duplicate an existing demo template
- edit > drag a block from the editor onto the email

Issue:
`Traceback: Uncaught Promise > Cannot read properties of undefined
(reading 'droppable')`

This happens because the email templates are not editable, which means no dropzones can be attached to them.

Solution:
Add classes 'oe_structure' and 'o_editable' to one div in the
templates so that at least one dropzone can be created.

opw-3050732

closes odoo/odoo#111161

X-original-commit: 5f19f9c33656d8b38e827383e0dc8d65e5ebad2a
Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
2023-01-26 22:09:53 +01:00
Odoo's Mergebot a0abc53b50 [FW][IMP] l10n_generic_coa: add (and fix) tests for invoice composer
This merge is a manual FW of odoo/odoo#110728

In this merge we add tests as done in 16.1. They are updated to match some
recent changes done in the mail composer. This includes notably the usage
of 'res_ids' field, rewriting of values generation, renaming of some
fields, ... See odoo/odoo#99482 for more details.

We also provide some fixes, following the merge of this composer cleaning.
Finally it also prepares ground for the update of composer to use editable
stored fields.

Task-3149286 (Account: cleanup account.invoice.send wizard)
Task-2088884 (Mail: Use editable computed stored fields in composer)

closes odoo/odoo#110919

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-01-26 22:09:47 +01:00
Thibault Delavallée fd513bd25b [FIX] account: make sending of invoice send emails deterministic
Using a set for langs means ordering is not deterministic. Having deterministic
processes is better for debug and testing. Use a sorted to ensure ordering
of langs iterable.

Task-2088884 (Mail: Use editable computed stored fields in composer)
Task-3149286 (Account: cleanup account.invoice.send wizard)

X-original-commit: odoo/odoo@d903424
Part-of: odoo/odoo#110919
2023-01-26 22:09:47 +01:00
Thibault Delavallée 9e45df02aa [IMP] l10n_generic_coa: add tests for invoice composer
Purpose is to add some tests for the invoice composer, both unit tests
and performance tests. Some cleaning is coming for 16.2 better avoid
(too much) regressions.

Task-2088884 (Mail: Use editable computed stored fields in composer)
Task-3149286 (Account: cleanup account.invoice.send wizard)

X-original-commit: odoo/odoo@978d50d
Part-of: odoo/odoo#110919
2023-01-26 22:09:46 +01:00
Thibault Delavallée a3e404e17e [IMP] mail: improve test tooling
Add some information and values propagation in some custom asserts in mail
test tooling.

Task-2088884 (Mail: Use editable computed stored fields in composer)

Part-of: odoo/odoo#110919
2023-01-26 22:09:46 +01:00
Thibault Delavallée e08854093e [FIX] account, mail: better batch mode support
Mail composer does not support direct assignment of res_ids for rendering
using active_ids context key anymore when res_ids or res_domain are present.
With this commit we allow to force the rendering on some specific IDs in the
composer using a temporarily 'composer_force_res_ids' context key.

This will be removed once languages are better supported in the mail composer
which is the source of that small hack in the invoice composer.

Followup of odoo/odoo#99482

Task-3149286 (Account: cleanup account.invoice.send wizard
Task-3046371 (Mail: Better Language Support in Composer)

Part-of: odoo/odoo#110919
2023-01-26 22:09:46 +01:00
Alvaro Fuentes f385cd62de [FIX] hr_recruitment: set view priority
The view `hr_job_search_view` needs an xpath anchor set on the view
`view_job_filter_recruitment`. Since both views have default priority
the order they are applied depends on their ID. In a normal install
process the views are created in the right order, but there are cases
where the IDs are not on the right order.

Steps to reproduce:
1. Install hr_recruitment in 15.0
2. Remove the view pointed by view_job_filter_recruitment
3. Update to 16.0

We get an error:
```
ValueError: Element '<xpath expr="//filter[@name=&#39;my_favorite_jobs&#39;]">' cannot be located in parent view
```

closes odoo/odoo#111140

X-original-commit: 1e77fabfa087fbeedab974645646bc1761c07468
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
2023-01-26 19:56:10 +01:00
Victor Feyens 7781d94cf9 [FIX] acc_pay_*_patch: correct payment status on invoices portal
The logic of following acc_pay code if there was a tx and following
account code if there was no tx was no wrong but was simplified too much,
losing 'Reversed' and 'Cancelled' state if there was any tx linked to
the invoice.

closes odoo/odoo#111139

X-original-commit: 8ae3413e42e2591934593d61a899df88fadbba45
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-01-26 19:56:07 +01:00
Lucas Lefèvre 76c68d79dd [FIX] spreadsheet_dashboard_sale: fix incorrect amounts
closes odoo/odoo#111137

X-original-commit: 9ea01b14a96c984a763e285b934d5440b6d2895a
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-01-26 19:56:05 +01:00
Lucas Lefèvre 9999fe649e [FIX] spreadsheet_dashboard_*: exlude drafts and cancelled records
Some amounts were wrong because quotations were included, even though
they do not make revenue.

opw 3121450
task 3130829

X-original-commit: 0fa2510c34a41e9e91131909a0b24af25aa770fc
Part-of: odoo/odoo#111137
2023-01-26 19:56:04 +01:00
Nicolas Bayet 2a0e8d1993 [FIX] web_editor: fix _getEditorOptions traceback
Before this commit, a traceback would be thrown when no options were
passed to `_getEditorOptions` because of a code mistake using the
variable `options` rather than `finalOptions`.

Also, this error revealed that the `this.options` of the wysiwyg could
be wrongly reset if no argument `options` was passed to `resetEditor`.

task-3149085

closes odoo/odoo#111100

X-original-commit: 475775d3dfc230c06c7a2b127b67bc22543e8a27
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2023-01-26 19:55:58 +01:00
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