Commit Graph
1283 Commits
Author SHA1 Message Date
clesgow 77adfd2cb4 [IMP] stock: remove useless links to uoms
Remove links to UoM form since they are useless and lead to unused
forms.

Part of task-3218314

closes odoo/odoo#119381

Related: odoo/enterprise#40153
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-05-09 21:04:04 +02:00
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Walid HANNICHE (waha) 82787d2b98 [FIX] purchase_stock: units rounding
Steps to reproduce:
1-create a weight unit 'jm' bigger than reference
    ratio 2.47541 rounding 0.001
2-create a stored product uom:'jm' / purchase_uom: 'kg'
3-set valuation method to automated (fifo)
4-create a replenishement for 200 (jm)
5-confirm and recieve the products
6-valuation for that stock move is null

Bug:
computations in the stock module are done with rounding method (half-up)
when computing the unit price the recieved quantity is computed with up
rounding which leads to a mismatch

Fix:
applied the same rounding method on all the Steps

opw-3213997

closes odoo/odoo#118251

X-original-commit: c305942958c73414def47ebd299227999841c6ed
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-04-11 18:49:46 +02:00
niyasraphy 71dd1d90ee [FIX] stock: typo in unit of measure
before this commit, there is typo in unit of measure

after this commit, the typo will be corrected and
unity of measure will be updated to unit of measure

closes odoo/odoo#116764

X-original-commit: 11b89fcffe748e6119648dbc32594f0c0bdcf064
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-29 23:36:56 +02:00
Walid HANNICHE (waha) c0d5908c6a [FIX] stock: set correct return quantity
Steps to reproduce:
-Enable multistep routes for manufacturing
-create a MO for 50 products
-In internal transfers from Stock to Pre-production validate
part of the tansfer (20 units) and create a back order
for the remaining qty (30 units)
-create and validate another pertail transfer (3 units)with a back order
for the remaining quantity (27 units)
-create a return for the last validated transfers

Bug:
the default qty for the return is set to -20 where it should be 3
this commit[1] deducts the previous transfers from the returned amount

Fix:
only deduct returns from current transfer

opw-3104699
[1]:https://github.com/odoo/odoo/commit/7b08f0ae0a39e8f575b21e744de16264b6365704

closes odoo/odoo#115929

X-original-commit: 0278a4a7ba5cdd7a722e5d576d22820a3ee64308
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-03-20 19:15:22 +01:00
Louis Wicket (wil) 9afe7c74c9 [IMP] *: remove "French spacing" 👺
According to Wiktionary, French spacing is "the archaic practice (though
still current in French) of inserting a space around colons, semicolons,
question marks, and exclamation marks". This is not standard practice in
English and most languages of the world.

The purpose of this commit is to start purging the code from this typo,
as it may reflect poorly on the software for some people.

closes odoo/odoo#114533

Related: odoo/enterprise#37853
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-03-14 15:52:10 +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
Ahmed Khalaf c2c1fa2811 [IMP] stock: stock.move.line flexible reservation
This commit allows the user to choose which quants to reserve from stock
and the quantity to reserve from each quant, making reservation much more
flexible from the picking form.

In addition, the `reserved_uom_qty` of stock.move.line
is now editable in views to allow for users to change the qty reserved
by existing move lines. When editing the reserved qty, if quantity is not available,
it will reserve only what is available..

closes odoo/odoo#106006

Taskid: 3090913
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-03-07 10:06:00 +01:00
clesgow 3ec250e709 [IMP] stock: bypass quantity compute on replenish wizard
Currently, even if a `default_quantity` is given to the replenish
wizard, that quantity will be overwritten by the product's
`virtual_available`, which defeats the point of setting a
`default_quantity`.
This will allow to bypass that computation when a `default_quantity` is
given to the wizard.

Also makes it return a close action with some custom info when `Confirm`
is clicked, so it's possible to know which button was clicked to close
the wizard.

