The problem is that archiving is handled via a _before_update callback, 
which (a) only receives the fields that are explicitly submitted with the 
form (i.e., not the modified_on and modified_by fields) and (b) archives 
only if the submitted fields differ from those in the original record. The 
modified_on and modified_by values, on the other hand, are not updated 
until after the _before_update callback is called.

To avoid the behavior, I think you will have to manually check whether the 
submitted fields differ from the original record and then either (a) 
temporarily changed the "update" attribute of the modified_on and 
modified_by fields so their values are not actually updated or (b) 
explicitly add the modified_on and modified_by fields to the form vars so 
the archive record creation will be triggered.

Anthony

On Wednesday, August 2, 2017 at 12:45:48 PM UTC-4, Seth J wrote:
>
> Quick question, guys.  I've noticed that when record is edited in a grid 
> and no changes are made to it when hitting 'Submit' no entry is made into a 
> corresponding archive table.  However, fields "modified on" and "modified 
> by" are adjusted according to a user who submitted a change.  Is there way 
> to either not change the latter fields or put an entry in an archive table 
> reflecting previous state?  
> It becomes a little bit misleading and hard to proof that people have not 
> made any changes to the record when their name appears as an editor of the 
> field.  Thanks!
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to