odoo development | how to install, use and create a models

20
SANKALP & DHEERAJ

Upload: habilelabs

Post on 24-Jan-2018

198 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Odoo Development | How to install, use and create a models

SANKALP & DHEERAJ

Page 2: Odoo Development | How to install, use and create a models

WHAT IS ODOO?

• ODOO/ OpenERP is a comprehensive suite which comprises a wide range ofbusiness applications from ERP to CRM, Sales, Manufacturing, School Management,Financial Management and even more.

• ODOO has the support of a dynamic community, is highly flexible and can be easilycustomized as per your needs and it is growing very fast we can’t even think today

Page 3: Odoo Development | How to install, use and create a models

DISTINCT FEATURE’S OF ODOO

• Managing multi-currencies, multi-companies and multi-languages as per requirement.

• Online payment through a different mode of payment acquires.

• Integrated website builder with various themes and extra add-ons

• Integrating different modules likes Sales, HR, Accounting, CRM etc.

• Facilities like Report generation, graphs, charts, invoice creation, email, group messaging etc.

Page 4: Odoo Development | How to install, use and create a models

WHY TO USE IT?

• Open Source- Odoo is an open source project. Being open source, it has a good community thatcan help you build apps with ease.

• Modular- Odoo is highly modular. It is a collection of modules which are integrated together.Modules can be added or removed at any time according to the needs. We can also create ourcustom modules and integrate it with Odoo. Also thousands of modules are present that can beinstalled and used.

• Customizable- Odoo can be customized easily.

• Easy and Faster Development- Building websites with Odoo is a fast and easy process. You canuse existing modules, install them or customize them or you can develop custom modules.Through Odoo your website will be ready in few weeks instead of few months.

Page 5: Odoo Development | How to install, use and create a models

HOW TO INSTALL?

• Go to https://www.odoo.com/page/download

• Fill the form and click download.

• Follow the instructions in installation setup.

Page 6: Odoo Development | How to install, use and create a models

HOW TO USE ODOO ?

Odoo can be customized easily and therefore is helpful in easier and efficientApp development.

Now, we will see how to create views, models and menus through GUI (Odooweb interface).

To start using odoo we must activate the developer mode.

Go to settings menu and click on ‘Activate developer mode’ written on right ofthe screen.

Page 7: Odoo Development | How to install, use and create a models

HOW TO CREATE MODELS?

• After activating developers option in settings, go to the views option (Technical -> DataStructure-> Models).

• Click create button. Then Enter model description and name (‘x_’ indicates that model iscustom so, append model’s name with it) and add fields of your choice by clicking ‘Add anitem’ in the list below.

• To create a field enter field name (appending name with already present ‘x_’), label (name tobe used when fields are listed in a list or a form etc.), field type, choose base properties asdesired and click save.

• Make as many fields as desired and click save.

Page 8: Odoo Development | How to install, use and create a models

HOW TO CREATE VIEWS?

• Go to the views option (Technical -> User Interface -> Views).

• Click create button. Then Enter view name, sequence (number indicating priority of the view,can be left as it is), view Type (according to the layout of the page), model name (can benewly created or can be selected from the ones already created). Definitions of type of viewscan be seen at link: https://www.odoo.com/documentation/8.0/reference/views.html.

• Enter Architecture code for the view. For example: - Tree type view-

To be continued…

Page 9: Odoo Development | How to install, use and create a models

<tree string='Registered Students'>

<field name='x_name'/>

<field name='x_class'/>

<field name='x_age'/>

<field name='x_phone'/>

<field name='x_email'/>

<field name='x_street'/>

<field name='x_city'/>

<field name='x_state'/>

<field name='x_country'/>

</tree>

• Fields are the fields present in the model, field name must be same as was in the model.

• Click save.

This will create a row in specified table(model) with specified data.

Page 10: Odoo Development | How to install, use and create a models

HOW TO CREATE MENUS?

• Go to menu (Technical -> Menu Items -> Menus).

