Commit Graph
157157 Commits
Author SHA1 Message Date
Edoardo (pied) 3c32cca783 [FIX] point_of_sale: add forcecreate="0" pos_config_main
Without this change, upgrades would generate the `pos_config_main`
record even in dbs with otherwise-well-organized structure.

Also, it might cause issues[^1] hard to solve otherwise.

[^1]: https://upgrade.odoo.com/web#active_id=421039&cids=1&id=421039&menu_id=107&model=upgrade.request&view_type=form

closes odoo/odoo#107935

X-original-commit: ac99271e206fa07e7fdf1b57e2279058dbb9d141
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-12-14 15:36:51 +01:00
JF Aubert 0296c93edd [FIX] mrp: fix workorder timer for sample data
get_working_duration can't work on generated samples.

closes odoo/odoo#107934

Task: 3098709
X-original-commit: 642ca37e4e5a3db6ef7929a25850fafc499e4257
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Jean-François Aubert <ajf@odoo.com>
2022-12-14 15:36:48 +01:00
Adrien Dieudonné 3d6599ac1f [FIX] mail, mass_mailing: chatter should take all width
In some case, we want that chatter takes the all space
available.

Steps to reproduce:
- Go to Email Marketing
- Click on any record
- Go to the Chat tab

closes odoo/odoo#107928

X-original-commit: cbbbc23800e2a00aab9af45087b5d3f7698823d8
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-12-14 15:36:45 +01:00
Jordan D.(Joda) 5c219ec80e [FIX] base: enforce tree view on change.password.wizard
No view is available for the mobile form of change.password.wizard. The
default behavior of the framework is to generate one using the backend
model. This result on showing some hidden fields to the user, some of
them (like in this case `Wizard Id`) is impossible to fill in.

opw-3027797

closes odoo/odoo#107911

X-original-commit: 0860ba8538793c081358105238946ebc0d2015e5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2022-12-14 14:20:01 +01:00
tsm-odoo 252f7f5f82 [IMP] bus: lazy start of the websocket
Before [1], the bus was started lazily: either as a consequence of
the addition of a channel to listen to or by manually calling the
`startPolling` method.

Before this commit, the websocket would have been started as soon as
the bus service starts which degrades performances.

This PR fixes the issue by re-introducing the same mechanism as before
that is by starting the websocket either by calling manually the `start`
method of the bus service or automatically when adding a channel.

[1]: odoo#75510

closes odoo/odoo#107878

X-original-commit: 5d7deacf54f37f0938b92a3c45c9f1d1325d1a9f
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2022-12-14 14:19:58 +01:00
Kevin Baptiste 5389f2640a [FIX] hr_holidays_attendance: grant back overtime on leave deletion
The linked overtime record was not deleted when deleting a time off.
Meaning that those hours were lost.

task-3097259

closes odoo/odoo#107917

X-original-commit: 54cdc8435c28ecea253f61d5c8eeef317874456a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-14 11:42:24 +01:00
niyasraphy 5c1b0a1385 [IMP] point_of_sale: documentation link for adyen terminal
add documentation link for adyen terminal in point of sale settings, similar to the other payment terminals

closes odoo/odoo#107900

Related: odoo/enterprise#34948
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2022-12-14 11:42:18 +01:00
PoMa 43eae4d032 [FIX] account: bank statement not ignoring canceled and draft lines
Before this commit the canceled lines would not filter out from checks for completeness
 of the statements and also the corrections in split wizard consider canceled lines as
 real values. One of the results of this is when the user import statements with some
 duplicate lines, the duplicates are canceled but the statement stays complete regardless
  of the missing lines.

Also fixes the line date is not auto-filled when creating lines in the list view if they don't have a state
Closes PR #105708

closes odoo/odoo#107894

X-original-commit: 2422b2c619209c1ff4171902dd2f90824194366d
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Pouya Malekinejad (poma) <poma@odoo.com>
2022-12-14 11:42:15 +01:00
Jorge Pinna Puissant 76add62453 [FIX] web: settings view, always perform an onchange to fetch the data
- On the settings view;
- Open the CRM settings;
- Click on "Update Probabilities" button;
- Change the "consider leads created as of the" date;
- Click on "Confirm" button;

Before this commit, the fields on the settings related to the dialog
were not updated. This occurs because, as the setting model is a
transient model, the settings view should always perform an onchange to
fetch the view, and it wasn't the case here.

Now, we patch the basic model used on the settings view to remove the
res_id, to consider the record always as new. This will always perform
an onchange to fetch the data. Note that, this hack is the same as it
was done before the owl migration.

opw-3073124

closes odoo/odoo#107879

X-original-commit: 792567c71aed626b5566f32b656104e3e70c496c
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2022-12-14 11:42:08 +01:00
Denis Ledouxandkebeclibre a9f020e777 [FIX] web_studio: fields with groups set as invisible in views
This revision is related to odoo/enterprise#33088

The needs is the same:
While using Studio,
instead of removing the node from the view
when the user is not part of the group,
set the node as invisible.
This is so the xpath expressions computed by Studio
takes into account nodes which are removed from the view
when the user is not part of the group required by the node.

e.g.
```xml
<form>
    <group>
        <field name="name"/>
	<field name="currency_id" groups="base.group_multi_currency"/>
	<field name="foo"/>
    </group>
</form>
```

With the above view, if you want to add a new field after
`<field name="foo"`/>
and the `currency_id` field node is removed from the view
during the post-processing of the view
because the user doesn't have the group,
Studio computed the xpath expression with `field[2]`,
and then the new field was mis-placed,
it was before the `foo` field instead of after.
The strategy is to let the nodes, as invisible,
for which the user doesn't have the groups
so the xpath expression is correctly computed
for the view as it is stored in the database/
before the post-processing step removing the nodes.

The above revision applies this strategy for
nodes other than `<field/>` and `<t/>`.

The `<field>` were not included because it was,
at that time, believed it wasn't necessary.
Even though the index was wrong as demonstrated
in the above example, it was then converted
with the expression `field[@name="foo"]`
instead of `field[2]`, and therefore it was
fine not to include the `field` nodes
in the strategy.
Also, fields were not included in the strategy
because for them, if the `groups` is set
in the Python model
e.g.
```py
currency_id = fields.Many2one(..., groups='base.group_multi_currency')
```
Attempting to read them while you don't have the group
will lead to an AccessError exception.
And there was no way to display the field as invisible in the view
without the web client to try to read its content.

Unfortunately, it isn't the case,
as demonstrated by the tours included in this revision,
field nodes must be included in the views, as invisible,
so Studio can compute correctly the xpath expression.

This revision therefore aims to apply the same strategy
for `field` nodes, make them invisible instead of removing
them from the view when the user is not part of the groups.
The revision takes care to override the web client so it doesn't
try to read the value of group-protected fields when the user
doesn't have the group.
So the field, with the label and everything,
is included in the view, but its content/value is left empty,
as the user cannot read the content.
Technically, there won't be many cases, because
users editing views using Studio are admins,
and in most-cases admins have access to these group-protected fields.
Having a field group-protected to which the admins do not belong
doesn't happen that often.

closes odoo/odoo#107877

X-original-commit: 91f213e202ca29c4ef0bb190663fc48f169a64a6
Related: odoo/enterprise#34940
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Co-authored-by: kebeclibre <lpe@odoo.com>
2022-12-14 11:42:02 +01:00
Achraf 0801d1a92e [FIX] delivery: Fix ZeroDivisionError in shipping cost calculation
A `ZeroDivisionError` traceback  that occurs in `delivery/DeliveryCarrier:_get_packages_from_order` was caught by Sentry

Because in this part of the function

https://github.com/odoo/odoo/blob/c18064d717312287f5acba2fabeb77b2e1c01fb9/addons/delivery/models/delivery_carrier.py#L326-L335

if `total_weight === 0.0` then `total_full_packages` and `last_package_weight` will be null too.
And that will cause a `ZeroDivisionError` because of `total / len([])`

opw-3086602

closes odoo/odoo#107820

X-original-commit: a362e14ee62a5d9d2bcb08c4431994a96796ce1e
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-14 11:41:57 +01:00
Habib (ayh) 1d2cdfbe24 [IMP] sale: invoice template tooltip
The tooltip for the setting module_product_email_template refers to a setting in the Sales tab of the product, but this has been moved to the Accounting tab in v15. Due to stable policy, this is fixed in master

task-3095455

closes odoo/odoo#107634

Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-12-14 11:41:54 +01:00
Samuel Degueldre 990b10aece [REF] point_of_sale, *: convert legacy modules to ES odoo modules
*: l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos, l10n_in_pos,
l10n_sa_pos, pos_adyen, pos_discount, pos_epson_printer,
pos_epson_printer_restaurant, pos_hr, pos_loyalty, pos_mercury,
pos_restaurant, pos_restaurant_adyen, pos_restaurant_stripe, pos_sale,
pos_sale_product_configurator, pos_six, pos_stripe

We are about to refactor most of the Javasript code base of the point of
sale and related modules. In doing so, we will move a lot of files and
modernize the entire code-base. In order to avoid diffcult rebases,
their conversion to odoo-modules is done as a first step to avoid
getting lots of conflicts on files that were unindented, which marks the
entire file as being in conflict. Conflicts will occur during forward
ports but they will be easier to manage as the changes will be much
smaller in scope, and the author will have the context of the change
that causes the conflict in mind when dealing with it.

closes odoo/odoo#107621

Related: odoo/enterprise#34910
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-12-14 11:41:52 +01:00
Adrien Widart (awt) c321f825f9 [FIX] purchase_stock,stock_account: reconcile lines
In some cases, when billing a received quantity that is already
delivered, the account move lines of Stock Interim (Received) will
not be reconciled

To reproduce the issue:
(Need account_accountant, sale_management)
1. Create a product category PC:
   - Costing Method: FIFO
   - Inventory Valuation: Automated
2. Create a product P
   - Type: Storable
   - Category: PC
3. Create and confirm a PO with
   - 5 x P at $50
4. Process the receipt R
5. Create and confirm a SO with
   - 5 X P
6. Process the delivery
7. Create and post partial bill B01 related to PO:
   - 1 x P @ $60
8. Accounting > Accounting > Journal Items
   - Group By: Account
   - Note: There are three lines in Stock Interim (Receipt):
     - [AML01] Debit: 0, Credit: 250 (receipt R)
     - [AML02] Debit: 60, Credit: 0 (bill B01)
     - [AML03] Debit: 0, Credit: 10 (price diff from B01 because
       quantity already delivered)
     There is a partial reconcile between AML01 and AML02, AML03 is
       not part of this partial reconciliation
9. Create and post partial bill B02 related to PO:
   - 4 x P @ $60
10. Accounting > Accounting > Journal Items
    - Group By: Account

Error: The lines of account 'Stock Interim (Received)' are not
reconciled while it should

When confirming B01, we try to reconcile AML01, AML02, AML03. In the
reconciliation process, we first sort the AMLs and try to create a
partial reconciliation:
https://github.com/odoo/odoo/blob/01cb7e960f912c4758d30c04653b599937785799/addons/account/models/account_move_line.py#L2282-L2293
Because of the sorting, here is the order of the AMLs:
- [AML01] Debit: 0, Credit: 250
- [AML03] Debit: 0, Credit: 10
- [AML02] Debit: 60, Credit: 0

In `_create_reconciliation_partials`, we consume the AMLs in that
specific order. So, it first uses one credit line and a debit one:
https://github.com/odoo/odoo/blob/01cb7e960f912c4758d30c04653b599937785799/addons/account/models/account_move_line.py#L1863-L1872
(i.e. AML01 and AML02) and creates a partial reconciliation for
theses AMLs. It gives a temporary credit line of 190, but there is
no more debit lines, so the partial reconciliation is stopped (this
explains the note at step 8)

Later on, while posting B02, we try again to reconcile the lines of
Stock Interim (Received)
https://github.com/odoo/odoo/blob/493020b9317a439c0a61a34f37cc92b6779ef633/addons/stock_account/models/account_move.py#L249
At that point, we have three AMLs:
- [AML01] Debit: 0, Credit: 250 (same as above)
- [AML04] Debit: 0, Credit: 40 (price diff from B02)
- [AML05] Debit: 240, Credit: 0 (B02)

Back in the reconciliation progress, we try to get all involved AMLs:
https://github.com/odoo/odoo/blob/01cb7e960f912c4758d30c04653b599937785799/addons/account/models/account_move_line.py#L2284-L2287
It will be used later for the full reconciliation. To get the
involved ones, we recursively get the AMLs implied in the partial
reconciliation of AML01, AML04, AML05:
https://github.com/odoo/odoo/blob/01cb7e960f912c4758d30c04653b599937785799/addons/account/models/account_move_line.py#L2481-L2489
Therefore, because of the first partial reconciliation explained above,
we will find AML02 but not AML03. This is the reason why the full
reconciliation will not happen.

Working on the assumption that the note of step 8 is not a bug (i.e.,
AML03 is not expected to be part of the first partial reconciliation),
we need to provide as much AML as we can when calling the
reconciliation process.

OPW-3040171

closes odoo/odoo#107908

X-original-commit: 3050e23f94c865f9938863f191076f761b80fedb
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-12-14 10:35:28 +01:00
Adrien Widart (awt) 48f6cb4597 [FIX] purchase_stock,stock_account: balance Stock Interim
(Received)

