Commit Graph
267 Commits
Author SHA1 Message Date
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Michael (mcm) 9c1f704e59 [IMP] *: remove action service mapper
This commit removes the event `do-action` listened on `core.bus`
and adpats the place where it was triggered.

task 3439226

closes odoo/odoo#137088

Related: odoo/enterprise#48144
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-04 13:01:21 +00:00
Jorge Pinna Puissant 006ee1fc47 [REF] web, *: remove legacy cookie utils and cookie service
The cookie service was replaced by a utils file in core. This was done
to be able to use the cookies without the need of environment.

"Om Nom Nom Nom" - Cookie Monster

part-of task-id 3439226

closes odoo/odoo#136782

Related: odoo/enterprise#48005
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-03 20:17:40 +00:00
Romain Estievenart adba68440b [IMP] *: remove jQuery.nested_sortable
task-3439226

closes odoo/odoo#136375

Related: odoo/enterprise#47807
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-03 19:20:06 +00:00
Michael (mcm) 7422eb643c [IMP] *: remove legacy rpc
This commit removes the files ajax.js and rpc.js then adapts all the
places where their exports were used. For most of the changes, it's a
replace of `this._rpc({...})` by a new `useService("rpc|orm")` like
pattern in the widgets.

closes odoo/odoo#136271

Task: 3439226
Related: odoo/enterprise#47775
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-27 11:33:01 +00:00
Rémy Voet (ryv) f9e75d19a9 [FIX] *: Fix bad usage of 'like'/'ilike' operator
The 'like'/'ilike' operators automatically add the wildcard character
(`%`) at the beginning and at the end of the value. This commit fixes
the incorrect usage.

closes odoo/odoo#136007

Related: odoo/enterprise#47886
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-09-27 09:11:44 +00:00
William Henrotin 4da8c6ebca [IMP] stock,mrp: detailed operation without RPCs
This commit replaces the opening of the stock moves detailed operation
wizard by the one2Many record preview. This means creating a move in a
picking is still done via a new line but the edition is done via the
`fa-list` button that open the record in the web client. The goal is to
reduce the RPCs call as much as possible. The stock move lines data are
stored in the stock move record until the picking save.

Additionally, this commit change a bit the immediate transfers flows.
The stock move show only initial demand (`product_uom_qty`) but the
column wording is still "Done". In the detailed operation view, the
stock move line `qty_done` is displayed as "Reserved".
At picking validation, the user is expected to enter the same quantity
in `product_uom_qty` and `quantity_done`. If `product_uom_qty` is equals
to 0, the done quantity is used as actual transfer quantity. If
`product_uom_qty` is different than 0 but small than the done quantity,
an error is raised.

Task: 3256447
Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
Adrien Widart (awt) fb20ec841a [FIX] mrp_subcontracting: avoid setting done qty on subcontracted SM
On the backorders, the consumed quantities are incorrect.

To reproduce the issue:
1. Create two products:
   - C01: consumable
   - P01: storable
2. Create a BoM
   - Product: P01
   - Type: Subcontracting
   - Subcontractor: S
   - Components: 1 x C01
3. Create and confirm a planned receipt:
   - From: S
   - 10 x P01
4. Set the done quantity (directly on the tree view) to 1
5. Validate + Backorder
6. On this first backorder, set the qty to 2
7. Validate + Backorder
8. Validate the second backorder
9. Inventory > Reporting > Moves History, filter on C01

Error: There are three SMs, and here are the done quantities: 1, 9
and 7. The second one is incorrect, it should be 2 (see step 6).

Since [1] the done quantity is always editable on the picking's
operations, but the feature is not implemented in subcontracting,
therefore the communication between the MO and the picking does not
work well. For instance, step 4: save the done quantity and open the
MO: nothing changed on it, its producing qty is still zero. Another
example: step 4, instead of setting the done quantity directly on
the picking, open the wizard (the MO), record 3 produced products and
close the wizard. The done quantity of the stock move is 3 but the
user can still edit it. However, if he tries to update the line,
nothing will change on MO side.

