Commit Graph
1494 Commits
Author SHA1 Message Date
svs-odoo 8821f0e917 [FIX] stock: set serial count to generate SN
Before this commit, the field `next_serial_count` in stock.move, used to
know how many SN the user wants to generate, wasn't correctly set and
was always equals to 0.

closes odoo/odoo#40714

X-original-commit: 9a20896eddb6b98b569f4f83192ac876696baaa6
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-22 14:06:50 +00:00
svs-odoo 8c5bd29d41 [FIX] stock: display assign SN immediate transfer
Before this commit, when user creates a receipt for a product tracked by
serial number, using immediate transfer, the fields to generate and
assign SN was hidden.
The reason was the move is confirmed in this case, and those fields was
displayed only for partially available and assigned moves.

task-2123761

X-original-commit: 4f9b170e857509cf34e072051086a7e9590c330d
2019-11-22 14:06:49 +00:00
Ankita Raval 3651ab082d [IMP] Inventory: Usability improvements
In this commit,
-Modify the message shown when we try to delete a done picking.
-In transfers, in detailed operations, set default hide on on
"Reserved" and "Lot/Serial Number".

task-id : 2124115

closes odoo/odoo#40309

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-20 13:03:43 +00:00
Ankita Raval 94ee1ed5ab [IMP] Inventory : Usability improvements
In this commit,
- Prevent the product type 'Services' to be selectable from detailed
 operations of a picking.
- Change the place of 'product_uom_id' field on the internal transfers.

closes odoo/odoo#40551

Task-id: 2124093
X-original-commit: 9209e7f2b842161eb1704cebc02675a0b5248750
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-20 11:11:10 +00:00
Goffin Simon a1ed7aa2ca [FIX] stock: Salesman not able to confirm an order
Steps to reproduce the bug:

- Install Inventory, Sales
- In General Settings/Inventory/Traceability tick "Lots & Serial Numbers"
- Create a stockable product A (e.g. duplicate Apple E-COM08)  tracked by lots
- Update Qty on Hand: put the quantity inside a lot
- Change Demo User's settings: remove Inventory access
- Connect as Demo, create a quotation with A, try to confirm sale

Bug:

An access error was raised.

opw:2092809

closes odoo/odoo#40499

X-original-commit: 1da97d4b842444dd69a54692de0d6edfc20d1123
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-11-19 12:57:25 +00:00
Victor Feyens 9215e73fa2 [IMP] * : replace with_context(force_company=c) by with_company(c) 2019-11-18 12:25:05 +00:00
fw-bot e76276e083 [FIX] mrp,stock: error w/o traceback on create warehouse
If a warehouse is created without code (eg. when created as a new group
from a kanban view grouped by warehouse) we would get a traceback
instead of an error:

```
  The operation cannot be completed:
  - Create/update: a mandatory field is not set.
  - Delete: another model requires the record being deleted. If possible, archive it instead.

  Model: Warehouse (stock.warehouse), Field: Short Name (code)
```

opw-2124162
fix #40233
closes #40267

closes odoo/odoo#40382

X-original-commit: b6caa179e17199b29a9ca4009c53acb378423926
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-11-15 20:23:59 +00:00
Simon Lejeune 29d8fc091a [FIX] stock: picking: immediate and state
Issue: create an immediate transfer, add a move and a done quantity, the
picking is in waiting state instead of ready.

Due to rev[0], the moves added in an immediate transfer have an initial
demand. After auto-confirming them, their state were 'confirmed' and not
'assigned'.

Solution: we force the state to assigned

[0] 8303b1a69e

closes odoo/odoo#39492

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-11-13 15:40:40 +00:00
Simon Lejeune 4d653af6e9 [REF] stock: planned transfer: additional moves
Before this patch, move added in a planned transfer once it is ready are
directly marked as assigned and the reservation is disabled on them.

People found it hard to understand why the check availability button did
not appear, plus the push rules were not applied.

Now we chose to use the autoconfirm mechanism on the added move and we
don't reserve them, so the check availability button reappear.

