Create/update user information

Donate to this project

Development Project Status: Completed

Due date for completion of this stage: 
Project funding: 

You can donate money to this project by entering the amount above and clicking the 'Add to cart' button. In the Checkout process you can either choose to pay now (via Bank Transfer, Cheque or Pay Pal) or you can pledge the amount by choosing the 'Pledge a payment for a Development Project' method. If you make a pledge, then when we have 100% funding commitments, you will be notified by email and you can then action your payment. Note that development will not commence until all funds are received.

Project description: 


There is currently no way to determine:

  • who last edited an object
  • who created an object (with the exception of acts)

This project will add support to track the who created and updated an object and when. This information can be:

  • displayed in the user interface
  • included in reports

Creation and update information will be added to:

  • Acts (includes financial acts, document acts)
  • Entities
  • Parties
  • Users
  • Products
  • Product Prices
  • Lookups
  • Documents
  • Archetypes
  • Roles
  • Authorities

This will be done by adding four new columns to the underlying database tables:

  • create_time
  • create_user
  • update_time
  • update_user

These will be exposed on the archetypes as the following nodes:

  • createTime
  • createUser
  • updateTime
  • updateUser

These nodes will be hidden and read-only.

This change will also:

  • remove the need for on acts
  • remove the need for createdDate on party.patientpet

User Interface Changes

Editors and viewers will be updated to display the create and update information on the top right of the view.

Database changes

The following tables will be updated to include the create_time, create_user, update_time and update_user columns.

  • acts
  • archetype_descriptors
  • assertion_type_descriptors
  • documents
  • entities
  • lookups
  • product_prices
  • security_roles

To aid reporting, indexes will be placed on the create_time and update_time columns.


  • for acts that provide an author node, the createUser will set to the author, and the author participation will be deleted
  • party.patientpet instances with a non-null createdDate will have a change record created, with the timestamp set to createdDate. The createdDate will be removed.
  • document templates that reference author nodes need to be updated to use
openvpms:get(., "")


This project will not provide create/update information for:

  • contacts
  • relationships
  • identities
  • links

The information can be obtained from the parent objects e.g. for a phone number contact, the party.customerperson object will track who created or updated it.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: Add created and updated details to primary archetypes

Tim - sounds good to me.

Q1. If I edit a product and change only its price, there will be a change record referenced by the product.* 'record' - but I assume that there will be no reference in the productPrice.* 'record' (because productPrice is not one of the things that you call out above)

Q2. Should we track price changes? [ie should productPrice.* have a reference to the change record]

Q3. If so, will automatic price updates generate a change record?

Q4. If the Product Import facility is used, does this generate change records?
      [Note that Stock Import is subtly different in that the import generates the stock adjustment - in it only when you finalise this that the change records will be created]

Q5. If I finalise an invoice, I understand that the acts will have references to an update record - but does the party.customerPerson ?  If so then we lose track of who last updated the customer; if not then the estimate of 2*total primary objects is wrong because there will be a change record for each invoice.

Regards, Tim G


Re: Add created and updated details to primary archetypes

Q1-Q3. At the moment, I'm not planning on adding change records for child objects (relationships, product prices, contacts). When you change a price, the parent product change record will update.

Q4. When you import product prices, the change will be tracked on the products.

Q5. Why do you want the party.customerperson to be updated? You have the change record on the invoice and payment to determine who changed the customer balance.

Regarding the no. of change records: each tracked object can have at most 2 records, and some of these will be shared amongst multiple objects. The  2*total primary objects is the worst case scenario.


Re: Add created and updated details to primary archetypes

This needs to track:






On any object, by user or for all users.



I have attached some screenshots of a very well implemented audit trail from a another opensource project.

Audit Trail System in OpenERP.pdf 310.14 KB

Re: Add created and updated details to primary archetypes

I think auditing is a separate issue to what this project is trying to address.

This project is trying to provide information to users about who created an object, be it a customer, patient or invoice, and who last updated it. This information would be available in the UI, and could be used in reports.

This information would always be available (e.g. it could be used to determine when to lock medical records as per ), whereas an audit log could be enabled or disabled.

With regards to auditing, I can see that its useful to track writes, updates, and deletes. Which reads would you want to track, and why?


Re: Add created and updated details to primary archetypes


I know TimA said this is looking to solve a different issue than an Audit trail. However I am not sure where else to put this post.

I agree with Ben that we need to capture any modifications, creation or deletions for all information in OVPMS. I am a little less sure of the need to capture all reads. I can't imagine many situations where I want to see every record or piece of information a person has looked at. But any time something changes. This information should be captured.


In addition beyond simple auditing there needs to be a simple and user friendly way to retrieve this information. Simply capturing the data only solves half the issue.

So any audit system needs to also come with a way to view this data. I.e. As admin I should have a screen where I can query any of the things mentioned.

So perhaps I want to search for and see all changes to patient notes between between dates X and Y done by user Z...

Or all invoice items deleted by user A....


Pretty much, anything that is changed it should be captured and viewable.

Re: Add created and updated details to primary archetypes

The hibernate Envers project can support this. Every insert, update and delete is tracked in a separate table. There is an overview on how it works here.

The main downside is that your database will be at least twice as large compared to using no auditing, assuming you enable auditing when you first install OpenVPMS. Given that most objects are saved multiple times, it could grow much larger.

Getting the data out again and presenting it in a coherent manner is another issue, as the query support is different. e.g. you could list all invoices that have been created, updated or deleted between a particular date range. Viewing an actual historical invoice is a bit harder, as it it needs to also pull in all of the historical relationships associated with that invoice.

Re: Add created and updated details to primary archetypes


- That link made my eyes water... sorry, too technical for me.

- I am not sure database size is an issue... Perhaps it is just us but storage is cheap and we are on a cloud server so scalability is not a massive issue. For smaller clinics they would likely have an onsite server but a much smaller database.... I guess for me this is not an issue.

- Data out is important. I think that you would want to be able to do things like...

  - Look at the changes to a particular invoice over time

  - Look at changes to a medical history or medical notes over time.

  - Look at who has added or removed client/patient information for a particular patient.

I think it needs to be reasonably user friendly for at least basic queries.

Re: Create/update user information


Perhaps this is the wrong spot for my issue, but I think it's on a similar idea as this.

I am having issues with staff moving/editing appointments on the schedule and not being able to tell who has done it.

We use Author on all our schedules - which is great because we can see who has created the appointment. But if the appointment is edited, it still remains under that initial Author's name.

Also, if someone copy + pastes an appointment, then the initial Author is used, not the person who is creating the 'new' copied appointment.

It would be great if the Author was updated automatically when an appointment is changed in any way. Or, if there was a second 'Author' somehow described as the person who edited the appointment.



Re: Create/update user information

This project would be able to tell you who moved an appointment, providing no one has subsequently edited it.

At present, when you copy and paste an appointment, the author will reflect the user that copied it. When you move an appointment, the author remains unchanged.

Re: Create/update user information

Hi All,

Keen to kick this discussion along again.

How does this project interact with the product price history discussion (

Should we look at merging the two projects / discussions into a single project or are they best kept as separate discussions and projects.   I'm not sure of the technicalities but would like to progress this issue.


Any thoughts / comments appreciated





Syndicate content