From 08e0003177cbec9413c7e9bc547d081df626fd06 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Fri, 10 Jan 2014 14:48:45 +0100 Subject: [PATCH] [FIX] account_voucher: in fields_view_get overwrite, also add the 'default_supplier/customer' properity in context. With this the 'create and edit' menu will initiate the partner as a supplier. bzr revid: mat@openerp.com-20140110134845-hvbob1mii4ofqjay --- addons/account_voucher/account_voucher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index 7e7cd9d6507..f6ce6e0823a 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -226,7 +226,7 @@ class account_voucher(osv.osv): if context.get('type', 'sale') in ('purchase', 'payment'): nodes = doc.xpath("//field[@name='partner_id']") for node in nodes: - node.set('context', "{'search_default_supplier': 1}") + node.set('context', "{'default_customer': 0, 'search_default_supplier': 1, 'default_supplier': 1}") if context.get('invoice_type','') in ('in_invoice', 'in_refund'): node.set('string', _("Supplier")) res['arch'] = etree.tostring(doc)