Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

How to get Creation Date for created Customer? [Closed]

By
Atchuthan - Technical Consultant, Sodexis Inc
on 12/24/13, 9:20 AM 3,040 views

The Question has been closed

by
Atchuthan - Technical Consultant, Sodexis Inc
on 01/10/2014 01:28:20

I need to display the creation date for customers that were created in tree view.

How can I achieve this?

Is there any ORM method to get creation date of records and store it in a variable.

17

Atul Arvind

--Atul Arvind--
1854
| 3 3 5
India
--Atul Arvind--

Hello, 

I am odoo Enthusiast/Consultant from Baroda, Gujarat, India. Working with odoo from v5 to v9 and other opensource technology since 4+ years. Having Strong Expertise in

Requirement gathering & Gap Analysis

Odoo Development

Odoo Customization

Odoo Training

Odoo Integration

Server Administration

Odoo Migration

Implementation

I am also active on StackOverflow.

or 


Atul Arvind
On 12/24/13, 11:15 AM

FIRST,

You must add the field to the model. Although a database field already exists, this is not visible to the model until you define it:

class res_partner(osv.osv):
    _inherit='res.partner'

    _columns={
        'create_date' : fields.datetime('Create Date', readonly=True),
    }

NEXT,

You need to inherit/create the tree view and put a new field like,

<field name="create_date"/>

So we cant use the create_date available in table(when viewed from PgAdmin)?

My need is to show the database record created date i.e when available if clicked on View Log at DEBUG mode

Atchuthan - Technical Consultant, Sodexis Inc
on 12/26/13, 7:08 AM

This method is how you use that field. The field only exists at the PostgreSQL level, and it not available as a standard field on the res.partner model. Adding it as explained above gives you that ability. The field on the model will show the value of the field that exists in PostgreSQL.

Bista Solutions US, Ray Carnes
on 12/26/13, 5:29 PM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 12/24/13, 9:20 AM
Seen: 3040 times
Last updated: 12/11/15, 9:50 AM