Archive

Archive for the ‘XML’ Category

OpenERP Training in Pakistan from NUST, Islamabad (Non OpenERP Partner)

February 9, 2012 8 comments

Dear Viewers,

NUST offering OpenERP training. NUST is one of the ‘TOP 100 UNIVERSITIES IN ASIA’ and one of the best educational industry in Pakistan. NUST have 16-18 schools of different areas in Pakistan including capital cities.

This workshop has been designed for both IT Professionals and people from Management background who would like to explore how HRM can be effectively managed through an open source ERP solution. The workshop is also beneficial for IT and Management students to know about state of the art in ERP solutions deployment and its related challenges.

Please Follow the details from given advertisement.

Registration: http://www.seecs.nust.edu.pk/openerp

Contact With:

SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE

A center of excellence for quality education and research

Sector H-12 Islamabad Tel: 051 9085 2400 Fax: 051 8317363 info@seecs.nust.edu.pk  www.seecs.nust.edu.pk  www.nust.edu.pk

Advertisements

OpenERP many2many Domain Filtering Example

September 29, 2011 2 comments

Class 1:

class cms_program_specialization_type(osv.osv):
    _name = 'cms.program.specialization.type'
    _columns = {
        'name': fields.char('Specialization Type',size=100,required=True),
    }
cms_program_specialization_type()

Class 2:

class cms_program_specialization(osv.osv):
    _name = 'cms.program.specialization'
    _columns = {
        'name': fields.char('Specialization',size=100,required=True),
        'specialization_type': fields.many2one('cms.program.specialization.type', 'Specialization Type', required=True),
    }
cms_program_specialization()

 

 

Class 3: This is the object where many2many is define:

class cms_course(osv.osv):
    _name = 'cms.course'
    _columns = {
        'name': fields.char('Course Name',size=300,required=True),
        'taught_in_specialization_main': fields.many2one('cms.program.specialization.type','Main Specialization'),
        'taught_in_specialization_detail': fields.many2many('cms.program.specialization', 'tbl_course_in_specialization_rel', 'course_id', 'specialization', 'Course Taught in', required=True),
    }
cms_course()

Now the for view of object cms.course where domain filter is used

    <record model="ir.ui.view" id="view_cms_course_form">
        <field name="name">cms.course.form</field>
        <field name="model">cms.course</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="cms.course">
                <field name="name"/>
		<field name="taught_in_specialization_main"/>
		<field name="taught_in_specialization_detail" colspan="4" domain="[('specialization_type','=',taught_in_specialization_main)]"/>
            </form>
        </field>
    </record>
Categories: OpenERP, Python, XML

HRDC Survey(Statistical Analysis) Project in OpenERP

July 6, 2011 5 comments
Project :
Third Party Validation of Performance of PTCs of Khyber Pakhtoonkhwa Pakistan
 
Project Assigned By:
Education Department of Khyber Pakhtoonkhwa Pakistan
 
Project Assigned To:
HRDC, IMSciences Peshawar Pakistan
 
Project Field Work Domain:
All Schools of Khyber Pakhtoonkhwa Pakistan (No of Sample Schools 5400)
 
Software for Statistical Analysis and Its Reporting:
First Time OpenEPR used as Statistical Analysis Software and for its Statistical Reporting
 
Software Tools Used:
OpenERP Framework, Python, Postgresql, PDF & MSExcel and Linux platform as OS
 
First Time OpenERP for Statistical Analysis and Its Reporting:
First Time OpenERP is used for strong statistical analysis and its reporting.  Approximately 89 users entered 5400 schools data using OpenERP interface from different terminals.Each school have 5 different survey forms i.e. Auditors Form, EDO Form, Secretary Form and Member Council Form.Each form has 40-50 different questions representing school different area of functionality, Physical Infrastructure, Financial Position, Teacher & Students Attendance, Parents & Teachers meeting, Meeting Agenda & its implementation rate  and much more.
 
Overview of Modules Developed in OpenERP for Statistical Analysis
 There are two modules developed for this project
  1. Hrdc
  2. Hrdc_reporting
  • Module hrdc includes objects, tree views, forms views, update data files, wizards, menus and security rights files.
  • Module hrdc_reporting includes 15 different statistical reports (including summary and details). These reports first print in pdf and we also export these report in MSExcel for report writing purpose.