closes odoo/odoo#113394

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-03 18:10:57 +01:00
svs-odoo ae5ccb6ffc [IMP] stock: update product quantity on hand
Now, the button "Update Quantity" and the stat button "Qty. On Hand" on
the product's form view will both call `action_update_quantity_on_hand`,
which who can call `action_open_quants` is an advance option is enable
(multilocation, owner or package) or if the product is tracked by lot or
serial numbers.

Also, displays the product's UoM in the `stock.change.product.qty`
wizard and changes its style so labels have more space.

task-3076044

Part-of: odoo/odoo#109511
2023-02-13 15:15:09 +01:00
svs-odoo 656d8ace87 [IMP] stock: backorder confirmation
In `_check_backorder`, changes the condition so it checks if the qty
done is enough compared to the actual reserved quantity (instead of the
demand).
Also, removes an unused bloack of code and makes minor visual changes.

task-3076044

Part-of: odoo/odoo#109511
2023-02-13 15:15:08 +01:00
Mathias Mathy (MAMA) 0a43740481 [REF] Stock: report_stock_forecasted to owl
Refactoring of report_stock_forecasted to owl
Since it wasn't really a report (no print action),
it changed from a report to a client action.
Task: 2885757
See Upgrade : odoo/upgrade#3926
See Enterprise : odoo/enterprise#32116

closes odoo/odoo#101247

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-02-06 14:16:26 +01:00
Thibault Delavallée 4775bd93a2 [REF] mail: cleanup post with {view, template} wrappers
RATIONALE

Purpose of this commit is to cleanup main post helpers and have a more easy
and understandable way of calling them.

SUMMARY

We now have two main API methods, based on business flow: either posting
on documents, either sending a mass mailing. Indeed those two flows are
different

  * post: create message, then launch notification process by taking into
    account subtype, followers, ...
  * mail: create mails in batch with recipients being based on template or
    given partners. No notifications is involved, only maybe traces if a
    mass mailing is linked

Delegate QWeb rendering to the render mixin (i.e. _render_template_qweb_view)
in order to have a single point to forge evaluation context and re-use
existing rendering code.

SPECIFICATIONS

Main API helpers are now

  * ``message_post_with_source``: (batch) post on records, using an ir.ui.view
    (given a record or its xml id) or a mail.template record (given a record or
    its xml id). When using a template, a composer is called to post on each
    record (as batch post is not yet supported). When using a view, a direct
    call to message_post using the rendered bodies is done, one record at a
    time.
  * ``message_mail_with_source``: send a mass mailing on records, acting like
    invoking the mail composer in mass mode. Same arguments are valid, either
    a reference to a view, either a reference to a mail template.

Other helpers are

  * ``_message_log_with_view``: (batch) log on records, using an ir.ui.view
    to render the body using QWeb (no notification process);
  * ``_message_log(_batch)``: (batch) log on records (no notification process);
  * ``message_notify``: notify partners on records (creating notifications
    specifically for some people while message itself is not displayed in
    chatter);

Code migration

  * ``message_post_with_template`` in "mass mode": use ``message_mail_with_source``
    and set the template record as source;
  * ``message_post_with_template`` in "comment" mode: use ``message_post_with_source``
    and set the template record as source;
  * ``message_post_with_view``: its main usage was to post on a document, in which
    case it generally can be replaced by ``message_mail_with_source`` using
    the view reference as source;

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:34 +01:00
Thibault Delavallée 418761e344 [LINT] mail, various: use explicit subtype in message_post_{with_...}
RATIONALE

Purpose of this commit is to be explicit in subtype chosen when invoking the
message composer / calling message_post. As default value may not always be
clear, better be explicit in case the composer default value changes.

SPECIFICATIONS

Add explicit references to subtype when it is not obvious what will be the
final subtype, notably when using helpers (post_with_view or template which
uses the composer that is not crystal clear in its subtype management).

In this commit we also add support of XMLID-based subtype when invoking the
composer. A ``default_subtype_xmlid`` context key is transformed into a
``default_subtype_id``, to be used notably in JS where we cannot easily
use a ``ref``-like statement. Post API now also supports 'subytpe_xmlid'
argument allowing to give the xml id and ease calling the methods.

