Commit Graph
159186 Commits
Author SHA1 Message Date
Sébastien Theys 94845bb63f [FIX] mail: allow non-internal users to create chat from token
Follow up of https://github.com/odoo/odoo/pull/90415
After removing the public field, the equivalent access is to set the
allowed group to empty.

closes odoo/odoo#114729

X-original-commit: fcafd602dda4f896ac8b91c81c00ee723afd6634
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-09 12:00:56 +01:00
William Henrotin ef4b80c408 [FIX] mrp_subcontracting: merge quantity changes in PO
Before this commit, updating a purchase quantity of subcontracting
product will try to not merge the new and old move to keep the two chain
separated as much is possible and avoid side effects (receipt move,
subcontracting moves, resupply moves). Some were merged, some cancelled,
...

This had two issues:
First, not merging the quantity was not guarantied
as you can specify you don't want to merge them with others but it's not
possible for a stock move to say to any other move do not merge with me.

Second, by not merging the receipt moves, we duplicate every other
object on the chain. This pollute the database uselessly.

opw-3147446

closes odoo/odoo#114739

X-original-commit: 0b1bcfacb13c7de480f30015b91db11ed03f2dfe
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-09 10:51:43 +01:00
thsh-odoo e651c2b3aa [IMP] base: added mobile field as optional field in tree view
Before commit:

There was no mobile field in the optional fields of tree view in res.partner.

After commit:

Added the mobile field as optional field.

Task-3184771

closes odoo/odoo#113243

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-09 10:51:40 +01:00
Odoo's Mergebot b7bcfb7e1d [PERF] crm: speedup daily usage of intensive CRM
PURPOSE

After internal feedback, improve crm activity reporting and lead duplicates
finding by tweaking the feature and adding indexes.

SPECIFICATIONS

[PERF] crm: add index on phone_sanitized

This allows to speedup exact match searching, notably in lead duplicates.

[PERF] crm: rewrite duplicates computation

Criterions are now

  * email domain exact match;
  * phone_sanitized exact match;
  * same commercial entity;

[PERF] mail: update index on mail_activity_type_id

Only not null values matter.

[PERF] crm: fix performances of activity report

Remove inclusion of discussion messages in the query. Keep only activities-based
messages.

See sub commits for more detailed rationales.

Task-3129356 (Crm: Fix activity report performances)
Task-3142659 (Crm: Fix duplicate leads computation performances)

closes odoo/odoo#112535

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-09 10:51:38 +01:00
Thibault Delavallée c7a03dcd65 [PERF] crm: fix performances of activity report
RATIONALE

Activity report is slow, as it makes a complex query inside mail.message table
which is one of our biggest table with crm.lead table, also a big table. This
activity report could be speeduped by looking only on activities, not including
discussions messages.

SOLUTION

Rationale is that discussions can be about whatever (real discussion with
customers but also internal discussion, notes, ...). What matter here is to
report on activities like phonecalls, followup emails, meetings, ... to have
a global view of sales people activity.

SPECIFICATIONS

Remove inclusion of discussion messages in the query. Keep only activities-based
messages.

Task-3129356 (Crm: Fix activity report performances)

Part-of: odoo/odoo#112535
2023-03-09 10:51:37 +01:00
Thibault Delavallée 9bb1d37924 [PERF] mail: update index on mail_activity_type_id
RATIONALE

Activity report is slow, as it makes a complex query inside mail.message table
which is one of our biggest table with crm.lead table, also a big table. This
activity report could be speeduped by looking only on activities, not including
discussions messages.

SPECIFICATIONS

Index on "mail_activity_type_id" field of <mail.message> is updated as main
searches include a not null on mail activity type id field.

Task-3129356 (Crm: Fix activity report performances)

Part-of: odoo/odoo#112535
2023-03-09 10:51:37 +01:00
Thibault Delavallée b1695201b8 [PERF] crm: rewrite duplicates computation
RATIONALE

Duplicates computation on leads is slow when having a lot of leads. We can
simplify the heuristic to keep only relevant terms and use tailored fields
to find duplicates based on email and phone, to speedup the computation while
loosing few duplicates or avoiding false duplicates.

SPECIFICATIONS