In auto-avco, if a user delivers a products before billing its
receipt, the account Stock Interim (Received) will be unbalanced

To reproduce the issue:
(Need account_accountant, sale_management)
1. Create a product category PC:
   - Costing Method: FIFO
   - Inventory Valuation: Automated
2. Create a product P
   - Type: Storable
   - Category: PC
3. Create and confirm a PO with
   - 1 x P at $50
4. Process the receipt R
5. Create and confirm a SO with
   - 1 X P
6. Process the delivery
7. Create the bill B related to PO
8. Set the bill line unit price to $60
9. Confirm
10. Accounting > Accounting > Journal Items
    - Group By: Account

Error: The account 'Stock Interim (Received)' is not balanced
(Debit: 60, Credit: 50)

The account entries are:
- Credit 50 related to R
- Debit 60 related to B

There isn't any line for the price difference. Since [1], we don't
generate any price difference layer for the already-delivered
quantities. Before this commit, a layer was generated and posted on
account-side:
https://github.com/odoo/odoo/blob/a5b985e8449a1e858c3fb9a0a90a6d203e16f739/addons/stock_account/models/account_move.py#L68-L69
But, as explained in [1], we should generate the price diff layers
only for the remaining quantities, otherwise it would lead to some
errors on both stock and account side. That being said, we still
have something to do with the price diff related to the out
quantities. This is what this commit is about. In such case, we
generate some journal entries:
- we credit the account 'Stock Interim (Received)' with the price
  diff (the account is then balanced)
- we debit the account 'Expenses'

To do so, we:
- Bring back the method
  `_stock_account_prepare_anglo_saxon_in_lines_vals` from [2]
- Fix that method because both fields `analytic_account_id` and
`analytic_tag_ids` do not exist anymore [3]
- Update it so it behaves as described above

Note 01: in the steps, we have removed the case 'Receive, Return and
Receive again'. Such a flow breaks the whole accounting and would
not work with some other features. Therefore, we consider such a
flow as invalid (the user could rather create a new purchase order
to receive the quantities again)

Note 02: This behaviour is not supposed to work with the kits. This
commit prevents the lines to be posted in such situation. Suppose
the flow is in a "standard" order (PO, Bill, SO), we also do not
create layers for the price difference:

[1] 18912b05239e6fc5dab26ec4c930f9080882d127
[2] 35d6c58f86
[3] odoo/enterprise@a1eaf200d0

OPW-3040171
OPW-3071238

X-original-commit: 84733fb89faffe2480def97f076633056e16572f
Part-of: odoo/odoo#107908
2022-12-14 10:35:28 +01:00
sofiagvaladze 7a6b903830 [FIX] hr_expense: set 'name' and 'expense_line_ids' during report creation
Steps to reproduce
- Install Accounting
- Create user and employee, "user_acc", with Accounting-Accounting and no Expense rights
- Take the expense in "To Submit" state for the employee different than user_acc and create report
- Save the report.

Bug - We get the error that required field 'name' is not set and expense lines disappear.

task - 3099142

closes odoo/odoo#107903

X-original-commit: c5765be58dcdb3f6d766e6ce409a6e0f8a82e45b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-14 09:34:55 +01:00
MerlinGuillaume ed2a9c3a78 [FIX] project: recurring dates of monthly repeated task until date
Computing the recurrences of a task repeating every X months until a
certain date generates too much dates

Steps to reproduce:
1. Install Project
2. Go to Settings > Project > Tasks Management and enable Recurring
   Tasks
3. Open any project in the Project app and create a new task then edit
   it
4. Enable the Recurrent field of the task
5. In the Recurrence tab, edit:
   - Repeat Every: 6 Months
   - Until: End Date: one year from now
6. The recurrence message says there are 11 tasks but there should only
   be 2

Solution:
Generate the recurrences until the `repeat_until` date is reached if the
`repeat_type` is 'until', otherwise generate as much recurrences as the
count
Also relax the constraint on the `repeat_day` and `repeat_until` to not
raise an error if `repeat_until` is the last day of the month

Problem:
The recurrence of a task with `repeat_unit` month and `repeat_interval`
different than 1 with a `repeat_type` until creates too much tasks,
exceeding the `repeat_until`

opw-3076593

closes odoo/odoo#107910

X-original-commit: 236b383fd9d1ad6a5d39d8c4232b49864ec19b37
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-12-14 07:49:06 +01:00
Thibault Delavallée ab3497b889 [FIX] mass_mailing(_*): avoid sending fake emails
Some demo mass mailings are currently defined as being "in queue" in demo
data. This means they are about to be send by the mailing cron.