task-2081844
2019-11-13 15:40:40 +00:00
William Henrotin eb89927019 [FIX] stock: split move line in extra move
_action_done() creates extra stock move when quantity_done is superior
to initial demand. This extra move should be, after confirmation, either
merge into the original stock_move, either stay extra but the move lines
still linked to the first one should be shared accordingly to the quantity
done. The fix 561b3461a0 adapted the code
for MRP to split the move lines but neither those cases are applied in
MRP because the extra move has no picking_id field.

condition :
  ```if merge_into_self and extra_move.picking_id:```
will therefore be false as well as
  ```if not merge_into_self:```

To be sure the two extra move management cases are complementary, this
Commit keeps make sure the conditions are mutualy exclusive.

closes odoo/odoo#40230

Opw: 2087864
X-original-commit: 4e8ac38a6d67bcd5040af0b580bfa43da7841548
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2019-11-13 18:30:08 +00:00
Andrea Grazioso (agr-odoo) f52bcddccc [FIX] stock_move: show source document
Install stock and sale. Create a sale with 2+ products, save and
confirm.
Look for the created picking.

There will be no source doument, because of
cb618e9a99
the behavior has changed when there are multiple source
document, possibly to avoid displaying the wrong source if they
differ.

Adding the possibility to display multiple source documents, eventually
truncating the list

opw-2117886

closes odoo/odoo#40098

X-original-commit: baad02d01b86a8d036524b789f046a54a878a729
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-11-12 08:39:05 +00:00
Victor Feyens 730e4ce201 [IMP] stock: location creation on company creation. 2019-11-08 12:18:41 +00:00
Adrian Torres 13ee8a0373 [FIX] stock: allow unlinking records in uninstall mode
Business cases should not prevent the unlink of module-related records
during an uninstall.

This commit allows the reinstallation of sale_stock with demo data and
also allows the proper removal of tables and records if a db has any
non-draft inventory adjustments.

closes odoo/odoo#39776

X-original-commit: cedafe00941b869d284cd511633d7da15868fc0a
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
2019-11-04 17:16:38 +00:00
Arnold Moyaux 7e81616ae8 [FIX] stock: product quantity with force company and location
Usecase to reproduce:
- Set warehouse as 3 steps delivery
- On pack rule set the procure method as 'take from stock if enough or
trigger another rule'
- Do an inventory adjustement of a product and set 10 units in pack zone
- Do a delivery order for this product with only 1 unit.

It will create the delivery order from stock to pack even if the
quantity in pack was sufficient.

It's due to [1] that introduce a new function but if the force company
and location (with an integer) are both set in the domain it will
select the wrong ids. It will take all the location in the company + the
location in the context. However if a location is explicitly given to
the context, it should only consider the stock at this location.

[1] commit 330b99f60c

opw-2090384

closes odoo/odoo#39726

X-original-commit: e77d9fc735d845bbb0b5562c359fbf2354d72f0e
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-11-04 11:16:31 +00:00
Nicolas Martinelli 2bdb85c59c [FIX] point_of_sale, stock: do not crash if no email set
- Create a POS user for which the corresponding partner has no email
  address.
- Connect to the POS with the created user
- Sell a product which creates a picking (e.g. Customizable Desk)

The picking is created in draft and not validated.

This is due to:

https://github.com/odoo/odoo/blob/6435b27c35faeafca452d26fa7fd50a7fe964029/addons/mail/models/mail_thread.py#L2199

We disable tracking and post the message as `sudo()`.

opw-2091808

closes odoo/odoo#39490

X-original-commit: 972b4bad55e76500847a525459865b81d6ad2ee0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-29 09:23:09 +00:00
Victor Feyens fe83659dbf [FIX] stock: lot default company.
closes odoo/odoo#39464

X-original-commit: d0cd57c90bcfdcf98698a68acabdc72001406d13
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-10-28 15:48:20 +00:00
svs-odooandsle-odoo 596b246f93 [IMP] stock: add signature field on picking
On a delivery type picking, adds a button to able the partner to sign
the delivery on receipt.

