Skip to content

Commit

Permalink
[FIX] account_voucher: in fields_view_get overwrite, also add the 'de…
Browse files Browse the repository at this point in the history
…fault_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
  • Loading branch information
mart-e committed Jan 10, 2014
1 parent b65cbbb commit 08e0003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addons/account_voucher/account_voucher.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None,
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)
Expand Down

0 comments on commit 08e0003

Please sign in to comment.