~openerp-commiter/openobject-addons/trunk-dev-addons3-mtr

« back to all changes in this revision

Viewing changes to account_voucher/account_voucher.py

[MERGE] branch merged with lp:~openerp-dev/openobject-addons/trunk-dev-addons3

Show diffs side-by-side

added added

removed removed

Lines of Context:
118
118
        if not view_id and context.get('invoice_type', False):
119
119
            mod_obj = self.pool.get('ir.model.data')
120
120
            if context.get('invoice_type') in ('out_invoice', 'out_refund'):
121
 
                result = mod_obj._get_id(cr, uid, 'account_voucher', 'view_vendor_receipt_form')
 
121
                result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_receipt_form')
122
122
            else:
123
 
                result = mod_obj._get_id(cr, uid, 'account_voucher', 'view_vendor_payment_form')
124
 
            result = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']
 
123
                result = mod_obj.get_object_reference(cr, uid, 'account_voucher', 'view_vendor_payment_form')
 
124
            result = result and result[1] or False
125
125
            view_id = result
126
126
        res = super(account_voucher, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
127
127
        doc = etree.XML(res['arch'])