However we don't want demo data to send emails as

  * most of those emails are fake (e.g. targeting example.com);
  * real emails should not be sent (e.g. having by mistake a real email that
    will be spammed);
  * statistics resulting from those emails will not have any wow effect;
  * on SaaS this consumes email quota, and produces quite a big volume of
    unnecessary emails when people try the 16.0 version;

It is better to either have demo data of mailings done with traces, or keep
other mailings in draft. Otherwise the cron will send them. Flagging those
mailings is difficult, as emails are sent asynchronously and not during
install or update.

Even if this may lessen wow effect of some kanban view, better move mailings
currently "in queue" to "draft".

closes odoo/odoo#107904

X-original-commit: 0e11f4926be1800fc2b58feedcd81df24720ec19
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-14 07:49:03 +01:00
Victor Feyens e210860200 [CLN] sale: clean company & settings python code
Cleanups and fixes/improvements extracted from another task
on the settings of sale.

* indentation
* code simplification
* privatize method not meant to be called by rpc
* double quoted strings for strings shown to users, single quoted for
technical strings
* translate onchange warning message

closes odoo/odoo#107897

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-13 20:06:53 +01:00
Victor Feyens e40618e992 [MOV] sale: settings wizard to wizard folder
Part-of: odoo/odoo#107897
2022-12-13 20:06:53 +01:00
Goffin Simon 4be998412a [FIX] payment: Wrong use of write method on not stored field
Steps to reproduce the issue:

- Accounting > Configuration > Journals
- Click on Journal
- View metadata of Journal

Bug:

Even if no modification has been made to the journal, it marked current time
in Latest Modification By/Date

opw:3089551

closes odoo/odoo#107875

X-original-commit: 47999e7b1c9a52059f84abaafeac388f2991a621
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-13 19:11:22 +01:00
niyasraphy d04b6404ea [IMP] account, hr, l10n_latam_check: remove non existing image path in manifest
in account and hr module's manifest file non existing image path is specified in images key. removing this images key from manifest and remove empty images key from l10n_latam_check module

closes odoo/odoo#107346

Related: odoo/enterprise#34711
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-12-13 19:11:17 +01:00
Touati Djamel (otd) 3ac47d27f5 [FIX] mrp: display warning when archiving component product
Steps to reproduce the bug:
- Create a BoM with components
- Archive one of the components

Problem:
No warning is displayed for the user to inform that the product is
used as a component in a BoM

opw-3089104

closes odoo/odoo#107863

X-original-commit: 9b7c416387d93507b6f750aba58ad6233a59d512
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-13 18:09:51 +01:00
Joseph Caburnay fead26df53 [FIX] web: more lenient monetary parser
**Issue:**

- Install CRM.
- Change language to French.
- From CRM, open a lead that has `Revenu espéré` thousands as value, e.g. 10 000,00.
- Try changing `Revenu espéré` by deleting one of the thousands digit.
  E.g. 10 000,00 -> 1 000,00
- BUG: The modified value is not understood by the system.

**Solution:**

This is because the thousands separator from the French language is nbsp.
Coincidentally, the parsing logic assumes that the separator between the
currency symbol and value is also nbsp. So when inputting `1 000,00`,
the parsers thinks either `1` or `000,00` is the currency symbol.

We concluded that it's better to be less restrictive when parsing
monetary values. So, instead of making sure that the current input's
currency is compatible with the currency of the the field, we just
strip the non-numeric characters from beginning and end of the input
without validating the currency symbol, then parse the remaining
string as float.

This leads to a more user-friendly monetary input fields such that
inputting "DOGE 1,000,000.01" in a "$" monetary field will be
parsed as 1000000.01. NOTE that *no* currency conversion is performed.

**Minor breaking change:**

The second parameter `options` of the `parseMonetary` function is now
removed. Any existing use of that parameter is just ignored.

closes odoo/odoo#107862

X-original-commit: dc27f1f4c039bdbf84c55a4fb5364c6398c45949
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2022-12-13 17:03:25 +01:00
Joseph Caburnay 4e5eebf966 [FIX] web: generalize whitespace separator when parsing
**Issue:**

When the thousands separator is "nbsp" and the user inputs a value
that is "1 234", the parser will crash because the thousands separator
is different from what is manually inputted by the user.

This is problematic because when typing, it's very difficult for
users to enter "nbsp" character in their input.

**Solution:**