On top of these "little" bugs, it may lead to a more important one
as shown in the above use case. Step 5: at some point, we split the
MO to generate a backorder for 9 x P01:
https://github.com/odoo/odoo/blob/c47e4ac7cb5fdd690f40ab2e0f8d022ba565145e/addons/mrp_subcontracting/models/stock_picking.py#L72-L76
And, as shown, the flag `set_consumed_qty` is set to `True`. As
explained in the method description:
https://github.com/odoo/odoo/blob/a2574b45aef1ff6ff3a221b996d0bb0dda2a8c74/addons/mrp/models/mrp_production.py#L1602-L1603
So, because of this flag, the method will create a SML for C01 on
the backorder, with its done quantity set to the reserved one: 9.
However, back to the first block code: `move.move_line_ids` only
contains the SML created at step 4 (i.e., the SML of the inital
SM, with a done quantity equal to 1). As a result, in the for loop,
we only define the producing quantity of the initial MO.

This is a first issue: step 6, suppose the user rather opens the
detailed operations of the line: it displays the new MO, the
producing qty is 0 but the consumed quantity of the component is 9.
This is not perfect, but let's ignore this and continue with the
above steps. The user sets the done quantity to 2 and validates with
backorder. It runs the productions split again, we use the done
quantity as producing one on the MO, but we don't edit the consumed
quantities, hence the error.

For all these reasons, the safer solution is probably to prevent the
feature 'qty done always editable' in case of subcontracting.

[1] cacc677a08066bc23e1c89df36027599d05f2a08

OPW-3441197

closes odoo/odoo#135862

X-original-commit: 049f63fbc1ab09cf75824e5c22508ea091e5c4dd
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-09-19 16:37:21 +00:00
Samuel Degueldre 4327c062d8 [REF] web, *: remove moment.js library
The moment.js library is officially done and no longer recommends its
use for new projects. As such, we have been progressively moving to
luxon instead. Until recently, we still had some libraries that depended
on it, and some leftover calls to it. This is no longer the case, and as
such, the library can be removed completely.

closes odoo/odoo#135182

Related: odoo/enterprise#47304
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-13 08:20:37 +00:00
Vraj Panchal eaf7e6d581 [IMP] mrp_subcontractiong: hide action button on portal
Remove the cogs icon on the subcontracting portal page.

task-3471491

closes odoo/odoo#135090

X-original-commit: f02aeeb30180bdc096442fcf82df6f0a0c70fdb9
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-09-13 03:37:55 +00:00
Aaron Bohy 0d7acf60b4 [REF] *: remove legacy Markup
Use owl.markup instead.

Part of task~3439226

closes odoo/odoo#134793

Related: odoo/enterprise#47124
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-11 19:13:59 +00:00
Géry Debongnie e0fdb6a0b4 [IMP] *: rewrite module loader
This commit rewrite the module loader to simplify it and to improve error handling.
before this commit, you could have silent errors or "lucky" imports (import a module based on the fact that his asset will surely be load and if not, the error would be silent anyway).
e.g.: The tours cannot import modules extern to tours' bundle anymore. Or load module before your libs in assets.

TASK ID: 3266021

closes odoo/odoo#128502

Related: odoo/enterprise#44100
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-09-08 16:47:56 +00:00
Michael (mcm) 36061a4ab0 [IMP] web: simplify owl_compatibility
This commit tried to remove owl_compatibility completely but its last
uses are either in refactoring or a bit complex to migrate. Instead of
removing the helpers completely, this commit simplifies them a lot and
makes them more readable and safe.

closes odoo/odoo#134295

Task: 3439226
Related: odoo/enterprise#46899
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-08 11:12:39 +00:00
Pierre Pulinckx (pipu) 6996b8a673 [REF] *:replace moment usages with luxon
luxon and moment are both used in the solution, but these two libraries
facilitate the manipulation of dates. It was decided to replace all uses of
moment with luxon so we can then remove moment.js from the code and lighten the
assets.

task-3391739

closes odoo/odoo#134470

Related: odoo/enterprise#46987
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-07 05:56:01 +00:00
Pierre Paridans bb18aace54 [IMP] web,*: removes jQuery.browser
This commit removes the $.browser as not used anymore and already
removed in jQuery itself in v1.9, and reintroduced in our codebase to
support jquery.ba-bbq (in odoo/odoo@4d07900cf7)
which was also removed.

Reference:
https://api.jquery.com/jquery.browser/

task-3439226

closes odoo/odoo#133916

Related: odoo/enterprise#46736
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-09-05 19:58:08 +00:00
Romain Estievenart 507c368836 [IMP] *: remove jquery.ba-bbq 🍖
Task Id: 3439226

closes odoo/odoo#133763

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-01 15:09:51 +00:00
Pierre Rousseau 82697d0b18 [REF] web, *: remove owl2 compatibility
*: mrp_subcontracting, point_of_sale, project, web_editor, website,
website_slides

Part of task-id 3439226

closes odoo/odoo#133551

Related: odoo/enterprise#46526
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-09-01 13:20:56 +00:00
Pierre Paridans fedecc1f27 [IMP] web,*: remove unused legacy download.js
task-3439226

closes odoo/odoo#133768

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-31 14:15:07 +00:00
Pierre Paridans 31a00125de [IMP] web,*: remove unused legacy content-disposition.js
task-3439226

Part-of: odoo/odoo#133768
2023-08-31 14:15:07 +00:00
Pierre Paridans ead4f57b3b [IMP] web,*: remove jQuery.hotkeys
Apparently unused library introduced in 022bff6.

task-3439226

closes odoo/odoo#133725

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-31 12:26:47 +00:00
Pierre Paridans 0776f2465c [IMP] web,*: split {non-}legacy ui.scss
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Pierre Paridans cc2bfdbf42 [IMP] web: remove root_widget
task-3439226

Part-of: odoo/odoo#133289
2023-08-31 06:15:55 +00:00
Tiffany Chang (tic) 8a3a13d821 [FIX] mrp,purchase,repair,stock: cleanup of modifier refactoring
Minor cleanup after odoo/odoo#104741 thanks to edge-cases and the fun
complexity of logistics code. Fixes include:

- removing some readonly=False that were added on computed/stored fields
  that already have an inverse func or were already not readonly (i.e.
  redundant => cleanup)