Use ``_xmlid_to_res_id`` to get directly the ID of subtypes in order to
avoid useless queries from ``ref`` that does an exists.

Also remove useless values given to post API, notably author_id that is by
default the current users' partner.

Task-2710804 (Mail: Clean MailThread Posting API)

Part-of: odoo/odoo#99482
2023-01-17 20:58:33 +01:00
clesgow b159190c7e [IMP] stock: display right number of labels in a ready pickings
When printing labels in a `ready` picking, if no quantities are set it
will only print the reserved quantities as labels.
Then, if a product has no reserved quantity, it will not have any
move_lines. Which means its initial demand won't be able to be fetched,
and the default behavior will be used, which is to print a single label.

By giving the moves instead of the move_lines to the wizard, we allow to
fetch for moves that have no reservation and print labels correctly
using their initial demand if no reservation is found.

The standard behavior once quantities are set remains untouched.

closes odoo/odoo#106414

Related: odoo/upgrade#4091
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-12 18:16:04 +01:00
svs-odoo b3b89745f6 [FIX] stock: apply all returning a wizard
When using the "Apply All" button to make inventory adjustments, a
wizard is opened to choose a name. Then, this wizard calls the quant's
`action_apply_inventory` method but doesn't return it.
But sometime, this method doesn't apply immediately the inventory but
ask for confirmation before (e.g.: trying to "Apply All" with quants for
tracked product but without lot/serial number).
In these cases, the "Apply All" does nothing.

closes odoo/odoo#104307

X-original-commit: e555333cf3ca2511df55105a027ca52e55c13774
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-10-27 15:41:26 +02:00
Ahmed Khalaf (ahkh) 983020d325 [FIX] stock: replenishment info alignment issue
Before this commit, the `stock.replenishment.info` wizard form
had alignment issues, because of `group` tag, the content was aligned
to the left.

closes odoo/odoo#102505

X-original-commit: 7391961c552214e95e3613be9ab07b61ff86feac
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Ahmed Khalaf  <ahkh@odoo.com>
2022-10-07 11:13:02 +02:00
clesgow 320d81d5d3 [FIX] stock: Backorder wizard layout
Adapts the layout of the backorder wizard to the new grid css for
groups.

Part of task-2985735

X-original-commit: b3f151b3a64312939e5f10c209f54a38b621c8a8
Part-of: odoo/odoo#102495
2022-10-06 19:59:08 +02:00
Damien Bouvy 59481e5421 [FIX] stock: return wizard grid form views compat
closes odoo/odoo#102426

X-original-commit: 0e66037ca6a6fb3c2c107520545de9d09281457a
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2022-10-06 19:03:58 +02:00
clesgow 866d9a3aa8 [FIX] stock: No backorder validation
When validating a batch containing both fully done pickings and
partially done pickings, if we select "No backorder" it will remove the
partially done pickings from the batch.
This is because only the partially done pickings will be considered as
"pickings not to backorder", while the fully done will be considered as
"pickings to backorder".
Then validation is splitted between the two groups of pickings, and
since by the end of the first validation, the batch is not fully done
(since the other group will be validated afterwards), those pickings are
removed from the batch.

This fix aim to consider all pickings that are fully/partially done as
"not to backorder" if this option is selected.

opw-2971574

closes odoo/odoo#102382

X-original-commit: a98b3ff73d1c3d5fda7da3433caf83d58acc2f3c
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-10-06 18:00:49 +02:00
Arnold Moyaux 989c6df74d [REF] stock: counted qty, forecast, json stock widgets to owl
This pr follow the framework refactoring and translate the widgets
of stock module to wowl.

CountedQuantityWidgetField needs to add an upper listener on input since
the function onChange and onInput of `useInputField` are not overidable.

Json fields had their template in the json send from the server. With
wowl, the template needs to be declare before the setup. So a new wiget
is create for each template and those widgets extends the
a common component that put the json content in the props.

co-author svs-odoo <svs@odoo.com>

X-original-commit: 350a7a0d6f4816ee75676b80a9a5b9769bf80fe6
Part-of: odoo/odoo#101305
2022-10-04 17:01:21 +02:00
Ahmed Khalaf (ahkh) d1b3081639 [FIX] stock: immediate transfer message alignment
This commit fixes the alignment of the message shown when validating
transfer without quantities set.

The `group` tag caused the misalignment as it created a grid class div
and aligned content into div column to the right. since the form just
displays a message and the grid is not needed the `group` tag was
removed entirely.

closes odoo/odoo#102001

X-original-commit: 1a63edc684512330ca64682ec9b626681b6a95cf
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Ahmed Khalaf  <ahkh@odoo.com>
2022-10-04 13:28:55 +02:00
JF Aubert bb42ac4396 [FIX] stock: fix replenishment report
Make the choice of available stock effective
(previously the total quantity was always applied).
Show warehouses with the most available stock first.
Show quantity warning only when appropriate.

closes odoo/odoo#101010

Task: 2985735
X-original-commit: 483764412985163168333e2731bed359cc588bbb
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Jean-François Aubert <ajf@odoo.com>
2022-09-28 08:40:21 +02:00
svs-odoo fc5d1fe149 [IMP] stock: backorder wizard
Replaces <p> by <div> and gives a name to the first paragraph to make an
override easier (for now, overrided by `stock_barcode`).

task-2666478

Part-of: odoo/odoo#91807
2022-09-06 22:30:45 +02:00
Tiffany Chang (tic) 36a2514430 [IMP] purchase,stock: improve misc small UX
Minor UX updates in purchase and stock:

Reworded (in stock):
- Default name location "Partner Locations" => "Partners"
- Default result for "Apply All" wizard "Inventory Adjustment" =>
  "Quantity Updated"
- Individual "Apply" move reference/name updated for individual quants
  (i.e. "Quantity Updated / Confirmed") so that the scheduled date is
  no longer included

Removed (from purchase):
- Duplicated menuitems, i.e.  "Purchase > Reporting > Purchase" showed
  the same thing as Enterprise menuitem and both were being displayed in
  Enterprise version. Also updated the no records found help message
  since old message appeared to be slightly out of date.

ENT PR: odoo/enterprise#29974
"other" part of b2b task: 2882539

Part-of: odoo/odoo#97109
2022-08-29 23:46:35 +02:00
Tiffany Chang (tic) f752b98889 [IMP] mrp, stock{_account,_picking_batch}: update inventory menus
- reorder/rename/remove menu contents for "Inventory" and "Reporting",
  including:
 - removed "Forecasted Inventory" menuitem since this view is no longer
   considered useful (code for view to be removed in separate commit)
 - removed "Stock Moves" (moves report) menuitem
 - renamed "Product Move" (move lines report) menuitem => "Moves
   History", this will also be reflected in any "History" buttons that
   open this view from other views.
 - made "Inventory Report" menuitem visible only when applicable (i.e.
   multi-location or consignment is active/debug mpde)
 - made "Run Scheduler" menuitem only available in debug mode (
   main_flow_tour updated to skip scheduler click since general flow is
   expected to still the same/work)

Goal of renaming/ordering of menuitems is to clean them up and make them
more intuitive for users.

- "Run Scheduler" in mrp menus has also been made debug only viewable as
  well to mirror the inventory change.

"menu" part of b2b task: 2882539
ENT PR: odoo/enterprise#29974

Part-of: odoo/odoo#97109
2022-08-29 23:46:33 +02:00
roen-odoo 6dc0d6976d [FIX] stock: add tooltip for lot.label.layout quantity to print
Current behavior:
If the UoM of a product is not 'units' (e.g 'kg') and tracked by lot.
When trying to print labels 'per unit', some users except one label printed
per 'kg'. But it will actually print one label per lot.

This is not a bug so we are just adding a tooltip to make it clear that only
one label will be printed for lots using UoM different from 'units'