task-1878607

closes odoo/odoo#39183

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Co-authored-by: sle-odoo <sle@odoo.com>
2019-10-28 10:46:06 +00:00
svs-odoo decef03acf [IMP] product_expiry,stock: expiration_date at receipt
User can now define the lot's field `expiration_date` when he/she
receipts a tracked product using the expiration dates.

Task #1938656
2019-10-25 13:50:36 +00:00
Simon Lejeune 6ab4b0d496 [REF] stock: make picking button_validate multi
So we have to adapt
- the sanity checks
- the immediate/backorder wizards
- split the call to _action_done with and without backorder

This is a preliminary work to remove all the override in
stock_picking_batch and to allow choosing the pickings to immediate or
backorder directly in the wizards.

Before this commit, both wizards were calling _action_done and one
another. We make them go back through `button_validate` so that it is
more sane to handle and allow future extensions to add pre-action done
wizards.

Also the first part of button_validate is some sanity check. We adapt
them to be multi (inside of a loop over self) without any other
changes.

Now the wizard can work on the records (immediate: write the done
quantities) or work with the context (backorder: picking ids to not
backorder in the context).

Also we adapt the stock sms weird wizard (a confirmation wizard but the
feature is auto installed? wth). Now there it isn't manually called in
the middle of button_validate but it uses the pre_action_done_hook.

task-2069646
2019-10-25 08:10:40 +00:00
Arnaud Baes 0c6488a95a [REF] stock: Set action_done on pickings private
`action_done`on pickings should be a private method,
and called only trough the picking validation process.

task-1938108

closes odoo/odoo#39174

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-10-23 07:43:01 +00:00
Arnaud Baes 3e9a74aed4 [REF] stock: action_done cleaning
* rewrite the docstring
* rename pick -> picking
* rename ops -> move_line
* remove commented code

task-1938108
2019-10-23 07:39:30 +00:00
Raphael Collet c8dca514e6 [FIX] fields: compute_sudo defaults to True for stored fields only
The default `compute_sudo=True` makes sense for recomputing stored
fields that are indirectly related to a business operation.  This
ensures that the recomputation of the field does not break an operation
that is not aware of the fields to recompute.

However, computing non-stored fields in superuser mode is usually not
necessary.  It even leads to unexpected values: counting a partner's
sales orders does not give the same result in superuser mode as in
normal mode.  That is why non-stored fields are not computed in
superuser mode by default.

[FIX] account, delivery, event, hr_recruitment, point_of_sale, stock:
adapt the model definition to make all fields with the same compute
method have the same value for `compute_sudo`.

[FIX] sale: split the computation of `invoice_ids`, `invoice_count`
(non-stored) and `invoice_status` (stored), as no code is actually
shared.

closes odoo/odoo#39195

X-original-commit: 843fd38a97f02b49dc09d7f55919072d272fd80e
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-10-22 14:55:51 +00:00
Arnaud Baes eddc695ac3 [REM] stock: overprocessed quantity wizard.
As this wizard only shows the first product overprocessed and does nothing else,
we remove it completely for cleaning purposes.

task-1938108

closes odoo/odoo#39161

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-10-22 09:36:28 +00:00
Arnaud Baes c8c500c64d [IMP] stock: Hide transit locations
All transit locations were set as active by default, confusing some users.
There are now set as active only when when a ressuply route is created
between some warehouses

TaskID: 1873106
2019-10-16 06:09:02 +00:00
Jigar Patel 01f5550ee2 [IMP] stock: Rename default locations labels
TaskID: 1873106
2019-10-16 06:09:02 +00:00
Jigar Patel 316d5afdd3 [IMP] stock: add hierarchical view for stock location 2019-10-16 06:09:02 +00:00
Christophe Simonis d74b451805 [MERGE] forward port branch 13.0 up to f4105eb9c7 2019-10-09 02:08:17 +02:00
Simon Lejeune 2c22675ead [FIX] stock: remove move 'without package' properly
This revert the revert 61fa590e67 now that
400efc4d40 is merged.

