bug in account/account.py

Bug #655793 reported by Leigh Willard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Undecided
Unassigned

Bug Description

There is at least one place that calls post without a context, which causes the routine to crash.

Here is the BEFORE:

def post(self, cr, uid, ids, context=None):
        invoice = context.get('invoice', False)

(note that context gets set to None by default)

Here is the FIX:

def post(self, cr, uid, ids, context={}):
        invoice = context.get('invoice', False)

Related branches

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

hi could be better
def post(self, cr, uid, ids, context=None):
    if context == None:
        context = {}

Regards

Revision history for this message
Borja López Soilán (NeoPolus) (borjals) wrote :

I would propose:
-------------------------
def post(self, cr, uid, ids, context=None):
    if context is None:
        context = {}
------------------------

That would match the code conventions stated here: http://doc.openerp.com/developer/Appendices/code_convention.html

Revision history for this message
Cristian Salamea (ovnicraft) wrote :

i am agree with Borja.

Changed in openobject-addons:
status: New → Confirmed
milestone: none → 6.0
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks guys,
it has been fixed by revision 4241 <email address hidden>.

Changed in openobject-addons:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.