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.


What is base_state in class arguments?

Brett Lehrer
on 5/29/13, 1:39 PM 1,155 views

The CRM module has the first encounter with this that I've seen. It's in crm/crm_phonecall.py at the very top. Appears to be new to 7.0. What does this mean? I can't find any good explanation in the documentation (the search feature was taken away!). Code sample from crm_phonecall.py:

from openerp.addons.base_status.base_state import base_state
# [...]

class crm_phonecall(base_state, osv.osv):
    """ Model for CRM phonecalls """
    _name = "crm.phonecall"
    _description = "Phonecall"
    _order = "id desc"
    _inherit = ['mail.thread']
    _columns = {
        # base_state required fields
        'date_action_last': fields.datetime('Last Action', readonly=1),
        'date_action_next': fields.datetime('Next Action', readonly=1),
        'create_date': fields.datetime('Creation Date' , readonly=True),
            # [...]

Going to that module there is a very small description:

""" Base utility mixin class for objects willing to manage their state.
    Object subclassing this class should define the following colums:
    - ``date_open`` (datetime field)
    - ``date_closed`` (datetime field)
    - ``user_id`` (many2one to res.users)
    - ``partner_id`` (many2one to res.partner)
    - ``email_from`` (char field)
    - ``state`` (selection field)

But this isn't explaining all that much. Anyone have any clearer explanation?

Any help would be appreciated!

Dharmesh Rathod
On 5/29/13, 3:36 PM


There is module 'base_status' in addons directory. This is new working methodology of version 7. you can find this same class inherit in project module also.

It's managing states and stages globally instead of individual.

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

Can you give an example of where/why you'd want to do that? I'm having trouble understanding the point of it.

Brett Lehrer
on 5/31/13, 3:03 PM

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: 5/29/13, 1:39 PM
Seen: 1155 times
Last updated: 3/16/15, 8:10 AM