Browse Source

[UPTD]Singleton Error Corrected

pull/78/head
Sreejith 8 years ago
parent
commit
731a6f76d9
  1. 4
      invoice_stock_move/models/invoice_stock.py

4
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]

Loading…
Cancel
Save