Automatically retrive values of last entered record

Asked by Merlin

I am trying to implement a auto complete feature which works like this:

In the form view while adding new record if the user leaves a field empty and tabs out of it then that field should be automatically populated with the last value entered.

For example: If the user is entering a new Purchase Order and leaves a field blank then in that case OpenEPR should automatically retrieve value entered in the last PO and populate it.

Being new to OpenERP I don't know if there any helper objects that will help me do this with minimum coding.

Can someone please help me here?

Regards,

Question information

Language:
English Edit question
Status:
Answered
For:
Odoo Web Client Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
digitalsatori(Shine IT) (digitalsatori) said :
#1

Hi Merlin,

Bear in mind that OpenERP is a multi-user system. What if when you tab
out a blank field and someone else entered a new record where the field
value may not be your desired one.
OpenERP already implemented a dynamic fuzzy search mechanism for data
input. As you probably noticed that when you type along in the many2one
field, a fuzzy search will be triggered and you don't have to complete
the word, press the return, you will get a value instantly if it is the
only matched value or a list of streamlined record list for you to
choose from.
You may also set the default value on the field by clicking the 'Set
Default' button on the right hand side. Better off, You are allow to
create a condition for that default value, eg. for customer=IBM set the
saleman default value to Merlin, and the default value can be set for
specific user or globally.

Best regards,

<http://www.openerp.cn>

*Tony Gu* --Shine IT-- Shanghai, China
Tel : + 86 21 66044468
Cell: + 86 13386068213 Skype: digitalsatori
http://www.openerp.cn
*OpenERP Official Partner in China*

On 2012年05月10日 13:50, Merlin wrote:
> New question #196719 on OpenERP Web Client:
> https://answers.launchpad.net/openobject-client-web/+question/196719
>
> I am trying to implement a auto complete feature which works like this:
>
> In the form view while adding new record if the user leaves a field empty and tabs out of it then that field should be automatically populated with the last value entered.
>
> For example: If the user is entering a new Purchase Order and leaves a field blank then in that case OpenEPR should automatically retrieve value entered in the last PO and populate it.
>
> Being new to OpenERP I don't know if there any helper objects that will help me do this with minimum coding.
>
> Can someone please help me here?
>
> Regards,
>
>
>

Revision history for this message
Numérigraphe (numerigraphe) said :
#2

You can also define a "_default" function to set a default value for your field. You could search for the latest PO of the current user, for example.
Lionel Sausin.

Can you help with this problem?

Provide an answer of your own, or ask Merlin for more information if necessary.

To post a message you must log in.