OpenERP Developed Module Demonstration for Statistical Analysis 
•Module hrdc_reporting includes summary and detail (district level) reports, these reports extract from 5400 schools information ( each school have 4 different survey forms).
•These reports includes heavy statistical calculation and shows the situation of different area of functionality, Physical Infrastructure, Financial Position, Teacher & Students Attendance, Parents & Teachers meeting, Meeting Agenda & its implementation rate  and much more.
 
Statistical Reports in MSExcel 
•These all reports are also print in excel format for final report writing purpose.
•Final report presents to Education Department of Khyber Pakhtoonkhwa Pakistan.
 
HRDC Survey Project in OpenERP 1
 
 
 
HRDC Survey Project in OpenERP 2
 
 
 
HRDC Survey Project in OpenERP 3
 

XPath (libxml2) in Python

February 3, 2011 5 comments


Step 1: Install libxml2 using synaptic package manager

Step 2: Create an xml file that you want to traverse.

For example I am using w3school’s xml document http://www.w3schools.com/xpath/books.xml.
We can also use the local file exist on file system.

Step 3: Create a python for example having name xpathcode.py

Open the xpathcode.py import the libxml2 and urllib. Parse the xml file.

import libxml2
import urllib
rss=libxml2.parseDoc(urllib.urlopen('http://www.w3schools.com/xpath/books.xml').read())

Read more…

Categories: Python, XML, XPath

OpenERP Module Development Wizard

January 28, 2011 19 comments

Today we develop simple wizard call from menu item click. This wizard simply receive the value in text box, and using this value, will change the current user password.

Step 1: Create a folder (e.g. having name abc).

Step 2: Create a file abc_view.xml in abc folder.

Step 4: Write a wizard code  in abc_view.xml like below (also create the __init__.py and  __terp__.py  files i am assuming you create both of these files correctly).

<wizard
string="Change Password"
model="res.users"
name="abc.user.password"
menu="False"
id="wizard_abc_password"/>

Step 5: Write a menu item code in abc_view.xml, set the action attribute of menu item with the wizard id like below

<menuitem
name="Main Menu/User/Change Password"
id="menu_abc_password"
type="wizard"
action="wizard_abc_password"/>

Read more…

Categories: OpenERP, Python, XML

Hire Purchase: Module Development example in openerp 5.0.0.1

December 14, 2010 20 comments

In this tutorial, I will share how module develops in openerp. First I will explain the functionality of hire purchase (what we are going to develop), second I will develop hire purchase module in openerp. A simple explanation of hire purchase module is sale of goods in installment. In my example, I will ignore the interest portion of hire purchase. I just spread the price of good in number of monthly installment. I can say that, this module is a demo version of hire purchased without installment. In future I will extend this module with interest. In this tutorial I will focus on step by step development of module in openerp.
What hire purchase is read out the wiki about hire purchase, for detail of hire purchase also read wikieducator.

In this tutorial I will cover; how to create openerp objects (in .py file), interaction with object using openerp views (tree and form), openerp wizards and menuitem.

Step 1:

Create the following files and folders.

a. Folder having named ‘hirepurchase’ and 2nd folder having name ‘wizard’ in ‘hirepurchase’ folder.

b. Create the files in hirepurchase folder, i.e. __init__.py, __terp__.py, hirepurchase_view.xml and hirepurchase.py.

c. Create the files in wizard folder, i.e. __init__.py and wizard_pay_hirepurchaseinvoice.py

File structure: hirepurchase folder contains one folder (wizard) and four files (__init__.py, __terp__.py, hirepurchase_view.xml and hirepurchase.py). Wizard folder contains two files (__init__.py and wizard_pay_hirepurchaseinvoice.py)

Read more…

Modules Development in OpenERP: View, Events, Menu and Actions

October 6, 2010 30 comments

In this tutorial I will explain the syntax of views, events, menus and actions in openERP with some examples.
For detail we can check the documentation of design elements in openERP from
http://doc.openerp.com/developer/2_6_views_events/views/design_element.html

List of syntax and examples of different control in OpenERP
1. View file in OpenERP
2. Button in OpenERP
3. Menu Item in OpenERP
4. Tree View in OpenERP
5. Form View in OpenERP
6. View Action in OpenERP
7. Complete form view in OpenERP

1. View file in openERP
a. XML Declaration
b. OpenERP body tag

Syntax:

<?xml version="1.0" encoding="${encoding}"?>
<openerp>
    <data>
    	[view definitions]
    </data>
</openerp>

Read more…