Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

How to use greetingswidget in OpenERP/Odoo ?

If you want to use greetingswidget in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard .js file: local.HomePage = instance.Widget.extend({ start: function() { this.$el.append("Hello dear Odoo user!"); ...

How to remove 'provision' from selection list when configuring Cash Flow in Odoo

In below example, I have written Python script to remove 'provision' from selection list when configuring Cash Flow Codes. Paste below python code in .py file : def fields_get(self, cr, uid, fields=None, context=None): res = super(accoun...

How to use display content in OpenERP/Odoo ?

We have two methods and features to display content. 1-format the widget's data 2-display the widget The HomePage widget already has a start() method. This method is part of the normal widget lifecycle and it is automatical...

How to use ir.actions.client code in OpenERP/Odoo ?

On the server side, we can simply defined an ir.actions.client. In below code we will use .xml file. <record id="action_home_page" model="ir.actions.client"> <field name="tag">petstore.homepage</field> </record> ...

How to use client actions in OpenERP/Odoo ?

A client action is an action type defined almost entirely in the client, in javascript for Odoo web. The server simply sends an action tag and optionally adds a few parameters, but beyond that everything is handled by custom client code.For examp...

How to modify the PetToysList component in OpenERP/Odoo ?

How to modify the PetToysList component so clicking on a toy replaces the homepage by the toy's form view in OpenERP/Odoo ? If you want to modify the PetToysList component in OpenERP(Odoo) so that when you click on a toy it replaces the homepa...

How to use the action manager in OpenERP/Odoo ?

The action manager can be invoked explicitly from javascript code by creating a dictionary describing an action of the right type, and calling an action manager instance with it. In below example I have written javascript to Include only parent ...

How to use web-services in OpenERP/Odoo?

If you want to use WebServices in OpenERP(Odoo) follow the below mentioned code and paste it in your WebServices XML-RPC file: import xmlrpclib define HOST, PORT, DB, USER, PASS url = 'http://%s:%d/xmlrpc/common' % (HOST,PORT) sock = ...

How to make wizard execution in OpenERP/Odoo?

If you want to make wizard execution in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard views_xml file: <record id="action_idea_cleanup_wizard" model="ir.actions.act_window"> <field name="name">Clean...

How to make wizard views in OpenERP/Odoo?

If you want to make wizard views in OpenERP(Odoo) follow the below mentioned code and paste it in your wizard views_xml file: <record id="action_idea_cleanup_wizard" model="ir.actions.act_window"> <field name="name">Cleanup</f...

How to make security system in OpenERP/Odoo?

If you want to make security system in OpenERP(Odoo) follow the below mentioned code and paste it in your ir.model.access.csv file: "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_idea_id...

How to make workflow transitions in OpenERP/Odoo ?

To make workflow transitions in OpenERP/Odoo ? If you want to make workflow transitions in OpenERP(Odoo) follow the below mentioned code and paste it in your workflow_xml file: <record id="trans_idea_draft_confirmed" model="workflow.trans...

How to use __openerp__.py in OpenERP/Odoo ?

The __openerp__.py file has containing list of dependencies,conditioning startup order,data files to load at module install,always load groups first and load access rights after groups. For example code below. {'name' : 'SHIVA', 'version'...

How to use __init__.py in OpenERP/Odoo ?

The __init__.py file is the Python module descriptor, because an OpenERP module is also a regular Python module. 1- Import all files & directories containing python code 2-import idea, wizard, report The __openerp__.py is the OpenERP mo...

How to make typical module structure in OpenERP/Odoo?

In Odoo module is contained in its own directory within the server/bin/addons directory in the server installation. profile_module name, in which we put an empty __init__.py file (as every directory Python imports must contain .py file like in ...

How to use name_get method in OpenERP(Odoo)?

If you want to use name_get method in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: def name_get(self, cr, user, ids, context={}): if not len(ids): return [] res = [] for r in self.read(cr, user, ids, [n...

How to make print a report in OpenERP(Odoo)?

If you want to make print a report in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: - def _get_invoice_id(self, uid, datas): ... return {ids: [...]} ... actions: [_get_invoice_id], result: {type:print,...

How to use transaction_fields in OpenERP(Odoo)?

If you want to use transaction_fields in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: - def name_get(self, cr, user, ids, context={}): if not len(ids): return [] res = [] for r in self.read(cr, user, i...

How to change the main module file in OpenERP(Odoo)?

We will have to remove .py file, rename the class and its attributes to something like below code. from osv import osv, fields class travel_hostel(osv.osv): _name = travel.hostel _inherit = res.partner _columns = { rooms_id: fields.one2...

How to make profile module in OpenERP(Odoo)?

In profile module we have to create a profile, we only have to create a new directory in server/addons and we should call this folder. profile_module name, in which we put an empty __init__.py file (as every directory Python imports must contai...

How to get access right in OpenERP(Odoo)?

If you want to get access right in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: class test_partner_firstname(common.TransactionCase): def setUp(self): super(test_partner_firstname, self).setUp() self.u...

How to use cursor in OpenERP(Odoo)?

When we are using cursor we should use current environment cursor: like below code. self.env.cr except if we need to use threads,we use like below code. Environment.manage(): env = Environment(cr, uid, context) Note- Environment.m...

How to use api.onchange in OpenERP(Odoo)?

Api.onchange will trigger the call to the decorated function if any of the fields specified in the decorator is changed in the form: In below code you can use in your .py file. @api.onchange('fieldx') def do_stuff(self): if self.fieldx == x...

How to use api.depends in OpenERP(Odoo)?

Api.depends will trigger the call to the decorated function if any of the fields specified in the decorator is altered by ORM or changed in the form: In below code you can use in your .py file. @api.depends('name', 'an_other_field') def afun...

How to use api.model in OpenERP(Odoo)?

Api.model will convert old API calls to decorated function to new API signature. It allows to be polite when migrating code. The below code you can use in your .py file . @api.model def afun(self): pass Note- Model.api will automaticall...

How to use api.multi in OpenERP(Odoo)?

With the help of multi api we will be able to set the current RecordSet without iteration. It is the default behavior. In below code i have used search_read function to set the current RecordSet @api.multi def afun(self): len(self) Note-...

How to use api returns in OpenERP(Odoo)?

Api unity of returned value will return a RecordSet of specified model based on original returned value: In below code i have explain api_returns @api.returns('res.partner') def afun(self): ... return x # a RecordSet Note- And if an ...

How to use multi Fields in OpenERP(Odoo)?

The multi function is used to compute multiple values. In below code i have used api.multi to compute multiple values @api.multi @api.depends('field.relation', 'an_otherfield.relation') def _amount(self): for x in self: x.total = an_algo...

How to use selection method in OpenERP(Odoo)?

Its indicate no selection constraint in database. Selection must be set as a list of tuples or a callable that returns a list of tuples In below code i have explain search_read aselection = fields.Selection([('a', 'A')]) aselection = fields...

How to use search_count function in OpenERP(Odoo)

In the search_count function returns the count of results matching search domain: In below code i have explain search_read self.search_count([('is_company', '=', True)]) Note -with the help of this code we retrieve all adress.

How to use search_read in OpenERP(Odoo)?

A search_read function is now available. It will do a search and return a list of dict. In below code i have explain search_read self.search_read([], ['name']) [{'id': 3, 'name': u'Administrator'}, {'id': 7, 'name': u'Agrolait'}, {'id': 43...

How to use search function in OpenERP(Odoo)?

In search function returns directly a RecordSet. In below code i have explain search function. def LinkedIn_check_similar_partner(self, cr, uid, LinkedIn_datas, context=None): res = [] res_partner = self.pool.get('res.partne...

How to use low-level SQL in openERP/Odoo ?

Low level sql is the cursor for the current database transaction and allows executing SQL directly, either for queries which are difficult to express using the ORM For example you can take idea from below code- self.env.cr.execute("some_sql",...

How to use Delegation method in openERP/Odoo ?

The delegation method is performed the reference fields automatically set up on the parent model: For example you can take idea from below code- class Child0(models.Model): _name = 'delegation.child0' field_0 = fields.Integer...

How to use extension method in openERP/Odoo ?

When using _inherit but leaving out _name, the new model replaces the existing one, essentially extending it in-place. This is useful to add new fields or methods to existing models (created in other modules), or to customize or re...

How to use Classical inheritance in openERP/Odoo ?

When using the _inherit and _name attributes together, Odoo creates a new model using the existing one as a base. The new model gets all the fields, methods and meta-information from its base. For example you can take idea f...

How to use Computed fields in openERP/Odoo ?

If you want to Computed fields in OpenERP(Odoo) follow the below mentioned code and paste it in your (Python).py file: upper = fields.Char(compute='_compute_upper', inverse='_inverse_upper', search='_...

How to mapped the records in openERP/Odoo ?

If you want to mapped the records in OpenERP(Odoo) follow the below mentioned code and paste it in your (Python).py file: # returns a list of summing two fields for each record in the set records.mapped(lambda r: r.field1 + r.field2) # retu...

How to use model reference in openERP/Odoo ?

If you want to use model reference in OpenERP(Odoo) follow the below mentioned code and paste it in your (Python).py file: class openerp.models.Model(pool, cr) class user(Model): Note-Above code are created by inheriting from t...

How to use method decorators in openERP/Odoo ?

If you want to use method decorators in OpenERP(Odoo) follow the below mentioned code and paste it in your (Python).py file: model = self.pool.get(MODEL) ids = model.search(cr, uid, DOMAIN, context=context) for rec in model.browse(cr, uid, ...

How to open remote server folder using python?

If you want to open remote server folder using python in OpenERP(Odoo) follow the below mentioned code and paste it in your (Python).py file: def copy_folder(src, dest): if not os.access(dest, os.W_OK): return(False) cmd = ...

How to import customize module in openERP?

If you want to import customize module in OpenERP(Odoo) follow the below mentioned code and paste it in your (Python).py file: import decimal_precision as dp from osv import fields, osv, orm from tools.translate import _ import one2many_so...

How to filter data in OpenERP using domain list?

Its right to call a domain a list of criteria. The point to note here is that each criterion is a triple (either a list or a tuple) of (field_name, operator, value) where: field_name (str) It can be defined as a field name of the current...

Use amount booked in the company currency for conversion into voucher currency in Odoo

To Use amount booked in the company currency in openerp Follow these step to given below Step-1 Install the account_voucher module. Step-2 After that custmozie account_voucher module. In below example, I have custmozied account_voucher modu...

Defining the data model

If you want to make data model in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: session_ids = fields.One2many( 'openacademy.session', 'course_id', string="Sessions") @api.multi def copy...

Domains in Odoo

A domain is a list of criteria, each criterion being a triple (either a list or a tuple) of (field_name, operator, value) where: field_name (str) a field name of the current model, or a relationship traversal through a Many2one utilizing ...

Odoo View inheritance

Instead of modifying existing views in place (by overwriting them), Odoo provides view inheritance where children "extension" views are applied on top of root views, and can add or remove content from their parent. Code like below-> <rec...

Odoo Model inheritance

Odoo provides two inheritance mechanisms to extend an existing model in a modular way. The first inheritance mechanism allows a module to modify the behavior of a model defined in another module: 1. add fields to a model, 2. override...

Relational fields in Odoo

If you want to make relational fields in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: - name = fields.Char(string="Title", required=True) description = fields.Text() responsible_id = fields.Many2...

Relations between models in Odoo

If you want to make relations between models in OpenERP(Odoo) follow the below mentioned code and paste it in your model.py file: - <pre>name = fields.Char(string="Title", required=True) description = fields.Text() class Session(model...
1 7 13
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: