Skip to content

Commit e76c542

Browse files
[FIX] stock: order stock.production.lot by name
Sorting the `stock.quant` by lot_id didn't work correctly Steps to reproduce: 1. Install Inventory 2. Edit a product tracking to 'By Unique Serial Number' (e.g. Acoustic Bloc Screens) 3. Go to Inventory > Overview > Receipts, create a receipt for 3 Acoustic Bloc Screens with serial number '05', '01' and '03' and validate 4. Go to Inventory > Reporting > Inventory Report, remove the 'Group By' filters and sort the entries by Lot/Serial Number 5. The serial numbers are not properly ordered ('01' is between '03' and '05') Solution: Order the `stock.production.lot` by name Problem: Sorting the `stock.quant` by lot_id used the id of `stock.production.lot` opw-2879464 closes odoo#94248 X-original-commit: 743000b Signed-off-by: William Henrotin (whe) <[email protected]> Signed-off-by: Guillaume Merlin (megu) <[email protected]>
1 parent 6964e0c commit e76c542

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

addons/stock/models/stock_production_lot.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class ProductionLot(models.Model):
1010
_inherit = ['mail.thread', 'mail.activity.mixin']
1111
_description = 'Lot/Serial'
1212
_check_company_auto = True
13+
_order = 'name, id'
1314

1415
name = fields.Char(
1516
'Lot/Serial Number', default=lambda self: self.env['ir.sequence'].next_by_code('stock.lot.serial'),

0 commit comments

Comments
 (0)