We remove
  * an ilike on email_normalized (slow and exact matches are what really
    matters);
  * an ilike based on partner_name and contact_name (as lead is a contact
    oriented record, better optimize email and phone / mobile than names that
    are weak criterions);
  * an ilike on phone_mobile_search, which was searching on both fields
    phone and mobile;

Criterions are now

  * email domain exact match;
  * phone_sanitized exact match;
  * same commercial entity;

Main change is that only phone_sanitized is used for exact match. Partial
matching based on phone and mobile number is lost. That should not be an
issue as real duplicates should come with a complete phone or mobile number
and not partial numbers. First found in phone / mobile populates the phone
sanitized field, meaning if we have two different numbers, only one is used
for duplicate finding. This is considered acceptable.

Other main change is the removal of partner name / contact name search. Those
are weak criterions and did not return any explicit result when used internally.

Task-3142659 (Crm: Fix duplicate leads computation performances)

Part-of: odoo/odoo#112535
2023-03-09 10:51:37 +01:00
Thibault Delavallée 4ad44d1c45 [PERF] crm: add index on phone_sanitized
RATIONALE

Duplicates computation on leads is slow when having a lot of leads. We can
simplify the heuristic to keep only relevant terms and use tailored fields
to find duplicates based on email and phone, to speedup the computation while
loosing few duplicates or avoiding false duplicates.

SPECIFICATIONS

Index on "phone_sanitized" field of <crm.lead> is added as btree_not_null as
it is mainly used to search for direct matches. Partial searches are not the
main usage of this field.

Task-3142659 (Crm: Fix duplicate leads computation performances)

Part-of: odoo/odoo#112535
2023-03-09 10:51:36 +01:00
Demesmaeker 7f2ae9ed5b [IMP] payment(_adyen): allow partial capture
Before this commit, it was not possible to partially capture a
transaction from Odoo, and doing so in the provider backend would often
result in a full capture in Odoo when capture was supported.

With this commit, partial captures are made available in Odoo directly
from the sales order or invoice, for providers that support them.
Provider can either only support full capture or also support partial
ones. It also optionally managed the automatic void of the remaining
amount at the user request when multiple captures are supported by the
provider.

As of now, the only acquirer allowing partial capture is Adyen.

task-2728768

closes odoo/odoo#87251

Related: odoo/enterprise#35205
Related: odoo/documentation#2063
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-03-09 10:51:29 +01:00
aath-odoo 693bc24f1d [FIX] web_editor: remove blockquote if first element
Before this commit:

unable to remove blockquote and heading element if first element.

After this commit:

removed element on backspace even if first element.

Task- 3004556

closes odoo/odoo#114727

X-original-commit: f0bbf1aab823524a74a52f694c0564dd23618a90
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-09 09:41:43 +01:00
amdi-odoo 226ed6001d [IMP] survey: add matrix visual help
Purpose
=======
In addition to the current alert message, when a user
forgot to pick an answer in a matrix, highlight in red
the rows where the answer is missing.

Task-3162051

closes odoo/odoo#111715

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-03-09 09:41:40 +01:00
Rémy Voet (ryv) 45115cb9c2 [IMP] core: add a representation of a TriggerTree
The TriggerTree class does not have a specific __repr__().  It thus
falls back on dict's __repr__(), which does not show the root of the
tree.  This makes debugging hard and confusing.

closes odoo/odoo#113521

Signed-off-by: Raphael Collet <rco@odoo.com>
2023-03-08 22:29:51 +01:00
Rémy Voet (ryv) f5503bf295 [REM] core: remove useless/inefficient flush_all in unlink
Doing a `flush_all` at the end of `unlink` is useless and can generate
extra queries for no reason. Remove it.

Part-of: odoo/odoo#113521
2023-03-08 22:29:51 +01:00
Bastien (bvdn) 2e78356f82 [IMP] project,*: create new task.state Selection field
Before this PR the task state was fixed by the kanban_state field which was useful when you use the stage of the project as parts of a pipeline,
but not relevant when users are using stages as bucket lists. (specific examples at the end of the specs)

The goal of this PR is to provide users a way to mark their tasks as done with a simple button press,
while keeping the option to label a task as Approved, Canceled or Requesting changes like in the old kanban_state field.

The kanban_state of a task had no impact whatsoever on other tasks of the pipe, we would like to change that and make the task state have an influence on its dependent tasks.