- fixed visibility of qty to prod in subcontractor portal view of a MO
  (i.e. yay they know how much they're supposed to make again)
- remove unused imports
- adding back in readonly functionality of default dest of repair
  operation type (and removing the now useless field override that used
  to add in the readonly functionality)
- adding back in the `_set_product_qty` inverse function since it was
  probably removed by mistake (and is still important to have)

unrelated to viewpocolypse change, also fixed:
- mobile view of PO was for some reason allowing products to be changed
  in already confirmed/done POs, which could lead to some inconsistent
  data => made this consistent with existing desktop view behavior

closes odoo/odoo#133502

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-08-29 14:09:53 +00:00
Michael (mcm) 1f5e8f0fd4 [IMP] web,*: remove web.session
This commit removes the legacy session and adapts the modules where it
was used.

task 3439226

closes odoo/odoo#133153

Related: odoo/enterprise#46290
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-29 11:10:47 +00:00
Michael (mcm) 55f1822911 [IMP] web,*: remove services/config.js
This commit removes the module services/config.js and adapts the module
that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
Jorge Pinna Puissant b1829d906b [REF] web, *: remove legacy MutexedDropPrevious
In our continued effort to remove legacy code, this commit replaces
the unique usage of the legacy MutexedDropPrevious util with the new
mutex util. The legacy MutexedDropPrevious has been removed.

Part-of task-id 3439226

closes odoo/odoo#132948

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-25 12:20:53 +02:00
Samuel Degueldre 736acbf995 [REF] web, *: remove legacy date and datetime picker
*: mrp_subcontracting, project

This widget is no longer used and is simply dead code. This commit
removes it and references to it in assets bundles.

closes odoo/odoo#133139

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-08-25 11:00:05 +02:00
Pierre Rousseau 2d9f6fb324 [REF] web, *: remove legacy registry
*: website, website_slides

Part of task-id 3439226

closes odoo/odoo#133132

Related: odoo/enterprise#46272
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-25 10:59:55 +02:00
Pierre Rousseau 609a7b234b [REF] web, *: remove legacy storage
*: web_editor, website, website_sale, website_slides

This commit removes the legacy storage (localStorage and sessionStorage)
and replaces it with the storage coming from browser.

Part of task-id 3439226

Part-of: odoo/odoo#133132
2023-08-25 10:59:54 +02:00
Adrien Dieudonne 3d56c3db42 [REF] web, *: Replace jQuery BlockUI by uiService
Task ID: 45869

closes odoo/odoo#132295

Related: odoo/enterprise#46166
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-08-24 21:59:43 +02:00
Adrien Dieudonné 2511323d87 [REF] web, *: remove unused blockUI and unblockUI from legacy misc
Since [1], these two functions are no longer used.
We can now remove the entire file.

Follow-up of [2]

[1] https://github.com/odoo/enterprise/pull/45869
[2] https://github.com/odoo/odoo/pull/132072

Task ID: 3439226

Part-of: odoo/odoo#132295
2023-08-24 21:59:42 +02:00
Samuel Degueldre 6f95be6884 [REF] *: remove web.assets_common
*: auth_password_policy, bus, event, im_livechat, mail, mass_mailing,
mrp_subcontracting, point_of_sale, pos_self_order, project, stock,
survey, web, web_editor, web_tour, website, website_event,
website_forum, website_sale, website_slides, base

Historically, the web.assets_common bundle was used to contain assets
that were needed by both the frontend and the backend. In practice, this
caused a bunch of issues where people would add things in assets common
that were not needed by both, and it was also abused as a way to get
bootstrap working in unrelated places by only using that bundle's css.

Because of this, as a first step, the assets_common stop being used in
the frontend, but was left everywhere else.

This commit removes the bundle completely, and moves the files that used
to be in that bundle in the other bundles that need them, this will
allow those bundles to evolve independently going forward.

in im_livechat and mail, some of the unneeded legacy code was removed, this
allows us to avoind including all of the legacy code from web in the
livechat embed bundle and in the dicuss public bundle respectively.

closes odoo/odoo#132190

Related: odoo/enterprise#45884
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-24 15:11:05 +02:00
Pierre Paridans cb1ba1f2ba [IMP] web,*: move views.scss out of legacy
*: mrp_subcontracting,project,stock

task-3439226

Part-of: odoo/odoo#132787
2023-08-23 14:43:47 +02:00
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Romain Estievenart 4ae61cee22 [IMP] web *: remove unused jquery.scrollTo library
*: project, mrp_subcontracting

This commit is a code cleanup, we remove an unused lib from the codebase

The last usage of jquery.scrollTo was dropped in saas-16.4 after the
refactoring of livechat, see here [1].

Note that we have our own ´scrollTo´ utility.

References :
https://github.com/flesler/jquery.scrollTo

[1] https://github.com/odoo/odoo/commit/20c1772d351e14e5233a636313dc79c2fe5b9115#diff-8925fb7187d27cf7abc3fbb149a22cdcfa83eaa435a667b5beb042c4fd0fe3fdL220

closes odoo/odoo#132035

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-16 17:47:56 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Aaron Bohy 3fac03b7f4 [REF] web,*: remove legacy Domain, Context and pyjs
This commit removes the legacy implementations of Domain, Context
and the pyjs library. All of them exist in the new codebase, and
the few pieces of code that were still using the legacy ones have
been adapted.

Part of task~3439226

closes odoo/odoo#130647

Related: odoo/enterprise#45129
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-03 18:02:55 +02:00
Aaron Bohy f31214aeaa [REF] web,*: remove legacy fields
Those fields are no longer used since all client actions and the
studio report editor have been converted to owl.

Part of task~3439226

closes odoo/odoo#130462

Related: odoo/enterprise#45015
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-03 09:23:21 +02:00
Michael (mcm) 9d6b380a24 [REF] *: adapt patches after new patch function
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.

task 3410198

[1]: 19ea1ac08043e22a811630968e44715cc3bfc495

Part-of: odoo/odoo#125716
2023-08-02 17:29:05 +02:00
Pierre Rousseau 036307ba26 [REM] web, *: remove legacy dialog
OwlDialog is not used anymore, therefor we can remove it.

Task-id 3439226

closes odoo/odoo#129774

Related: odoo/enterprise#44634
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-31 19:02:58 +02:00
Aaron Bohy cf4e844aca [REF] web,*: remove legacy DataManager
The DataManager is no longer used as all views and models have
been converted to wowl.

Part of task~3439226

closes odoo/odoo#129725

Related: odoo/enterprise#44611
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-07-26 13:22:13 +02:00
Aaron Bohy e9d3e27792 [REF] web,*: remove legacy web_client/pseudo_web_client
*mrp_subcontracting,project

This commit removes two legacy js modules that are no longer
necessary.

Part of task~3439226

Part-of: odoo/odoo#129725
2023-07-26 13:22:13 +02:00
Aaron Bohy bc95c6a348 [REF] web,*: remove legacy client action support
This commit removes a lot of legacy code that we kept for the few
legacy client actions that were still to be converted to owl. Now
that the last one has been converted, we can finally get rid of a
lot of legacy code (ActionAdapter, ActionMixin, ControlPanel,
ActionMenus, DropdownMenu(Item), Pager, DomainSelector...).

Part of task~3439226

closes odoo/odoo#129314

Related: odoo/enterprise#44465
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-25 17:35:47 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.

Main changes that were requested are:
 - record datapoints no longer always have an "id" key in their
 data (they still do if the id field is in the view), so we use
 record.resId instead
 - the new model is based on fined-grained reactivity, so several
 components that previously relied on onWillUpdateProps to update
 their internal state no longer worked. Typically, using the hook
 "observeRecord" is the way to go now.
 - specialdata are no longer handled in the model, so the components
 needing specialData can use the hook "useSpecialData"
 - more generally, all overrides of models (RelationalModel or
 KanbanModel) needed to be reworked.

Part of task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
svs-odoo a467737420 [IMP] mrp*: make some MO's methods public
The `mrp.production` method `_pre_button_mark_done` will now be public
so it can be called since the web client.
This change is done in order to know if trying to mark as done a
production will return a wizard or not, which is needed in the new MRP
Display view since there is a delay before a MO is actually marked as
done and we don't want to see the wizard poping up after this delay but
before !

The method `_set_qty_producing` public is also public now because it's
called in `_onchange_producing` but saddly, the onchanges don't happen
in the MES view, so this way we can manually call it when needed.

task-3231200

Part-of: odoo/odoo#127250
2023-07-20 11:49:27 +02:00
Julien Carion (juca) 6c412be2ea [IMP] *: coherent hotkey uses
This commit makes hotkey uses more coherent throughout the entire
codebase by setting alt+q as main shortcurt for confirm and default
actions and alt+x for cancel actions.

task-3370463

closes odoo/odoo#127469

Related: odoo/enterprise#43694
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-07-19 18:24:15 +02:00
Pierre Pulinckx (pipu) 8bfa76a842 [REF] *: Unify _t and _lt
The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.

In this commit,

the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
the lazytranslate function _lt() returns _t() function.
Corollaries :
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.

Example :

registry.category("web_tour.tours").add("example", {
    test: true,
    steps: () => [
        {...},
        {...},
    ],
});

task-3292454

closes odoo/odoo#124157

Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-07-19 13:13:16 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
Rationale
=========

Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).