Steps to reproduce:
- Create a product tracked by lots with 'kg' as UoM
- Create a purchase order for 5kg of this product
- Validate the PO and receive the products in 2 lots
- Print the labels "Lot/SN Labels" > "One per unit"
- Confirm, the PDF shows 2 labels

opw-2941942

closes odoo/odoo#98812

X-original-commit: 5b2eb07d3831406146d70150e3a9f61fa3aca7c3
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-08-25 04:21:10 +02:00
Denis Ledoux 0501bbd62e [IMP] base: uniform "groups" in back-end view
This revision is to make uniform the behavior of the `groups` attribute
on the Python model fields
and on the node in the view architecture.
In both cases, remove the node from the view completely.

Before this revision,

in a back-end view:
 - In the Python model, if a field has the `groups` attribute set
   and the user is not part of
   the groups, the field is removed, completely, from the view.
 - In the view architecture, if a node has the `groups` attribute set
   and the user is not part of
   the groups, the node is made invisible (not completely removed, just
   made invisible).

in a front-end view:
 - if a node has a "groups" or "t-groups" set and the user
   is not part of the groups, the node is removed from the view.

So it's 2/3 cases removing nodes restricted to a group.
and 1/3 case making invisible nodes restricted to a group.
It's simpler to have a uniform behavior for the 3 cases,
simpler to understandard for developers.

In addition, this will help for the goal to cache back-end views.
It makes possible to convert views using the `groups_id` field
by moving the content of these views directly
in the view to which they add content which is suppose to be completely
removed when the user has not the according group.
By getting rid of the `groups_id` many2many field on `ir.ui.view`,
it makes possible to cache the view architecture without
requiring to use the groups in the cache key.
Currently, if we want to cache the view architecture,
it would be required to use the intersection of the user
groups with the `groups_id` groups of the view,
making it costly to compute the cache key,
therefore altering the performance point to cache the view
architectures.

closes odoo/odoo#95729

Related: odoo/enterprise#29592
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-08-19 19:10:39 +02:00
Nshimiyimana Séna 3aee7a8cc8 [FIX] stock: count request sets the wrong user
Steps to reproduce:
- go to Inventory > Operations > Inventory Adjustments
- Select at least one product
- Click on Request a count; A dialog box containing a form should appear
- Select a user other than the current user
- Make sure to check "Set Current Value"
- Click "Confirm"

You should see that the user you selected is not the one assigned for
the count. Instead, the count is assigned to the current user.

This is happening because currently, calling
`action_set_inventory_quantity` also sets the user as the current one
if the quantity is not already set.

opw-2924694

closes odoo/odoo#96914

X-original-commit: f2b79bc4c6198aacca33eea8905fd62c629706a1
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-07-28 05:04:57 +02:00
Christophe Simonis 6f521fcf19 [FIX] stock: always close created cursors
Avoid leaks in case of exception.

closes odoo/odoo#93993

X-original-commit: 1a1a10b7ce53f24eabed3e3a38f34b354d2d1911
Signed-off-by: Christophe Simonis <chs@odoo.com>
2022-06-18 11:20:30 +02:00
Pieter Claeys (clpi) 21876c55ed [IMP] stock: warehouse levels on replenishment
Show the stock in different warehouses in the replenishment info view if a route to resupply from these warehouses is available.

Task: 2797326
Community PR: https://github.com/odoo/odoo/pull/87143

closes odoo/odoo#87143

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-04-29 18:21:33 +02:00
Victor Feyens 24f9af3fd0 [IMP] *: remove Trailing newlines (C0305)
Part-of: odoo/odoo#86332
2022-04-27 07:51:23 +02:00
Touati Djamel (otd) 510965b4fb [FIX] stock: display the date in the breadcrumb
Steps to reproduce the bug:
- Go to inventory > Reporting > Inventory report
- Click on “Inventory At Date” > Select a date > Confirm

Problem:
The date is not displayed in the breadcrumb, like in inventory valuation

opw-2791566

