Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use Imports file in Odoo

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 255
    Comment on it

    The imports are ordered as
    1. External libraries (one per line sorted and split in python stdlib)
    2. Imports of openerp
    3. Imports from Odoo modules (rarely, and only if necessary)
    Inside these 3 groups, the imported lines are alphabetically sorted.
    For example is you can see below code.

    # 1 : imports of python lib
    import base64
    import re
    import time
    # 2 :  imports of openerp
    import openerp
    from openerp import api, fields, models # alphabetically ordered
    from openerp.tools.safe_eval import safe_eval as eval
    from openerp.tools.translate import _
    # 3 :  imports from odoo modules
    from openerp.addons.website.models.website import slug
    from openerp.addons.web.controllers.main import login_redirect

    Note-Imports from Odoo modules (rarely, and only if necessary)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: