I have a problem in Odoo 8 whenever I try to print an invoice that has two different delivery order. I get the following error:
File "C:\Program Files (x86)\Odoo 8.0-20160326\server\openerp\addons\company_accounts\account_invoice.py",line 24, in get_delivery_order File "C:\Program Files (x86)\Odoo 8.0-20160326\server\.\openerp\fields.py", line 824, in __get__ File "C:\Program Files (x86)\Odoo 8.0-20160326\server\.\openerp\models.py", line 5306, in ensure_oneQWebException: "ValueErrorExpected singleton: stock.picking(59, 58)" while evaluating"translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_invoice_document')"
when I access account_invoice.py the code affected is the following:
def get_delivery_order(self, cr, uid, order_origin, context=None):
p_id = self.pool.get('stock.picking').search(cr, uid, [('origin', '=', order_origin)])
return self.pool.get('stock.picking').browse(cr, uid, p_id).name
This error only happens if my invoice has more than one delivery order related to it, and I don't know how to solve it. It was coding done by a third party, and we didn't run into problems with it until now. I think that the problem is that it is expecting only one delivery order and it is getting more than one, but I'm unsure on how to solve it.