diff --git a/purchase_lot/__manifest__.py b/purchase_lot/__manifest__.py index c8124de0ce3..f35940e2d88 100644 --- a/purchase_lot/__manifest__.py +++ b/purchase_lot/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Purchase Lot", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "category": "Purchase", "license": "AGPL-3", "author": "Akretion, Odoo Community Association (OCA)", diff --git a/purchase_lot/models/purchase_order_line.py b/purchase_lot/models/purchase_order_line.py index d696692fc37..3a9c2f6a24d 100644 --- a/purchase_lot/models/purchase_order_line.py +++ b/purchase_lot/models/purchase_order_line.py @@ -8,9 +8,7 @@ class PurchaseOrderLine(models.Model): _inherit = "purchase.order.line" - lot_id = fields.Many2one( - "stock.lot", string="Serial Number", readonly=True, copy=False - ) + lot_id = fields.Many2one("stock.lot", string="Serial Number", copy=False) @api.model def _prepare_purchase_order_line_from_procurement( @@ -46,7 +44,7 @@ def _find_candidate( values, ): lot_id = values.get("restrict_lot_id", False) - self = self.filtered(lambda l: l.lot_id.id == lot_id) + self = self.filtered(lambda line: line.lot_id.id == lot_id) return super()._find_candidate( product_id, product_qty, diff --git a/purchase_lot/tests/test_purchase_lot.py b/purchase_lot/tests/test_purchase_lot.py index 4fc2c5d8827..e4be9a41edf 100644 --- a/purchase_lot/tests/test_purchase_lot.py +++ b/purchase_lot/tests/test_purchase_lot.py @@ -84,7 +84,9 @@ def test_purchase_lot(self): ) # not merged because of different lot self.assertEqual(len(pols), 2) - pol1 = pols.filtered(lambda l: l.move_dest_ids.restrict_lot_id.id == lot1.id) + pol1 = pols.filtered( + lambda line: line.move_dest_ids.restrict_lot_id.id == lot1.id + ) self.assertEqual(pol1.lot_id.id, lot1.id) pol1.order_id.button_confirm() self.assertEqual(pol1.move_ids.restrict_lot_id.id, lot1.id) diff --git a/purchase_lot/views/purchase_order_view.xml b/purchase_lot/views/purchase_order_view.xml index f7574afd5cc..7879539ba5d 100644 --- a/purchase_lot/views/purchase_order_view.xml +++ b/purchase_lot/views/purchase_order_view.xml @@ -9,7 +9,7 @@ expr="//field[@name='order_line']/tree/field[@name='name']" position="after" > - + @@ -19,7 +19,7 @@ - +