This change proposes that if the thousands separator is a whitespace,
we consider all whitespace characters from user input as thousands
separator. As a result, even if the thousands separator is "nbsp",
the system will successfully parse "1 234" as 1234.

X-original-commit: bffddcf015da9cf514fc25cc7f839e923e470d94
Part-of: odoo/odoo#107862
2022-12-13 17:03:25 +01:00
Joseph Caburnay 89c6124599 [FIX] web: properly parse expression
**Issue:**

- Set the decimal point to "," and the thousand separator to ".".
- In a float or monetary field, enter "=1.000,1+2.000,2"
- BUG: It's evaluated to: 30003

**Solution:**

Problematic evaluation steps:
```
-> parseNumber("=1.000,1+2.000,2")
   - thousands separator are removed and decimals are converted to "."
     so the string becomes "=1000.1+2000.2".
-> parseNumber("1000.1") + parseNumber("2000.1")
   - since "." is the thousands separator, it will be removed
     (replaced by empty string)
-> 10001 + 20001
-> 30003
```

Because the main parser `parseNumber` is recursive in nature, we
need to make sure that the logic that removes the thousands separator
and replaces the decimal point to "." is not called in the branch
that evaluates an input expression.

With this change, the new evaluation steps are:
```
-> parseNumber("=1.000,1+2.000,2")
-> parseNumber("1.000,1") + parseNumber("2.000,1")
-> 1000.1 + 2000.1
-> 3000.3
```

X-original-commit: 91eb5c40ce898428fb15d945d70510b92e9ebb03
Part-of: odoo/odoo#107862
2022-12-13 17:03:25 +01:00
Hubert Van de Walle (huvw) 2e497b886e [IMP] web: Add QUnit.debug type definition
closes odoo/odoo#107856

X-original-commit: 409fc809bafec2507342534bcdf4810ebffe9228
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-12-13 17:03:21 +01:00
Hubert Van de Walle (huvw) 96b4aac704 [FIX] web: conflict in qunit type definition
In the QUnit type definitions, there is a QUnit namespace and a QUnit
interface. When using a jetbrains IDE, it is confused between the two
and thinks the global QUnit is the namespace.
This means that it can't resolve QUnit.test, QUnit.module, etc

This fixes this issue by disambiguating between the two.

X-original-commit: 26dc799f841e51a6d57d427e095b662a45bc7e5a
Part-of: odoo/odoo#107856
2022-12-13 17:03:21 +01:00
maximilien(malb) ac9b4c941b [IMP] l10n_hr : Croatian localization
Improving:
- Chart of account
- Tax report
- Fiscal position
- Translation

Task-id: 2753362

Signed-off-by: Maximilien La Barre <malb@odoo.com>
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#99450

Related: odoo/enterprise#31003
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-13 17:03:17 +01:00
niyasraphy 6fa0763753 [IMP] base : search view for res.country model
closes odoo/odoo#106372

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-13 16:00:48 +01:00
Rohitkumar (roku) 41b3559ec9 [IMP] fleet: add order date field in fleet vehicle
Currently, when the vehicle is assigned, it is checked from the first contract date, now it
will be checked from the order date

In this Commit, We added order date  field in  fleet vehicle

task-3054981

closes odoo/odoo#107073

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-13 14:56:00 +01:00
Simon Genin (ges) 1d4164b729 [FIX] dx: js tooling: remove prettier cmp command from pre-commit
In this version of the tooling, the prettier files do not exist anymore.
We don't want to check if the files have changed, it will always be true
and trigger a reload of the tooling.

closes odoo/odoo#107825

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-12-13 13:51:52 +01:00
Simon Genin (ges) 2f6fd2048e [FIX] dx: js tooling: remove warning about glob syntax
The glob *.{js} should be written *.js
It was a relic from the *.{js,md} time.

Part-of: odoo/odoo#107825
2022-12-13 13:51:51 +01:00
FrancoisGe c82cb3b5cd [IMP] base: add widget in tree view rng validation
Before this commit, it was possible to define a <widget/> in the arch of
an x2many in list mode. But this was not supported in normal list views.

So in order to unify the api, we decided to support in the list
view as well.

In a future commit, we plan to improve the widget api to receive only
the necessary props.

closes odoo/odoo#107811

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-13 13:51:48 +01:00
Laurent Smet 990cce2b1b [FIX] point_of_sale: Fix account_bank_statement access rule
The field pos_session_id has been moved from account.bank.statement to account.bank.statement.line. See:
https://github.com/odoo/odoo/commit/7e23eda02fc00b4e4a85e3a71b14fb1081441a04