closes odoo/odoo#38184

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-10-08 11:25:57 +00:00
William Henrotin 8303b1a69e [FIX] stock: immediate transfers in the future
Immediate transfers only fill the quantity done of stock moves/stock move lines
Those transfer are thus not taken into account for the forecast computation if they
are not validated. Indeed, the stock quant are not yet updated and the initial demand
is left blank.

This commit duplicate the quantity done of immediate transfer on their initial demand
this quantity is still hidden in the view but can now enter in the forecast quantity.

closes odoo/odoo#38169

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-10-08 09:35:36 +00:00
Nicolas Martinelli 8d910c59b5 [FIX] stock: route_sequence in multi-company
- Go to Inventory > Configuration > Warehouse Management > Routes >
   Make To Order
- Edit
- Swap two rules with the handles
- Save

An access error is raised.

This is due to the recomputation of `route_sequence` which is performed
on all companies.

Setting it as `compute_sudo` solves the problem.

opw-2072159

closes odoo/odoo#38104

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-08 08:09:50 +00:00
Arnold Moyaux 1ac00874a5 [FIX] stock: manual inter-company flow
Usecase:
- Create a route without company
- Create a push rule for company B from intercompany to stock
- Apply the push rule on product and set in on a product.
- Connect with a user in company A
- Create a move from stock(company A) to intercompany.
- Confirm the move

-> The receipt for company B is not created.

Multiple issues:
- The rule is not found because it belong to the other company and is
filtered by the record rules. -> Aplly the seach as sudo if the move
is going to a location without company.

- Record rule error because a move from intercompany to company B is
created with a user from company A that has no access to company A.
-> Search and read company values and create the move as super user.

Based on work from Simon Lejeune <sle@odoo.com>

closes odoo/odoo#38124

X-original-commit: a80262e8b97256cac4bc5c406bc74a05f7189a00
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-10-07 16:38:18 +00:00
Andrii Skrypka 6802c6af50 [REF] stock: _quantity_done_compute performance
Use read_group to speed up this compute.

Closes #34546

closes odoo/odoo#37894

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-10-07 08:07:36 +00:00
mreficent 72333b2e09 [IMP] stock: add hook to get virtual location
Some companies may have several locations with usage == 'inventory' and they would like to choose each time which adjustment location to use.

closes odoo/odoo#37022

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-10-03 15:35:47 +00:00
Simon Lejeune 61fa590e67 [REV] stock: remove move 'without package' properly
This reverts commit 3431d7b1cd.
Due to recent changes in the orm, editing a draft move crashes. We
revert this commit while we find a proper fix.

closes odoo/odoo#37752

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-10-02 06:56:43 +00:00
svs-odoo 31c8ebaac5 [IMP] stock: editable reordering rules list view
Task #2078163
2019-10-01 13:53:27 +00:00
svs-odoo 40c0a7ed38 [IMP] stock: editable scrap order list view
Sets `date_done` and `state` fields as readonly in the model as they
must not be editable in the list view and they were already readonly
in form view.

Task #2078163
2019-10-01 13:53:27 +00:00
svs-odoo 06aeb07cff [IMP] stock: editable picking list view
Makes the picking view list multi-editable, and some readonly conditions
was moved form the view to in the model (for the `backorder_id`, `name`,
`scheduled_date` fields).

Task #2078163
2019-10-01 12:34:17 +00:00
Simon Lejeune ad31097d8e [FIX] stock, delivery: put in pack and discard
rev[0] writes the qty done on the move lines directly in put_in_pack,
meaning hitting discard in the delivery wizard left the move lines with
a changed qty_done. We fix that by editing the quantities in
_put_in_pack in the stock module and getting the right move lines in the
delivery modules: meaning, get the normal or suggested ones (a fix
missed by rev[1]) then with quantities or 0 quantities.

