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.


how to save form with custom name

on 5/23/14, 10:18 AM 822 views

I have a form named 'territory'. Whenever I save the form, it gets saved with name "territory,#"

where # is 1,2,3,4, etc.


I want to save the form with custom name like - 

1. Value of field inside form(Eg. In my case i want to save form with name of territory i have entered in form).

2. I want to save form with series starting with - 0001, 001, 111, etc.

3. How can i change the separator between the name. Currently the seperator used is ",". I want separators like "-", ".", ":"


Please guide me with full details on how i can achieve this. Thanks in advance. ?


You have to define a column in your module with the name "name", and that will be displayed on your form header. If no column "name" is defined, it will display your form name followed by it's ID.


class territory(osv.osv):
    _name = "territory"
    _description = "Territory"
    _columns = {
        'name': fields.char('Insert territory name', size=64, required=True),
        (... the rest of your columns description goes here...)
    _sql_constraints = [
        ('name', 'unique(name)', 'Territory name must be unique')
    _order = 'name asc'


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

1 follower(s)


Asked: 5/23/14, 10:18 AM
Seen: 822 times
Last updated: 3/16/15, 8:10 AM