← Back to team overview

openerp-india team mailing list archive

[Bug 1009243] Re: audittrail not escaping apostrophes

 

Yes, it works for me too on a demo database, so the fault is mine.

I have a plpython trigger function on the audittrail tables. I assumed
it would be getting the data unadulterated but no, the escaping gets
pre-stripped and I have to re-apply it in the trigger.

Sorry to be a bother.

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1009243

Title:
  audittrail not escaping apostrophes

Status in OpenERP Addons (modules):
  Incomplete

Bug description:
  6.0.3 addons revno 3475

  ERROR:db.cursor:Programming error: syntax error at or near "s"
  LINE 1: ....468913',137659,2168,'Grower','336',433339,'M & M's Farm Ltd...
                                                               ^
  QUERY:  INSERT INTO audittrail_log_line
  (create_uid,create_date,log_id,field_id,field_description,new_value,id,new_value_text) VALUES (1,'2012-06-05 10:35:58.468913',137659,2168,'Grower','336',433339,'M & M's Farm Ltd.')
  , in query insert into "audittrail_log_line" (id,"old_value_text","new_value","log_id","old_value","field_id","field_description","new_value_text",create_uid,create_date) values (433339,%s,%s,%s,%s,%s,%s,%s,%s,now())

  "M & M's Farm Ltd." is the name of a partner. I have a few with
  apostrophes in them.

  So create or edit a partner and put an apostrophe in their name.
  Set up audittrail to log creation of an invoice (or some other model with a reference to partner).
  Create an invoice for that partner.

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


References