Odoo Help


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.


Customer's first command

on 4/23/13, 10:36 AM 723 views

Hi, I am new in OpenERP's domain.

My question is : I want to show in customer view the date of his first command, may u plz help me?

This is my code, but it doesn't work :

class res_partner(osv.osv):
    _inherit = "res.partner"
        def _get_date_first_order(self, cr, uid, ids, name, partner_id, arg, context=None):
        res = {}
        for id in ids :
                    sale_order """,(tuple(ids),))
        return res

    _columns = {
        'customer_date_order': fields.function(_get_date_first_order, method=True, store=True, type='datetime', string='Date First order', select=1),

anyone can help?!

on 5/2/13, 8:08 AM
Gilles Major (gim)
On 4/24/13, 1:03 PM

v7: Hello, the simplest way to do this would be to go to that customer's form view, click the "Quotations and Sales" button and then sort the orders by clicking on the the Date column.

V6: go to Sales => Address Book => Customers, select a customer, then click on the "Sales" link on the right of the window. A new popup will open. You can then sort sales orders by the same method as above.

I prefer to add a field fuction in form view, but my code desn't work !!

on 4/26/13, 7:25 AM
Dharmesh Rathod
On 4/25/13, 5:40 AM


In case to see date without open any other form, add new field function type into customer and write SQL query or use search method (with order='date' and limit=1).

Email : info@acespritech.com
Skype : acespritech
Blog : acespritechblog.wordpress.com

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

0 follower(s)


Asked: 4/23/13, 10:36 AM
Seen: 723 times
Last updated: 3/16/15, 8:10 AM