← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 672626] [NEW] [truck][RC1] Bug in fields_view_get in invoice.py

 

Public bug reported:

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]

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
[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: New

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]





Follow ups

References