Hello,

I have a pretty strange problem. I have record that has to be updated and
approved, so all the fields are writable=false except those reserved to the
approver... Since I migrate to 1.91.6 the I let crud represent my boolean
field with a checked or empty checked boxes my record in read and update
mode. It seems that the origine of the problem is coming from there...

The problem now :

When the user try to submit a updated form and approve it, the validator
trigger on and tell that the boolean field that were checked can't be empty.
The boolean field that was checked is no more checked in the returned form
state after the validator popup...

I don't get any error ticket.

What seems to happen is that for some reason the boolean fields vars in the
session are set to "None" before the insertion is going on and since the
field can't be NULL the form won't submit.

I am not sure, but this problem seems to me related to this one :
http://groups.google.com/group/web2py/browse_thread/thread/96f5f4b22fa4bf2b/0aa97dea609d8444?lnk=raot&pli=1

I try :

            if not self.ignore_rw and not self.table[fieldname].writable:
                ### this happens because FROM has no knowledge of writable
                ### and thinks that a missing boolean field is a None
                #
-----------------------------------------------------------
                # Those lines (below) have been replace by the one under
them
                # It is bug of the version 1.91.6 patched in trunk but
                # no release have been publish... RV
                #if self.table[fieldname].type == 'boolean' and
self.vars[fieldname]==None:
                #    del self.vars[fieldname]
                #continue
                # The modified lines start
                if self.table[fieldname].type == 'boolean' and \
                    self.vars.get(fieldname,True) == None:
  *                  pass #del self.vars[fieldname]*
                continue
                # The modified lines end
                #
-----------------------------------------------------------

But it not working...

When I use :

"""
db.table.result.represent=\
    lambda value: value==True and T('Positive') or T('Negative')
"""

My update form submit correctly.

I can also put my field writable=True, no problem, but it break my work
flow.

I didn't succeed in reproducing the problem in a simplified demo app...

I try the trunk same problem...

Richard

PS.: Sorry for double post, I have problem to get email on the list.

Reply via email to