closes odoo/odoo#88943

X-original-commit: d7a09a257bfb3690a4b580ed26bbf2894a74a6c3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-04-19 09:47:58 +02:00
Adrien Widart eb1ddbf115 [FIX] stock: compute replenishment info
The history of the replenishment info may be empty while it should not

To reproduce the issue:
(Set your device on January)
1. Process a delivery for product P
2. (Inventory > Operations > Replenishment, create a new one for P)
3. Click on the information icon (I) of the P's line

Error: The sales history does contain anything

When calling `relativedelta`, `month` is considered as an absolute value
and will replace the corresponding value while `months` is a relative
value and will be added/subtracted to the corresponding value.

OPW-2740123

closes odoo/odoo#84881

X-original-commit: c87fea0916b61cb4b0c37f3fe2ddad8359e6aeb2
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-02-18 14:29:02 +00:00
Tiffany Chang (tic) 4879da9ee5 [IMP] stock{_picking_batch}: print sn/lots from picking
Before this commit we could print the product labels of a picking from a
picking, but we couldn't print only the lots/sns. This commit adds in
this ability. Because we want to be flexible with this label printing
(i.e. have the option to choose between printing zpl or pdf + 1 per
unit or per lot/sn), we include it in the general "Print Labels" button
with additional wizards.

Note that we assume:
1. If there are no lot_ids in the picking => default to only product
   labels wizard (i.e. this also means if a picking that only creates
   New Lots/SN, lots/sns will not be printable until picking is
   validated.)
2. Lots/SN PDF labels will only be in the 4x12 label format
3. Batch pickings can also print lot/sn labels

Part of task: 2494740
Related ENT PR: odoo/enterprise#23323

closes odoo/odoo#82389

Related: odoo/upgrade#3202
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-01-31 12:06:06 +00:00
Tiffany Chang (tic) b935db1e70 [IMP] mrp: improve UX
Several UX improvements:

1 - Add "Unbuild" filter to MOs (1 or more 'Done' unbuilds) + added
  Unbuilds smart button to MO form view
2 - When copying an operation across BoMs, it is annoying that it adds
  "Copy" to the end of the name, so we remove that.
3 - Display a warning when using an expired Lot/SN in detailed operations
  view (burger window + tab).
4 - Allow adding/removing WO Real Duration + add/remove/edit specific time
  time tracking (time_ids) for Done, Unlocked MOs.
5 - Allow search WOs by product to manufacture
7 - Fix validation error message typo

Parts 1-5 and 7 of Task: 2667151

Part-of: odoo/odoo#80319
2022-01-21 07:57:49 +00:00
Nicolas Pierre bec3c58df3 [IMP] stock: Inventory Adjustments improvements
Improvements of the Inventory Adjustements page, among which:
 - Add a new 'Apply All' button (without the need to select a record)
 - Show the date at which the last count was done
 - Add warning icon next to duplicated SN
 - Allows to change the lot_id when empty and no quantities are set

closes odoo/odoo#78361

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-12-17 10:10:45 +00:00
William Henrotin 56e7bcf0cb [REF] *{stock,mrp}*: rename reserved fields
This commit rename product_uom_qty into reserved_uom_qty and product_qty
into reserved_qty on stock move line to stop mistake them with the stock
move quantities fields.

Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:06 +00:00
William Henrotin c146c7d16f [REF] *stock*: rename model stock.location.route into stock.route
Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:06 +00:00
Vishal Thacker 7622c48223 [IMP] stock: default product replenish quantity
The product replenish wizard quantity will be set to the selected
`product_id` forecast quantity if it's a negative value (otherwise, it
will be set to 1).

task-2581265

Part-of: odoo/odoo#74695
2021-11-26 15:10:26 +00:00
Tiffany Chang (tic) 0d882a4e49 [FIX] product,stock: print lot when provided instead of product
When Print Labels was revamped in odoo/odoo#69690 it was decided that
only product barcodes would be printed. Unfortunately we want SN/Lot
barcodes to be printed instead when they are filled in, so we make this
the case when applicable (i.e. when printing Transfer Quantites + qtys
done).