The state will also have influence over the 'recurrent' tasks (to be implemented in Task #3084945)

If you want a better description of those changes with screenshot and colors check specs of:

Task-3084930

PRs:

See odoo/enterprise#35359
See odoo/upgrade#4367

-----------------------------------------

Interaction with blocking tasks:
the closed values which mark the task as closed or finished:
- Done
- Canceled

The Open values when the task isn't finished yet:
- In progress
- Changes Requested
- Approved
- Waiting (which is not selectable)

Where to change the state of a task:
- For kanban and form views: same place as kanban_state (bottom right of kanban card, top right of form view)
- For list view:  left of list (after task priority)
more details about the state widget in state field widgets part

Interaction with existing fields
- is_closed: which was determined by the task.stage_id.fold, now a task is closed when in one of the following stages
 - Done
 - Canceled
a closed task is considered as finished, the time of the closing will be stored in the date_last_stage_update field

- is_blocked: a task is considered blocked if ANY of its blocking task is in one of the blocking states (more details about this in the following part Interaction with blocking tasks):
 - in Progress
 - Changes Requested
 - Approved
 - Waiting

!! important !! is_closed and is_blocked are not mutually exclusive, you can have a task that blocked and is closed at the same time, the reason why will be explained late

date_last_stage_update: this field is updated everytime the task goes into a closing state OR when the task changes stage.
We need to check that the value is updated in each case (using the already available filter)

Interaction with blocking tasks
the state of a task can now be changed by its blocking tasks following the logic:

if ANY of the blocking tasks is NOT closed (so its state is in one of the open values) the task is considered as blocked

- if a task is blocked and NOT closed its state will switch to Waiting
 - the Waiting state will display an unclickable hourglass icon on the task kanban/list views, once in the waiting state you can't change the state of the taskfrom the kanban/list views
 - a blocked task state can be changed through the form view, so you can override the 'block' by choosing a closed state (only done or canceled)
  - once overriden, the task will change to the closed state the user wants, but the task is still blocked so in case where the user comes back to an open state, the task will automatically switch back to the waiting state (according to the state before the block)
- if the blocking task switches to a non-blocking state, the task will not be considered as blocked anymore and its state will switch back to In Progress

Default values
the default value is always in progress

Special cases
when a task is moved from a stage to another one
- if the state was in one of the open states (approved, changes requested, in progress ) the state goes back to In Progress
- if not, the state stays the same
when a task is moved from a project to another one
- the state goes back to In Progress
when a task is duplicated
- if the state was in one of the open states (approved, changes requested, in progress ) the state goes back to In Progress
- if not, the state stays the same

closes odoo/odoo#107593

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-08 21:33:03 +01:00
Andrea Grazioso (agr-odoo) 5efbdb0652 [FIX] sale: restriction on partner credit warning
In Settings>Accounting set 'Sales Credit Limit' to 10,000
Create a user with sales access but no accounting rights
Login with the sale user, create a quotation, set a partner
already exceeding the limit

No warning shows up.
This occurs because the field is restricted to users having account
access

opw-3202384

closes odoo/odoo#114685

X-original-commit: 317977e97d93f572697585d006b5bca5c7365428
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-03-08 17:33:45 +01:00
Rodolpho Lima 1e2ab5e85c [FIX] web_editor: make OdooEditor test utils an odoo-module
This commit transforms the OdooEditor test utils file into an
odoo-module and makes it available for importing in QUnit tests.

closes odoo/odoo#114643

X-original-commit: df2125b7ce50031f0de8f5d78536d50e6c688dd1
Related: odoo/enterprise#37896
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-08 17:33:40 +01:00
Victor Feyens 24ccf7d9b0 [CLN] *: useless type info for actions
The type fields of actions already defaults to
the model name in the base model definition.

Therefore, specifying `ir.actions.server`, `ir.actions.act_window`
& so on as type is useless (and adds noise since it's the same as
the action model).

closes odoo/odoo#114539

Related: odoo/enterprise#37855
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 17:33:37 +01:00
Maruan Aguerdouh (magm) d667744f23 [FIX] calendar: hours displayed in calendar view month
Steps to reproduce:

-Go to calendar
-Change the view to see the whole month.
-Watch every meeting we have.

Issue:

We are missing the starting hour for the meetings that we had working on
previous versions.

Solution:

Added proper way to display the hour to the
`calendar.AttendeeCalendarCommonRenderer.event` template.

opw-3119858

closes odoo/odoo#114251

X-original-commit: 90020976ab2a0e6a35ab4624ff227c30edc8d249
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Maruan Aguerdouh Mohtar (magm) <magm@odoo.com>
2023-03-08 17:33:31 +01:00
xO-Tx e2c86f6caa [IMP] website: remove 'styling' option from image wall
Removed since user can achieve good enough results using border
and round corner options.

IMPORTANT: the option could be removed from image wall only (and
not from image gallery) using "data-dependencies=slideshow_mode_opt"
(since they use the same code), but it's removed from both "for now".

task-2692129

closes odoo/odoo#81959

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-03-08 17:33:28 +01:00
Renaud Thiry beb02b5c8e [FIX] mass_mailing: hide menu on mobile
closes odoo/odoo#114543

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-08 16:26:16 +01:00
qsm-odoo 7c533fce5c [FIX] web: properly display table texts over any background
Bootstrap tables can basically be customized with the `$table-bg` and
`$table-color` variables. The problem is that, by default, BS4 defines
them so that the background-color is null (so transparent: displaying
the background-color of its ancestors) but the color is forced to the
body color (by default: white). This is a problem as soon as the
ancestors background colors are a color close to the body text color:
the text becomes invisible. For instance, in website:
- Set a body background color to black, the body text will automatically
  become white.
- Add a table in a snippet: still ok, the text in the table is white
  over the black body (the table being transparent).
- Then set the snippet background to white -> the table text will still
  be white... but now over a white background.

This should be reviewed in master: it should be ok to set the variable
$table-color to `null` thus letting the table be transparent and have
the same text color as its parent. But in stable, changing a color
variable to `null` could break customizations relying on the fact this
is a set color. It would also not make sense if the user set up a
`$table-bg` value going well with table text forced to the body color.
Instead, here, in the very specific case we have a transparent table bg
and table color equal to the body color, we temporarily unset the table
color variable for the duration of the bootstrap table rules.
Note: we cannot create a rule in an "Odoo file" to fix this as unsetting
the color for the `.table` rule would also unset the color in the case
of a `.table.bg-XXX` where we still want `.bg-XXX` to force the color.

task-2728923
opw-3048306
opw-3180568

closes odoo/odoo#114631

X-original-commit: 02c2cfdff7c29252c7036e587b12d82442906e59
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-08 15:14:41 +01:00
Touati Djamel (otd) 1469b5e7b5 [FIX] mrp: compare the quantities with float compare
Steps to reproduce the bug:
- Go to decimal accuracy > product unit of measure
    - Change the Digits from 2 to 4
- Create a storable product “P1”:
    - Create a BoM:
        - Add 1 unit of a component
- Create a MO:
     - Product : P1
     - Qty to produce: 41,0654
     - Confirm the MO
- click on Action and try to split the MO in two:
    - MO_1: qty 35,9757
    - MO_2: qty 5,0897
- Validate the split

Problem:
A user error is triggered, “Unable to split with more than the quantity
to produce.”
While (35,9757 + 5,0897) = 41,0654

we have to use `float_compare` to avoid this kind of error

opw-3178441

closes odoo/odoo#114672

X-original-commit: dbaf8da533f4587f5ca9b0b82bea46488ba6e05a
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-08 13:49:16 +01:00
nda-odoo af3938c182 [FIX] stock_account: anglo-saxon accounting & storno
First issue: post a credit note

Steps to reproduce:
- enable anglo-saxon accounting and storno
- create a storable product with sale price = 50 and cost = 30
- set costing method FIFO and automated inventory valuation on product category
- create a credit note using this product
- post credit note

Error:

There was a problem with the following move(s):
- Move with id 18
	The debit and credit should be negative and only one can be set

Second issue: return a product

In anglo-saxon accounting, returning a product means creating a reverse move.
Reverse move in storno should have a negative debit/credit.

opw-3110934

closes odoo/odoo#114671

X-original-commit: f24a87b1d0bb3a18ef1d2d4cd23fb34bf29d4bfb
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-08 13:49:14 +01:00
niyasraphy c6359dc342 [FIX] repair: display description of tax in repair report
before this commit, even if the tax description is set in the tax, in the repair report it always displays the tax name.

after this commit, as in the sales, purchase and invoice reports, if tax description is set, repair order will display the tax description in the report.

closes odoo/odoo#114670

X-original-commit: e9ba4ae9608f6139d3fb1633d0e3287cb7348cb7
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-08 13:49:11 +01:00
niyasraphy 357a670cb1 [FIX] purchase,stock: traceback field used in domain missing in view
before this commit, enabling the mass editing for the picking operation type tree view or for purchase.order tree view using the studio, throws the exception.

* install studio
* open purchase order tree
* enable mass editing for the tree from studio app
* exception will be shown

after this commit, on enabling mass editing on this tree view, will not throw exception.

closes odoo/odoo#114669

X-original-commit: dad9d98697781307a1cb537e8e818a775b50432a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-08 13:49:08 +01:00
Xavier Morel eb5515bee9 [ADD] core: support for binding IPv6 in worker mode
Because Werkzeug supports ipv6 natively (and has since ~2010
pallets/werkzeug@13a76262a4), running
Odoo in threaded mode allows binding to an ipv6 address.

However the prefork server is part of Odoo, and only creates
AF_INET (ipv4) sockets. Thus switching from threaded to worker mode
breaks the bind.

Add a family switch on the `http-interface`, so binding to ipv6
addresses also works in ipv6. Gevent already does that switching
internally, so the evented worker works out of the box, it was only
the prefork / workers which did not.

Looking at both the Werkzeug and Gevent implementations:

- https://github.com/pallets/werkzeug/blob/f9906fa6d83dd668f9214acef458419756bbc062/src/werkzeug/serving.py#L607-L614
- https://github.com/gevent/gevent/blob/1e412d35526183b26c1abf2eb658cbef661f5f70/src/gevent/baseserver.py#L415-L433

Both primarily check whether the host contains `:`. Werkzeug also
checks if `socket.AF_INET6` exists, however gevent doesn't bother with
that. Looking at the
source (https://github.com/python/cpython/blob/7d801f245e2021d19daff105ce722f22aa844391/Modules/socketmodule.c#L7419-L7421),
it is indeed possible for `AF_INET6` to be missing, however that
requires specifically compiling Python in an environment which doesn't
support IPv6.

Meanwhile it's also possible to disable ipv6 at runtime, in which case
I'd assume the `socket.AF_INET6` constant is present, and creating the
socket fails, which nobody guards against. Therefore just ignore the
entire thing, it doesn't seem worth the hassle (or the questioning) to
check whether the constant is present, especially since this is only a
concern when the user specifically requires an IPv6 address.

Fixes #35782

closes odoo/odoo#114666

Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-03-08 13:49:05 +01:00
Vincent Larcin 055cc1a0f0 [FIX] project: move property fields to the correct task search view
Property fields introduced in https://github.com/odoo/odoo/pull/112005
were added to the Project tasks search views, but not in the right view
according to the views inheritance rules introduced in https://github.com/odoo/odoo/pull/106015.

This commit moves them to the correct search view.

closes odoo/odoo#114647

Enterprise: https://github.com/odoo/enterprise/pull/37899
Related: odoo/enterprise#37899
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-08 13:48:57 +01:00
Vincent Larcin fc52ee2530 [FIX] project: move property fields to the end of the list view
The property fields introduced in the project.task list view
in https://github.com/odoo/odoo/pull/112005 appear in the middle
of normal fields in the column order.

This commit moves them so they are always at the end instead.

Enterprise: https://github.com/odoo/enterprise/pull/37899
Part-of: odoo/odoo#114647
2023-03-08 13:48:57 +01:00
Nicolas Bayet de486ad72e [FIX] web_editor: show a default selection in collaboration
Before this commit, whenever a peer had no selection in the editor, no
selection would appear to the other collaborators. It was therefore
visually impossible to know excaltly to how many people someone is
connected.

Now, we set the default selection to be in the first node of the
document.

Additionnaly, some selection were not displayed because the call to
`getClientRects` did not return any rect. By creating a deep range
through the use of `getDeepestPosition`, we ensure to retrieve the
selection rect.

task-3217719

closes odoo/odoo#114583

X-original-commit: f47b306c5f37a43849975e4b7afb2819c80c809e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Nicolas Bayet <nby@odoo.com>
2023-03-08 13:48:51 +01:00
Nicolas Bayet 614a551538 [FIX] web_editor: comment about get_missing_steps return value
The comment that describe the
`missingSteps === -1 || !missingSteps.length` condition was wrong.

task-3217719

X-original-commit: 8396878160eceb974c02273f846c180ae4945a7c
Part-of: odoo/odoo#114583
2023-03-08 13:48:50 +01:00
Nicolas Bayet d90841d7c4 [FIX] web_editor: process historyStepsBuffer
Before this commit, any history step received before the history is
fully synchronised (`historySyncFinished`), would not be processed.

As a fail safe, this commit adds a buffer that will be processed as
soon as the history synchronization is finished
(`historySyncFinished`).

task-3217719

X-original-commit: acb58f921721b162954146f3c5364cb26823265f
Part-of: odoo/odoo#114583
2023-03-08 13:48:50 +01:00
Nicolas Bayet 6118e3439d [FIX] web_editor: fix localeCompare typo
In the method `isClientFirst`, if
`clientA.startTime === clientB.startTime` is true (which should happen
exceptionally), the code calling `localCompare` would fail as the
method name is `localeCompare`.

task-3217719

X-original-commit: 974e6a5d98b4ab6dc73d63e4acd4c4d3f11a6f0f
Part-of: odoo/odoo#114583
2023-03-08 13:48:50 +01:00
Nicolas Bayet 8652c2d3b0 [FIX] web_editor: prevent adding data-last-history-step to history
Before this commit, the mutation that add `data-last-history-step` was
added to the history. Without the collaboration, it would not be
problematic but when the collaboration is activated, that step is
broadcasted to the other peers but shouldn't as the mutation is
considered to be technical and should not be included into the
undo/redo mechanism.

task-3217719

X-original-commit: bf45295821495375784f2f817448e2c63f892510
Part-of: odoo/odoo#114583
2023-03-08 13:48:49 +01:00
Denis Vermylen 30cd409d22 [FIX] mail: websocket HTTP routes for guests
When contacting the server through the /websocket route, self.env.uid is
never set for the public user as we don't go through the
`_auth_method_public` method.

But through HTTP, it is set which is why guests were not subscribed to
their channels as their self.env.uid corresponded to the public user.

So we use request.session.uid instead, which remains unset for public
users.

closes odoo/odoo#114659

X-original-commit: 7059fdd2c8c36d6741d943ac2b61e971a4d05dcf
Signed-off-by: Denis Vermylen (dve) <dve@odoo.com>
2023-03-08 12:42:06 +01:00
Abdelouahab (abla) d8a1928593 [FIX] stock: make reception report srollable
To Reproduce
============
- on settings enable Reception Reports
- for a storable product, create multiple sale orders (something above 10 depending on screen size)
- from purchase app make quotation for same product with quantity that covers these sale orders
- on deliver > allocation, the list is not scrollable

Problem
=======
The `div` containing the data doesn't have a style that makes it scrollable

Solution
========
add `overflow-y: auto;` to `.o_report_reception`

opw-3199037

closes odoo/odoo#114611

X-original-commit: 0c51e9e93fb24ede97411cbcd7bf1e75ded9f7aa
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-08 12:42:03 +01:00
Jorge Pinna Puissant 3161f1f6dd [REF] web: standardize parseFieldNode and parseWidgetNode
This commit standardizes both parsers, this commit also leaves all other
(non-dynamic) attributes on the "attrs" object. This means that all
already processed attributes of the nodes are removed from the attrs
object.

Part-of task-id 3179751

closes odoo/odoo#114581

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-08 12:42:00 +01:00
Raphael Collet be278780f7 [FIX] core: first onchange when adding a line in a one2many field
Consider a form view with a one2many field, which has no form subview.
Also the form view of the comodel (the one2many field's lines) contains
the inverse many2one field of the one2many field.  When adding a new
line on some existing record, the form view shows the many2one field as
empty, instead of being the main record.

Explanation: the form view of the line invokes onchange() with the main
record's values (dict) as the value of the many2one field.  Inside
onchange(), the field is actually set to a new record corresponding to
the main record.  Alas, when that value is sent back to the form, the
new record is serialized as False.

Solution: let onchange() serialize the new record as its origin record
instead.

closes odoo/odoo#114648

X-original-commit: d137ea4915da8d46909fcb082b5a88fd347874a4
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-03-08 11:37:10 +01:00
Patrick Hoste 8bcdc5f82f [FIX] auth_password_policy: add PasswordField template to manifest
This commit adds the PasswordField template to the manifest
which was missing after being extracted from the JS Component.
Introduced by https://github.com/odoo/odoo/commit/688986f888f2fe2371d58b74ded81315ba6bb353

Task-3222527

closes odoo/odoo#114645

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-08 11:37:07 +01:00
william-andre f075cba176 [FIX] account: module installation in post init
There is only one module that can be installed, key change was forgotten
during refactoring during initial dev.

closes odoo/odoo#114544

Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-08 11:37:04 +01:00
aliya e84d479ee3 [FIX] l10n_co: fix accounts on tax repartition
The most recent update in l10n_co broke tax repartition: incorrect accounts are assigned to withholding taxes.

This commit fixes the accounts on taxes and adds missing accounts to Colombian CoA.

task-3212928

closes odoo/odoo#114471

Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-03-08 11:37:02 +01:00
FrancoisGe a8ad4b5b57 [FIX] web: Save & New with a context dependent parent record
Before this commit, in x2m fields with a parent record dependent context,
the context used to generate default values for a new record by clicking
on "Save & New" could be wrong. It was not based on the edited values of
the parent record.

How to reproduce:
- Go to a form view with a text field (field_a) and an x2m field with the
  context { default_field_b: 'field_a' }.
- Edit the 'field_a'
- Click on "Add a line"
A dialog opens with the edited value of 'field_a' as the value for 'field_b'
- Click on "Save & New"

Before this commit:
    A dialog opens with the unedited value of 'field_a' as the value
    for 'field_b'

After this commit:
    A dialog opens with the edited value of 'field_a' as the value
    for 'field_b'

closes odoo/odoo#114460

X-original-commit: b22ef9d2cc4119c8cd6e9c72103279e37f043440
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-08 11:36:59 +01:00
Walid HANNICHE (waha) 615aa00daa [FIX] stock: unit price rounding
Steps to reproduce the issue:
. Change the decimal accuracy of the product price to 0
. Create a storable product and set the Vendor Tax
. Create a purchase order with that item.
. Set the unit price to have 0 decimal places. E.g: 20
. Change the demand quantities to 10
. Confirm the purchase order -> Traceback

Bug:
wrong key word arg used for _float_compare for this PR [1]

Also this PR, remove the rounding on `total_void` in `_compute_all()` to
ensure the price unit have the maximum precision. Usually, the price
unit is rounded following the 'Product Price' accuracy rather than the
currency one.

opw-3136160
[1]:https://github.com/odoo/odoo/pull/105080

closes odoo/odoo#114356

X-original-commit: 6906c32626cb222246a895ba2ba5d15b3263935d
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-08 11:36:56 +01:00
Horacio Tellez ddda5d4a26 [IMP] payment: allow the public user to pay with tokens
Before this commit the public user did not have access to tokens or the
possibility of saving payment methods.

When receiving a link to pay the customer (even if not logged in) should
be able to use tokens saved by the parter of the document and also save
new payment methods. This is intuitively correct: as the possesor of the
link, the customer have rights to pay with tokens linked to the partner.

After this commit tokens linked to the partner of the document will be
visible to the public user and also the possibily to save payment
methods.

Task - 2799296

closes odoo/odoo#104472

Related: odoo/enterprise#34792
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-03-08 11:36:53 +01:00
Nicolas (vin) 9461d2d52b [FIX] base: disable same vat warning when using single-char vat
In order to ease the process of setting vats for some users, it was
decided to allow to use a vat number of a single character ('/' for
example) without checking it. This allows to differentiate between
partners for which we did not set VAT yet, and partners exempted from
VAT/without a number.

The VAT check was recently adapted to handle this use case, but the
"same vat" warning was forgotten in the process.

This additional change will disable the "same vat" warning that appears
when two partners share the same VAT number if that vat number is
only a single character, aligning the behavior of the warning to the
changes done in the vat check itself.

closes odoo/odoo#114640

X-original-commit: 4d80d30d0db6993a2fbbab59b935abe07080074b
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2023-03-08 10:31:18 +01:00
Jorge Pinna Puissant bd2bf1a30f [FIX] account: remove isVirtual
Since [1] we removed the isVirtual function from the record, to use the
equivalent isNew, this was made to avoid having two functions with
equivalent behavior. This one was forgotten.

[1] : a73390a42a

closes odoo/odoo#114639

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-03-08 10:31:15 +01:00
Adrien Dieudonné 0d2a80a071 [FIX] partner_autocomplete: field as title is too short
Before this commit when the partner autocomplete field was used
the form title css rules defined in o_field_char were missing.

So now the width: 100% is also applied when the partner autocomplete
is a title and takes the whole available space.

closes odoo/odoo#114610

X-original-commit: b9788544b7101e5a202cf87989bc3f5fc0495249
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-03-08 10:31:12 +01:00
Andrea Grazioso (agr-odoo) f5cdc4f14c [FIX] l10n_id_efaktur: use shipping address for Column "ALAMAT LENGKAP"
To generate an e-faktur

1. Settings > Users & Companies/Compagnies:
- Create a new company ‘ID Indonesia’:
- Set the state (e.g Yogyakarta (ID))
- Set the country ‘Indonesia’

2. Accounting > Customers > e-Faktur
- Set a range of numbers (which are supposed to be assigned by the
Indonesian government)

3. Accounting > Configuration > Settings
- Fiscal Localization: select the Indonesian package

4. Accounting > Customers > Customers
- Create a new res.partner:
- Set the country ‘Indonesia’
- Check ‘ID PKP’ field
- Fill Tax Address field
- Fill NIK field
- Under ‘Accounting tab’: set both accounting entries (Receivable +
  Payable)
- Create a delivery address

5. Accounting > Customers > Invoices
- Create a random invoice with the res.partner set in point 5. as the
Customer
- Confirm the invoice
- Action > Download e-Faktur

Under column ALAMAT LENGKAP the tax Address will be used, but the
delivery address should be used
Follows the official documentation with translation
https://www.pajakku.com/tax-guide/12490/PER_DIRJEN_PJK/PER - 03/PJ/2022
(Article 6, paragraph 6)

Translation:
Paragraph 2 : The identity of the Buyer of Taxable Goods and Services or
the Recipient of Taxable Goods and Services which includes name,
address, NPWP, NIK, and passport number as referred to in Article 5
letter b must be filled in accordance with the actual or actual name,
address, NPWP, NIK, and passport number.

Paragraph 6 : In the event that the delivery of Taxable Goods and/or
Taxable Service is made to the Buyer of Taxable Goods and/or Receiver of
Taxable Service which is the place where the VAT or VAT and STLG payable
is concentrated, but the Taxable Goods and/or Taxable Service is sent or
delivered to the place where the VAT or VAT and STLG payable is
centralized, the following provisions shall apply:
a. the name and NPWP as referred to in paragraph (2) shall be the name
and NPWP of PKP where the VAT or VAT and STLG payable is centralized;
and

b. the address as referred to in paragraph (2) shall be the address of
the place where the VAT or VAT and STLG payable that is centralized
receives the Taxable Goods and/or Services.

opw-2878096

closes odoo/odoo#114087

X-original-commit: 15dc3de31ef07a73078bbe3656f3518a1e9679fd
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-03-08 10:31:07 +01:00
Xavier-Do 8049b78a03 [IMP] tests: detect if any patcher was forgotten
closes odoo/odoo#109886

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2023-03-08 10:31:04 +01:00
Pieter Claeys (clpi) 1109443069 [FIX] stock: scrap quantity editable in done state
Since https://github.com/odoo/odoo/pull/104062, the quantity field on a scrap order is still editable when it is in the done state. This behaviour is now fixed.

Community PR: https://github.com/odoo/odoo/pull/114320

closes odoo/odoo#114337

X-original-commit: a226a0ae51b4ece6a7e68ea56cf23396e2cda65e
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-08 09:26:50 +01:00
David Monnom (moda) 7b14d73a5a [REF] point_of_sale,pos_*: remove legacy posbus
closes odoo/odoo#113782

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2023-03-08 09:26:47 +01:00