From 731a6f76d95cd96635426fbea50771dccc98bc66 Mon Sep 17 00:00:00 2001 From: Sreejith Date: Sat, 3 Mar 2018 11:00:03 +0530 Subject: [PATCH] [UPTD]Singleton Error Corrected --- invoice_stock_move/models/invoice_stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/invoice_stock_move/models/invoice_stock.py b/invoice_stock_move/models/invoice_stock.py index 098f8753e..53ca5a97e 100644 --- a/invoice_stock_move/models/invoice_stock.py +++ b/invoice_stock_move/models/invoice_stock.py @@ -31,7 +31,7 @@ class InvoiceStockMove(models.Model): def _default_picking_receive(self): type_obj = self.env['stock.picking.type'] company_id = self.env.context.get('company_id') or self.env.user.company_id.id - types = type_obj.search([('code', '=', 'incoming'), ('warehouse_id.company_id', '=', company_id)]) + types = type_obj.search([('code', '=', 'incoming'), ('warehouse_id.company_id', '=', company_id)], limit=1) if not types: types = type_obj.search([('code', '=', 'incoming'), ('warehouse_id', '=', False)]) return types[:1] @@ -40,7 +40,7 @@ class InvoiceStockMove(models.Model): def _default_picking_transfer(self): type_obj = self.env['stock.picking.type'] company_id = self.env.context.get('company_id') or self.env.user.company_id.id - types = type_obj.search([('code', '=', 'outgoing'), ('warehouse_id.company_id', '=', company_id)]) + types = type_obj.search([('code', '=', 'outgoing'), ('warehouse_id.company_id', '=', company_id)], limit=1) if not types: types = type_obj.search([('code', '=', 'outgoing'), ('warehouse_id', '=', False)]) return types[:4]