[0] e03c1a836f
[1] f6d88a2e8d

closes odoo/odoo#37563

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-30 11:58:38 +00:00
William Henrotin 5c8f83ef6b [IMP] stock: open graph view by default
On the product form view, the forcast stat button should open
the Graph view by default and not the grid one

closes odoo/odoo#37501

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-27 11:53:07 +00:00
Arnold Moyaux e7bdf82f59 [FIX] stock: empty warehouse when company is not set.
When the user do not set a company on a route and check warehouse selectable
then it's impossible to select a warehouse. It happens due to the
check_company domain ['|', ('company_id', '=', company_id)('company_id','=',False)]

closes odoo/odoo#37404

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-09-25 13:17:05 +00:00
Christophe Simonis f1c0b08504 [MERGE] forward port branch saas-12.4 up to bef26222b8 2019-09-25 16:53:26 +02:00
Christophe Simonis 257a382b5c [MERGE] forward port branch saas-12.3 up to dd627b9698 2019-09-25 13:43:26 +02:00
Simon Lejeune 895fb09b74 [FIX] stock: put away on parent locations
oversight of bad6db2483

Closes #37289

closes odoo/odoo#37361

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-24 15:01:36 +00:00
Nicolas Martinelli a5835a160e [FIX] stock: do not display 'Location' and 'Warehouse' in search view
- Go to Inventory > Reporting > Inventory Valuation
- Run the report
- In the search view, filter on 'Location' or 'Warehouse'

The filter doesn't work.

Actually, the filter can't work. This is a hack introduced in order to
add context keys.

Originally, the function `search` was added to avoid the error log
'Non-stored field %s cannot be searched.'. This happens because the web
client adds the field in the domain on top of adding the context key. By
using `filter_domain`, no domain is added and no error is logged.

opw-2075456

closes odoo/odoo#37347

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-24 10:32:41 +00:00
Christophe Simonis ac4fc6e7c7 [MERGE] forward port branch saas-12.3 up to bd3e510edb
closes odoo/odoo#37314

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 09:44:56 +00:00
William 3431d7b1cd [FIX] stock: remove move 'without package' properly
on a picking, move_ids_without_package is a subset of move_lines.
The inverse function on move_ids_without_package only work well when we
add a move.

This commit improves the inverse function to take deletion into account

closes odoo/odoo#36558

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-09-20 14:01:19 +00:00
Christophe Simonis d67b2483e5 [MERGE] forward port branch saas-12.4 up to 9ed4872ea0
closes odoo/odoo#37372

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-24 17:45:37 +00:00
Sebastien LANGE ebda1101e3 [FIX] stock: slow downs in stock move line creation
— Create a new product, it's tracking must be set to 'By Unique Serial
    Number';
— Create a new purchase order, with 500 lines. Each line with 10 units
    of quantity of the previously created product;
— Confirm the purchase.

Before this commit, the creation of the stock piking take a quite some
time, and becomes difficult to use this functionality.

Now, the creation of the stock piking time was significantly improved.

opw-2070738

closes odoo/odoo#37107

X-original-commit: a434b087c86888903e320532b5e75856fa32bd13
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-09-19 07:09:04 +00:00
Christophe Simonis 080f8b1f96 [MERGE] forward port branch saas-12.3 up to d8ce75466e 2019-09-17 17:49:09 +02:00
Goffin Simon 9d25ad574f [FIX] stock: route_id required when creating stock.rule
Steps to reproduce the bug:
- Let's consider that warehouse A resupplies from warehouse B
- A has Outgoing Shipments in one step
- B has Outgoing Shipments in two steps
- Change Outgoing Shipments of B in one step

Bug: An integrity error was raised because route_id field is required
on model 'stock.rule'

PS Inspired from function create_resupply_routes

opw:2069163

closes odoo/odoo#36991

X-original-commit: 2a87b56efab1246fa85c1b507322e0909db3dd20
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-09-17 09:53:52 +00:00