To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)

Changes
=======

- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).

Part-of: odoo/odoo#122085
2023-06-28 17:41:19 +02:00
Pieter Claeys (clpi) ccb41edf2b [IMP] stock: better returns
Improve the returns process by adding the following improvements:
- Removal of the 'return' operations type. Returns of deliveries now
become receipts.
- Update of the `stock_picking_return` wizard by removing the onchange
on picking_id.
- Show returns in the sale portal, with a new 'return label' PDF report
- Enable returns for multi-step receipts on purchases

Community PR: https://github.com/odoo/odoo/pull/118568
Enterprise PR: https://github.com/odoo/enterprise/pull/39761

closes odoo/odoo#118568

Task: 3081370
Related: odoo/upgrade#4660
Related: odoo/enterprise#39761
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-23 18:00:05 +02:00
Arnold Moyaux 9a01c6a29c [FIX] mrp_subcontracting: only import needed files
Follow the same behavior than project. Only import the code for the
views. It's not a good idea to import all the backend since it's not
needed and it could cause issue with extra features

closes odoo/odoo#121669

closes odoo/odoo#119040

X-original-commit: 8f3f10731545f32d283772fc009733c1b43f536b
Related: odoo/enterprise#41188
Related: odoo/enterprise#39987
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-21 10:37:04 +02:00