• Click create. Then enter menu name (to be shown in the top bar), sequence (priority of themenu item which decides its position in the list), parent menu (leave blank) and action (selectir.actions.act_window and then select an action from the generated list or create a new one).

• ir.actions.act_window this denotes a window action by which our menu will be opened.

• To create a new action, select ‘create and edit’. Enter action name, external id object (entername of the model), select an option from target window (example: - Current Window (toopen view in the current window) ). Now, select view type (same as view type of the page),view mode (make it same as view type) and view ref (name of the view to be attached to thismenu item). Click save.

• (Back to our menu), the created action will be selected and we can now save our menu.

• Refresh the page and our menu item will occur in the top menu bar.

Page 11: Odoo Development | How to install, use and create a models

SECURITY IN ODOO

• Odoo provides four levels of security

• Model level

• Record(Row) level

• Field level

• View level

All levels are discussed in subsequent slides.

Page 12: Odoo Development | How to install, use and create a models

MODEL LEVEL

• Access to data/model can be set through settings Security Access List Control. Click Create and enter Name, object (model name), group and tick the rights you want give to that group of users for that model. If you want certain permissions to be there for all users then leave the group field blank.

• You can also give access permissions in models from ‘Access Rights’ tab.

Page 13: Odoo Development | How to install, use and create a models

RECORD LEVEL

• Record level security can be achieved by writing record rules. Record rules consists of a Name, anobject(model) for which the rule will work, Permissions against which record rule is checked, a domainfilter (actual rule/ condition through which records are filtered) and groups for which record rule willwork.

• A domain filter a condition by which rows are filtered. It has three arguments

• Left side- Fields from the model(for which record rule is being made)

• Operator- can be any of the following operator

• Like, not like, =like, ilike, not ilike, =ilike, =?, in, not in, =, !=, child_of, <, >, <=, >=

• Right side- value to which the right side is matched through an operator(only user object is available on thisside)

Syntax- [( ‘ left_side ’, ‘operator’, right_side )]

Page 14: Odoo Development | How to install, use and create a models

FIELD LEVEL

• Field level security can be achieved in two ways. First, while creating fields(in models) andgiving group names for which the field will be visible in ‘Access Rights’ tab.

• Second in views. In views use ‘groups’ attribute on a field to secure it, for example- addattribute groups=’base.group_ABC’ to a field to make it visible for the users of group‘base.group_ABC’ only.

Here, base.group_ABC is an external identifier for a group.

Page 15: Odoo Development | How to install, use and create a models

HOW TO MAKE AN EXTERNAL IDENTIFIER?

• Go to Settings Sequences and Identifiers External Identifiers and click create. EnterModule name, identifier, model(for which we are making this identifier eg: - res.groups isused to make identifier ‘group_ABC’ or ir.ui.view is used to make identifier for a view) andrecord ID( id of record in model for which identifier is being made eg: - 42 is record id ofgroup for which identifier is group_ABC in res_groups model)

• External identifiers are used as module_name.identifier_name

Page 16: Odoo Development | How to install, use and create a models

VIEW LEVEL

• View level security means which users can see which view or which page. Viewlevel access can be set from view form. While creating views go to the ‘AccessRight’ tab and add groups for which you want show the view.

Page 17: Odoo Development | How to install, use and create a models

IF YOU STILL DIDN’T GET WHAT IS ODOO

Page 18: Odoo Development | How to install, use and create a models

So, we’ve learned, what actually is Odoo and what are its key features, alongwith that we’ve also got the basic knowledge of how to create models, views,menus.

I hope this was very helpful for you. In case of any query or doubt do commentin the comment section given below.

Page 19: Odoo Development | How to install, use and create a models

CONTACT US

• Development Center :Habilelabs Pvt. Ltd.4th Floor, I.G.M. Senior Secondary Public School Campus,Sec-93 Agarwal Farm, Mansarovar, Jaipur(Raj.) – 302020

• Email : [email protected]

• Web : http://www.habilelabs.io/

• Telephone: +91-9828247415 / +91-9887992695

Page 20: Odoo Development | How to install, use and create a models

THANK YOU