Featured
-
Function calling on button click in OpenERP
Adding a button on an OpenERP view is very easy an
by dinesh.singh
Tags
How to create wizard resource and return the action in OpenERP
In OpenERP when creating the wizard resource than the action of form is returned so agian we have to create the users and relate it to wizard resourse and also clicks the init icon in the web client than retrieve translated version of wizard'...
Apply mutations on the user's saved selection and report back to the client in OpenERP
In OpenERp we first create report of the client and apply mutations on the user's saved selection of the search domain to be processed. The domain is only processed if no ids are present. If both domain and ids are missing, this will lead to ...
How to create Opens Wiki Page of Group in OpenERP
In OpenERP to create opens wiki page first you have to create the current row and than the current user’s ID for security checks. user ID find List of open wiki group’s IDs and also maps the dictionary of open wiki window on giv...
How to create print template of the survey in OpenERP
In openerp to create print template of the survey means that first check response or survey and if response is available then print this response otherwise print survey form and the current row, from the database cursor and also the current user&...
How to create Picking List when planned date if it is greater than value in OpenERP
To create the picking list of User defined argument and to the calculates planned date if it is greater than value and than if condition is true and its also user defined argument so you have to validate the Name of field and also Value of field ...
How to Compute stock value and stock quantity in product stock in OpenERP
When we create the product(real and virtual) and computes the stock value and quantity of product in stock and validate than the product(real and virtual) is also maintained in the stock and updated in warehouse and also returns the dic...
Creating automated actions in Odoo
If you want to create automated action in odoo, you have to go in .xml file and decide the action menu.
1- The first step is to create a model and to create some fields on this model->
class test_demo(models.Model):
_name ...
Add an explicit onchange to warn about invalid values in Odoo9
Onchange is the most important function for Odoo. similar to a negative number of seats, or more participants than seats. For example you can see below code.
r.taken_seats = 0.0
else:
r.taken_sea...
Onchange in Odoo9
Onchange is the most important function for Odoo. The "onchange" mechanism provides a method for the client interface to update a form at the time when the user filled a value in a field, without saving anything to the database.
For example you ...
Create a report for the Session model in Odoo9
If you want to create a report for the Session mode follow the below code in your Odoo module. And for each session, it should display session's name, its start and end, and list the session's attendees.
openacademy/__openerp__.py
...
Register attendees to multiple sessions in Odoo9
If you want to register attendees to multiple sessions follow the below code in your Odoo module.
<group>
<field name="session_ids">
<field name="attendee_ids...
view for the wizard. in Odoo9
View for wizard is used to show the value in current database, add buttons to the wizard and implement the corresponding method for adding the attendees to the given session.
For example you can see below code.
...
Launching wizards in Odoo9
Launching wizards is use to show the view of any project in Odoo and using an ir.actions.act_window record like above, but with an extra field src_model which specifies that in the context of which model the the action is available. The wizard wi...
Wizards in Odoo9
Wizards is used to show the view of any project in Odoo and the interactive sessions with user (or dialog boxes) through dynamic forms is also described by Wizards. A wizard is simply a model that extends the class TransientModel instead of Model...
Generic view declaration in odoo9
Generic view declaration is most important part of Odoo module. Here a view is declared as a record of the model ir.ui.view. The view type is implied by the root element of the arch field.
For example code is below.
<record ...
Display Content in odoo9
As in my previous blog display content in OpenERP/Odoo the same process will we followed for odoo9, and they are:-
Widgets have a number of methods and features, but the basics are simple:
1. set up a widget
2. format the widget's data
3. d...
Widgets Basics in odoo9
Widgets are most powerful workstation and the Odoo web client bundles jQuery for easy DOM manipulation. It is useful and provides a better API then standard W3C DOM2, but it is insufficient to structure complex applications which l...
Delegation in odoo9
Delegation is most important for odoo module, it is the third inheritance mechanism which provides more flexibility (it can be altered at runtime) but less power: using the _inherits a model delegates the lookup of any field n...
Inheritance and extension in odoo9
Inheritance and extension in odoo9 is used to set one page to another page and Odoo provides three different mechanisms to extend models in a modular way.
1. creating a new model from an existing one, adding new information to the copy but leavi...
Automatic fields in odoo9
Automatic fileds used to set onchange function and operation is given below
id
Identifier field
_log_access
Whether log access fields (create_date, write_uid, ...) should be generated (default: True)
create_date
Date at wh...
Environment swapping in odoo9
Environment swapping is most important for odoo module and with_context([context][, **overrides]) records[source]
It Returns a new version of this recordset attached to an extended context.
The extended context is either the provided cont...
Recordset operations in odoo9
Recordset operations is used to make ids and function in Odoo module. The operation are given below.
ids
List of actual record ids in this recordset (ignores placeholder ids for records to create)
ensure_one()
Verifies that the current recors...
Research in odoo9
Research used to Searches for records based on the args search domain.
args -- A search domain. Use an empty list to match all records.
offset (int) -- number of results to ignore (default: none)
limit (int) -- ...
CRUD in odoo9
Crud used to creates a new record for the model.
The new record is initialized using the values from vals and if necessary those from default_get()..
browse([ids]) records:
Returns a recordset for the ids provided as parameter ...
Model Reference in odoo9
Model reference is used with main super-class for regular database-persisted OpenERP models.
OpenERP models are created by inheriting from this class. For example you can see below code.
class user(Model):
...
openerp.oepetstore = funct...
Method decorators in odoo9
Method decorators is most important part of the Odoo, it method decorators provides the elements for managing two different API styles, which is "traditional" and "record" styles.
In the "traditional" style, parameters like the database cursor, ...
How to generates and returns pdf version of a report in openerp?
In openerp you make a request to read the assets while the transaction creating is not done and As the assets are generated during the same transaction and the rendering of the templates will call them. There is a scenario where the assets are un...
How to generates and returns html version of a report in openerp
In openerp If the report is using a custom model to render its html and fallback on the generic html rendering. report is generates and returns html version of a new report.
use this function in your own module in .py file,
def get_html(...
How to create and Allow to render a QWeb template python-side openerp
In openerp render function returns the 'ir.ui.view' but embellish it with some variables/methods used in reports. param values is additional methods/variables used in the rendering returns is html representation of the template.
use this code sh...
How to Register the given presence of the current user in openerp
In openerp register the given presence of the current user, and trigger a im_status change if necessary. The status will not be written or sent if not necessary and param user_presence : True, if the user (self._uid) is still detected using its b...
How to Disconnect the users having a too old last_poll in openerp
In openerp to disconnect user and show the massage that user is disconnected and users having to old last_pool and search the limit date and write the status presences when presences is offline.
use this function .py file show in given below,
...
How to get previous date of date in openerp
In openerp first install the resource module and inherit the object of resource.calendar and If no calendar is provided, just return the previous day and day of a resource.calendar. If calendar resource is no given simply remove one day from the ...
How to generate the barcode for product in Odoo9 ?
Barcode is the most important part of point dale module its indicate the unique number of any product in stocks. So you will need the following kind of python code declaration in your .py file:
from openerp.osv import fields, orm
from opener...
How Utility method removes leave intervals from a base interval in openerp
In openerp It will first clean the leave intervals, to have an ordered list of not-overlapping intervals and initiate the current interval to be the base interval then before finishing skip the current interval and go to next beginning after the ...
Related fields in Odoo-9
Related is used to define value of a related field which is given by following a sequence of relational fields and reading a field on the reached model. The complete sequence of fields to traverse is specified by the attribute and records.
Exam...
Computed fields in Odoo-9
The reason of computed fields is been used is because it defines a filed whose value is computed rather then simply being read from the database.
Below are the attributes that are specific to computed fields. To define such a field, simply provi...
compute in Odoo-9
compute value is used to show the res.partner value and return a decorator that specifies the field dependencies of a "compute" method (for new-style function fields). Each argument must be a string that consists in a dot-separated sequence of fi...
Method decorators in Odoo-9
If you want to show the database value and In the "traditional" style you can use method decorators.
Here parameters like the database cursor, user id, context dictionary and record ids (usually denoted as cr,uid, context, ids) a...
Listing of record fields in Odoo9
When we are using list records field then it returns a large amount of meta-information (client programs also use list records field) which should be filtered before printing, string(the field's label) are the most interesting items for a human u...
Read records in Odoo9
When we face any issue in database records value at that situation we use read records value and record data is accessible with the read() method, which takes a list of ids (as returned bysearch()) and optionally a list of fields to fet...
Count records in Odoo9
Count record show the records value of database and retrieve a list of records and count them, search_count() can be used to retrieve only the number of records matching the query. It takes the same domainfilter as search()&nb...
Paginations in Odoo9
Paginations is the most important for odoo framework and its help to produce the inventory value of database and By default a search will return the ids of all records matching the condition, which may be a huge number. offset and ...
List records in Odoo9
List reord is the most important part of Odoo data base with the help of list records we can manage all database in odoo framework and search() takes a mandatory domain filter and returns the database identifiers of all records mat...
Calling methods in Odoo9
With the help of call method we have to create xmlrpc/2/object, it is used to call methods of odoo models and send value in database.
For example you can see below code and use in your odoo module.
models = xmlrpclib.ServerProxy('{}/xmlrpc/2/...
How to Dispatch postgres notifications to the relevant polling threads and greenlets in openerp
In openerp Dispatch PostgreSQL notifications to the relevant polling threads to Bus.loop listen imbus on db PostgreSQL and create the listen imbus and check the condition dispatch to local threads and greenlets in channel.
Example
use this code...
How to handle a longpolling request in openerp
In openerp to handle a long-polling request, we need to bypass private attribute access because we do not know before starting that the thread and handles a long-polling request and rename the thread to avoid tests waiting for a long-polling.
Ex...
Computed fields in Odoo9
Computed fields indicates many2one and one2many filed in selection filed . For example you can see below code in you .py file .
test = fields.Char(compute='_compute_upper',
inverse='_inverse_test',
sea...
Environment in Odoo9
Environment is the most important part of set in any framework.its indicates stores various contextual data used by the ORM method . For example you can see below code in you .py file .
@api.multi
... @api.returns('self')
... def demo_method...
Convert the amount in company currency using the currency rate and voucher conversion in openerp
To convert the amount in company currency using the currency rate and voucher conversion in openerp.
use this function def _convert_amount in .py file in account voucher module in openerp
def _convert_amount(self, cr, uid, amount, voucher_id,...
How to Add followers linked to new partner in Odoo9 ?
In followers linked to new partner fields first we have to go in .py file (Python file) After that we have to decide where we want followers linked to new partner fields and then write start to end python code to that field.Use below .py code in ...