← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 672626] Re: [truck][RC1] Bug in fields_view_get in invoice.py

 

** Changed in: openobject-addons
       Status: Confirmed => In Progress

-- 
[truck][RC1] Bug in fields_view_get in invoice.py
https://bugs.launchpad.net/bugs/672626
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Addons Modules: Fix Released

Bug description:
addons\account\invoice.py
account_invoice.fieds_view_get


def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
        journal_obj = self.pool.get('account.journal')
        if context.get('active_model','') in ['res.partner']:
            partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[0]

if no active_ids crash

Solution: test is active_ids present and have a value

def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
        journal_obj = self.pool.get('account.journal')
        if context.get('active_model','') in ['res.partner'] and context.get('active_ids','False') and  context['active_ids']:
            partner = self.pool.get(context['active_model']).read(cr,uid,context['active_ids'],['supplier','customer'])[0]





References