closes odoo/odoo#107744

X-original-commit: 9e7174475d3da0d238f105ca0603f1a0539ef1b1
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2022-12-13 13:51:40 +01:00
PoMa fda341dc62 [FIX] account,account_accountant: Journal items in kanban not visible
Journal Items menu was not visible out of debug mode, now it is visible

 Closes PR #105704

closes odoo/odoo#107668

X-original-commit: fbedc97a5479bace8b23122fc423abdeb2c1757a
Related: odoo/enterprise#34876
Signed-off-by: Laurent Smet <las@odoo.com>
2022-12-13 13:51:35 +01:00
PoMa 5883317ed4 [FIX] account,account_accountant: bank/cash related links
Before:
In the kanban card of Bank/Cash journals
 - Clicking the title of the journal opened recon widget (kanban) now it opens BSL list
 - Clicking on operations opened recon widget (kanban) now it opens BSL list
 - Journal Items view was opening recon widget (kanban) now it opens Journal Items
 In bank transactions tree view:
 - `Match` button was always visible, now it is visible if line is not matched, otherwise it renames to `View`

 Closes PR #105704

X-original-commit: 178991eafdadfd955a7aa68bdecf94a39ec8e2fe
Part-of: odoo/odoo#107668
2022-12-13 13:51:35 +01:00
niyasraphy b039c16bb3 [FIX] l10n_ma: fix module name
update the module name of l10n_ma. Morocco is the real country name and currently upon searching with country name, app is not listed.

closes odoo/odoo#107650

X-original-commit: f6438dbca6782401f1b23497271398210b113df4
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2022-12-13 13:51:29 +01:00
Bastien Fafchamps (bafa) 357cd41085 [IMP] Web: SearchPanel, display an empty state when there is no record
Purpose:
When a list view with searchpanel is empty, the searchpanel is completely
empty and white, and it's unclear what it's for. Make it obvious by
displaying an empty state. This will typically happen in some views when
you have no data or don't have the groups needed to show filters.

Spec:
Display the following paragraphs with the bs classes "small" and "text-muted":
"No quick filter available."
"Update the filters in the search bar to display more records."
"Quick filters will become available if the records shown can be filtered."

closes odoo/odoo#107379

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-13 13:51:26 +01:00
Julien Van Roy 463df2506c [IMP] account_edi_ubl_cii: add support for A-NZ Peppol BIS3
Add edi_format "A-NZ BIS Billing 3.0" used in Australia and New-Zealand.
This format is derived from Peppol BIS Billing 3.0.

task-2994014

closes odoo/odoo#103056

Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-12-13 13:51:21 +01:00
lejeune quentin d3ccbe292f [FIX] hw_drivers: In IoT adapt path to filename
From the commit 2ab231bd7af609a751ed8168cc094dfeb1012eda
We introduce a error in the path to read Linux file

In this commit we correct the access to the file
which is in the "home" of the raspberry

closes odoo/odoo#107779

X-original-commit: e427d0a2147896aa4311488ebc13f45b84cb330c
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2022-12-13 12:47:51 +01:00
Matthew Harrison 36191e971a [FIX] payment_paypal: correct dead link
closes odoo/odoo#107703

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-12-13 12:47:49 +01:00
Denis Ledoux 3752b3166e [REF] base: set USD as default currency for the main company
There are three rationales behind this change to set USD as default
currency and to enable it in the demo data, from the beginning.
With a demo database, before this revision:
1. On runbot, with all modules installed, it's already USD the default
   company currency. It's only when you install a module not depending
   on account that it's EUR the company currency by default (e.g. CRM)
2. in the base demo data,
   the company is set in the United States but with the currency EUR,
3. before installing account, the company currency is EUR,
   after installing account, the company currency is USD,
   this is due to the fact as the company is in the United States,
   the US Chart Of Account is installed, switching the company currency
   to USD.
4. when you install a demo database with a module not depending on
   account, you are left with a database without any active currency,
   and the monetary fields therefore do not show any currency.
   For instance, install only CRM with demo,
   you have no currency symbol before or after the expected revenue,
   which is not the best user friendly experience.
   On runbot you do not feel it because all modules are installed,
   therefore with account installed, which activated the USD currency.

Additional weird thing with point 2.:
- Unit tests in modules not dependent on account with the
  post-install tag had to handle this sudden change of currency change
  before and after installing account.
  For instance, when running their unit tests with only their module,
  but not account, the company currency is EUR,
  but when executing the same unit test with all modules installed,
  the company currency is USD.
  The unit tests had to handle this sudden change within the unit test,
  for instance by setting a 1.0 rate for their own company currency,
  which shouldn't be the case: the rate of your own currency should
  always be 1.0.

closes odoo/odoo#107113

Related: odoo/enterprise#34613
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-12-13 11:47:49 +01:00
Walid HANNICHE (waha) 96753cc371 [FIX] l10n_gcc_invoice: arabic invoice product name is displayed twice
Steps to reproduce:
-install l10n_sa_invoice module
-switch to a company in Saudi Arabia (SA company)
-create and print an invoice with a product that has arabic translation

Bug:
When adding a product and the Arabic translation.
If we add an internal reference it is added to the template,
Odoo directly concatenates this with the product name.
The result is the product name being duplicated.

Fix:
display line name and add the translation if it's different

opw-2829934

closes odoo/odoo#107798

X-original-commit: ad585bc41f49d047c150ceb9dc88bd9859fa046b
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2022-12-13 10:05:17 +01:00
Ivan Yelizariev a73cb1ca95 [FIX] website_sale: add noFuzzy when it's active
`website_sale` module has custom handler for form submit event. That handler
ignores `noFuzzy` attribute. As result, adding `data-no-fuzzy="1"` to
`input[name=search]` works everywhere, but not on shop product list pages.

STEPS:

1. Settings > Technical > Views > website_search_box_input & website_search_box > Code in data-no-fuzzy="1" into the <input> tag
2. Go to Website >.Shop > Customize > Enable ecommerce categories
3. Search for a product on the main shopping page and enter > Observe the URL > There is no noFuzzy param
4. Go to any product's page on the website > search for a product through the search bar and enter > Observe the URL > there is a noFuzzy param passed

opw-3051319

closes odoo/odoo#107771

X-original-commit: 1df3b14f86bada2e2cf278d2b4e591996e9e8db8
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-12-13 10:05:12 +01:00
Maruan Aguerdouh (magm) fd62ef58b8 [FIX] purchase: no request for quotation views won't overlap dropdown
Steps to reproduce:

- Go to Request for quotation.
- Make any search that retrieves no values. (So we get the "no request
for quotation found." message)
- Open Filters dropdown menu. (or Any menu which lenghts will be over
this message)

Issue:

The dropdown menu will be under the message, the message is overlaping
the dropdown menu when it shouldn't be.

Solution:

We need to set the message to `position: relative` instead of
`position: static` so we take into account the right z-index for the
message.

opw-3080171

closes odoo/odoo#107409

X-original-commit: 47a6a555c5bcedffdfda7586ecbe4311d2a45e5f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2022-12-13 10:05:09 +01:00
Valentin Vallaeys (vava) 6a0a9f8b3e [IMP] sale: color consistency for sale order status
Before this commit, the color badge for draft and sent quotations had
the same color. Same as the line color in list view.

After this commit, color badges and lines are different between draft
and sent quotations.

task-3010707

closes odoo/odoo#106843

Related: odoo/enterprise#34188
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-12-13 10:05:06 +01:00
Guillaume (gdi) 7bfdea4214 [FIX] website: scroll correctly when the url contains an anchor
When the url redirects to an anchor on a website page, the page must
scroll correctly to the section. This commit allows to do that by taking
into account the size of the navbar. The bug is visible by following
those steps:
- Drop a text - image block on a page
- Drop a picture block under text - image block
- Create a link to target the picture block
- Put link to block picture in the "Learn more" button
- Save
- Right click on the "Learn more" button and open link in a new tab

=> The page is not scrolled correctly to the picture block.
Note that the bug is not present if the header has scroll, disappear or
fade out as scroll effect.

task-2818629

closes odoo/odoo#92777

Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2022-12-13 10:05:00 +01:00
Solan Delvenne (sode) c8b9e70ced [FIX] snailmail: fix follow-up reports layout for snailmails
Follow-up reports were previously not handled by the commit fixing
invoices. This commit aims to fix that.

closes odoo/odoo#107787

X-original-commit: 768cfbe095cd6757771dcc683637fd510b0fbddb
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
Signed-off-by: Solan Delvenne (sode) <sode@odoo.com>
2022-12-12 20:39:47 +01:00
Guillaume (guva) e858ce0d86 [FIX] account: card color kanban view
The kanban cards did not take the class
oe_kanban_color.
This is because it was set on the child div
instead of the parent one.

opw-3069024

closes odoo/odoo#107778

X-original-commit: 9078761d10289446cfd3881e9df9061075441440
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2022-12-12 19:18:34 +01:00