closes odoo/odoo#80079

Task: 2678336
X-original-commit: 105587e9e411442fd8e6d30efaa35b90b0e09959
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-11-19 12:50:58 +00:00
Nicolas Pierre 1f00ffb0f2 [FIX] stock: inventory adjustments fixes
- When locations are activated, fix not being able to add a quant for tracked products just after
creating one from the 'update quantity' window due to Inventory Adjustment location being auto-selected [since it is the last quant]
 - Fix quant not properly making fields invisible after confirming from the stock track
confirmation window

closes odoo/odoo#79338

Pr: https://github.com/odoo/odoo/pull/78768
Task-id: 2674732
X-original-commit: ff26704e7afaa537530c0e092a88b73ee791775f
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: npi-odoo <npi@odoo.com>
2021-11-03 17:28:55 +00:00
William Henrotin 3a1473c75c [REF] *stock*: rename move_lines into move_ids in stock.picking
closes odoo/odoo#78732

Task: 2673000
Related: odoo/enterprise#21815
Related: odoo/upgrade#2956
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-10-27 15:48:51 +00:00
Swapnesh Shah 3c2bd3994a [FIX] stock: use context_today instead of today
`fields.Date.today` doesn't give date based on TZ which might be wrong
in some cases as it doesn't respect TZ.

With this commit, we are using `fields.Date.context_today` as default date.

closes odoo/odoo#77104

X-original-commit: 24b91073a67b97af1ef3d61aee02a4ddd7053cd5
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-09-24 11:08:52 +00:00
William Henrotin eb4d8e452c [FIX] prpduct,stock: fixes on product labels
This commit fix some issue introduced with d9f45ba694.

X-original-commit: e4b9dab45665b0ba83d84c52ecc4638472ad454f
Part-of: odoo/odoo#76503
2021-09-15 07:48:12 +00:00
Raphael ColletandXavier Dollé 1595c0ee27 [REF] core: replace thread-local "envs" by cursor-bound "transaction"
Refactor the Environments object into a Transaction object, which is
bound to one cursor, and is no longer shared among several cursors.

The following methods/properties have been changed:
 - Environment.envs no longer works (because of the design change);
 - Environment.manage() is deprecated (no longer useful);
 - Environment.reset() is now an instance method;
 - env.clear_upon_failure() is deprecated in favor of cr.savepoint().

closes odoo/odoo#75598

Related: odoo/enterprise#20451
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Xavier Dollé <xdo@odoo.com>
2021-09-03 15:45:46 +00:00
Rémy Voet (ryv) 36e3c443d2 [FIX] stock,mrp_subcontracting: fix "Set Quantity"
The button "Set Quantity" have a different behavior
(it doesn't take in account tracked product) than
the immediate process which is confusing.
Now both flow share the same code and allow to avoid
the "Set Quantity" for the subcontracting with tracked component.

task-2486811

Part-of: odoo/odoo#75041
2021-09-03 10:37:48 +00:00
William Henrotin 79ba0cd05b [IMP] stock: default action on count request
When requesting an inventory count, the manager can decide to, in the
same time, precounting the quant to their actual values.

Task : 2555118

Part-of: odoo/odoo#74715
2021-09-02 12:57:32 +00:00
William Henrotin 8f12dbc00f [IMP] stock: merge two wizards into one
This commit merge the wizards asking for a inventory name and the one
warning the user not all quant have been set.

Task : 2555118

Part-of: odoo/odoo#74715
2021-09-02 12:57:32 +00:00
Arnold Moyaux 174c3b7951 [IMP] mrp: Mass assignation of SN/Lot in MRP
Allow to produce several serial numbers at once.
Only when BoM do not contain any component tracked by unique serial number
and lot ones are from 1 lot.
Also allow to copy/paste serial numbers.
This applies to manufacturing orders.

Task: 2444742
Part-of: odoo/odoo#71732
2021-09-02 10:41:46 +00:00