Odoo Help


What is base_state in class arguments?

Brett Lehrer
on 5/29/13, 1:39 PM 1,789 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

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 5/29/13, 1:39 PM
Seen: 1789 times
Last updated: 3/16/15, 8:10 AM