diff --git a/addons/stock/models/stock_picking.py b/addons/stock/models/stock_picking.py index 2e173d5634f..58756805671 100644 --- a/addons/stock/models/stock_picking.py +++ b/addons/stock/models/stock_picking.py @@ -29,7 +29,7 @@ class PickingType(models.Model): sequence = fields.Integer('Sequence', help="Used to order the 'All Operations' kanban view") sequence_id = fields.Many2one( 'ir.sequence', 'Reference Sequence', - check_company=True, copy=True) + check_company=True, copy=False) sequence_code = fields.Char('Sequence Prefix', required=True) default_location_src_id = fields.Many2one( 'stock.location', 'Default Source Location', compute='_compute_default_location_src_id', diff --git a/addons/stock/tests/test_stock_flow.py b/addons/stock/tests/test_stock_flow.py index 303caae1760..448c7a744ac 100644 --- a/addons/stock/tests/test_stock_flow.py +++ b/addons/stock/tests/test_stock_flow.py @@ -2485,28 +2485,6 @@ class TestStockFlow(TestStockCommon): pickings.button_validate() self.assertTrue(all(pickings.mapped(lambda p: p.state == 'done')), "Pickings should be set as done") - def test_pickings_on_duplicated_operation_types(self): - """ Ensure we can create pickings on duplicated operation types without collision in names - Steps: - - Create a picking on an operation type - - Duplicate the operation type - - Create another picking on the duplicated operation type - """ - self.PickingObj.create({ - 'picking_type_id': self.picking_type_in, - 'location_id': self.supplier_location, - 'location_dest_id': self.stock_location, - }) - duplicated_picking_type = self.env['stock.picking.type'].browse(self.picking_type_in).copy() - picking_2 = self.PickingObj.create({ - 'picking_type_id': duplicated_picking_type.id, - 'location_id': self.supplier_location, - 'location_dest_id': self.stock_location, - }) - # trigger SQL constraints - self.PickingObj.flush_model() - self.assertEqual(self.PickingObj.search_count([('name', '=', picking_2.name)]), 1) - def test_empty_picking_draft(self): """ test an empty still can be reset to draft """ picking = self.PickingObj.create({