← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 583265] Re: CSV export crash when browse null is in some relations

 

Hello,

I know this bug is a bit old, but I have the same problem here. Albert's
patch works perfectly.

Jay: the problem with check_type() is that it's only called if the
column exists either in self._columns or in self._inherit_fields. When
exporting fields from related fields (i.e. when the column doesn't
belong to the current object) the column types aren't available. Maybe
this is the real bug (?) and it should really never happen.

To reproduce, try going to Sales Management/Sales Orders, create one
entry with a shipping address without country and then export Shipping
Address/Country/Contry Code. At that point 'country_id' isn't found in
self._columns or in self._inherit_fields and check_type isn't called.

Regarding the proposed patch, I find defaulting to an empty string when marshaling a null object (of an unknown column type) is much better than crashing.
 
Thanks!


** Changed in: openobject-server
       Status: Invalid => Confirmed

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP Project Group.
https://bugs.launchpad.net/bugs/583265

Title:
  CSV export crash when browse null is in some relations

Status in OpenERP Server:
  Confirmed

Bug description:
  CSV export generates client side error can not marshal
  osv.orm.browse_null.

  The error comes from the fact in that browse_null are exported instead of false.
  I  have made a temporary patch that remove the browse_null, but I did not have the time to trace the export functions (that lack a little comments), so the patch can be far better. 

  
  Regards 

  Nicolas

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/583265/+subscriptions