SlideShare uma empresa Scribd logo
1 de 66
Baixar para ler offline
OpenERP and Perl
  Jon	
  Allen	
  (JJ)	
  –	
  jj@opusvl.com	
  
OpenERP

       www.opusvl.com!
enterprise"
 resource"
 planning
          www.opusvl.com!
?
     www.opusvl.com!
core business"
 applications
           www.opusvl.com!
sales crm"
manufacturing"
 purchasing
           www.opusvl.com!
accounting

         www.opusvl.com!
integrated
accounting
         www.opusvl.com!
www.opusvl.com!
Perl?

         www.opusvl.com!
OpenERP

website

          intranet



                        www.opusvl.com!
api

       www.opusvl.com!
XML-RPC

       www.opusvl.com!
single"
requests
        www.opusvl.com!
stateless

         www.opusvl.com!
object"
model
          www.opusvl.com!
relationships

           www.opusvl.com!
res.partner.address


                one2many
res.partner


     many2one
                   res.company


                             www.opusvl.com!
database

        www.opusvl.com!
ORM

       www.opusvl.com!
object"
relational"
 mapper
          www.opusvl.com!
OOM

       www.opusvl.com!
object to"
 object"
mapper
         www.opusvl.com!
OpenERP::OOM

         www.opusvl.com!
Moose

         www.opusvl.com!
object model

          www.opusvl.com!
Schema



Class      Class    Class



Object     Object



     OpenERP


                      www.opusvl.com!
# Code layout for module using OpenERP::OOM	

lib/	
    MyApp.pm    # Schema definition	
    MyApp/	
        Class/           # Class definitions	
             Company.pm	
             Partner.pm	
        Object/          # Object definitions	
             Company.pm	
             Partner.pm	


                                  www.opusvl.com!
schema

      www.opusvl.com!
# MyApp.pm	

package MyApp;	

use Moose;	
extends 'OpenERP::OOM::Schema';	

1;	


                         www.opusvl.com!
connection

         www.opusvl.com!
use MyApp;	

my $schema = MyApp->new(	
    openerp_connect => {	
        host     => 'localhost',                	
        dbname   => 'jj_test_1',                	
        username => 'admin',            	
        password => 'admin',     	
    },	
);	

                              www.opusvl.com!
classes

           www.opusvl.com!
# MyApp/Class/Company.pm	

package MyApp::Class::Company;	
use OpenERP::OOM::Class;	

object_type 'MyApp::Object::Company';	

# Class methods go here	

1;	


                                  www.opusvl.com!
objects

           www.opusvl.com!
fields

         www.opusvl.com!
relationships

           www.opusvl.com!
partner"
has many"
addresses
        www.opusvl.com!
package MyApp::Object::Partner;	
use OpenERP::OOM::Object;	

openerp_model 'res.partner';	
has 'name' => (isa=>'Str', is=>'rw');	

relationship   'addresses' => (    	
    key   =>   'address',    # OpenERP field 	
    type =>    'one2many',   # OpenERP type 	
    class =>   'PartnerAddress',	
);	


                                    www.opusvl.com!
object "
creation
        www.opusvl.com!
# Schema -> Class -> Class Method	

my $partner = $schema->class('Partner')->	
              create({ name => 'JJ' });	

# Updates	

$partner->update({name => 'Jon Allen'});	
say $partner->name;	




                                www.opusvl.com!
search

          www.opusvl.com!
# Single result	

my $jj = $schema->class('Partner')->	
         find(['name' => '=' => 'JJ']);	

# Multiple results	

my @partners = 	
   $schema->class('Partner')->	
   search(['name' => 'like' => 'J']);	

                              www.opusvl.com!
related"
objects
           www.opusvl.com!
$partner->create_related(	
    'addresses',	
    {	
        name   => '...',	
        street => '...',	
        city   => '...',	
    }	
);	


                         www.opusvl.com!
add"
methods
       www.opusvl.com!
extend
OpenERP
 objects
        www.opusvl.com!
external"
data sources
          www.opusvl.com!
DBIx::Class

         www.opusvl.com!
not just"
 data
            www.opusvl.com!
OpenERP"
methods
       www.opusvl.com!
workflows

       www.opusvl.com!
integrated"
accounting
         www.opusvl.com!
my $po = $schema->class('PurchaseOrder')->	
         search([ ... ]);	

$po->update({ ... });	

# Approve purchase order	
$po->execute_workflow('purchase_confirm');	

# Print (returns PDF)	
$po->get_report('purchase.order');	



                                www.opusvl.com!
application
logic = Perl
          www.opusvl.com!
application"
data = DBIC
          www.opusvl.com!
generic logic "
= OpenERP
            www.opusvl.com!
generic data "
= OpenERP
           www.opusvl.com!
many uses

        www.opusvl.com!
Catalyst model

           www.opusvl.com!
18 months"
development
         www.opusvl.com!
3 commercial"
deployments
          www.opusvl.com!
open sourced"
   today
          www.opusvl.com!
http://search.cpan.org/
 dist/OpenERP-OOM


                  www.opusvl.com!
questions?

         www.opusvl.com!
www.opusvl.com!

Mais conteúdo relacionado

Mais procurados

Put a Button on It: Removing Barriers to Going Fast
Put a Button on It: Removing Barriers to Going FastPut a Button on It: Removing Barriers to Going Fast
Put a Button on It: Removing Barriers to Going Fast
OSCON Byrum
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development Environments
Beau Lebens
 
Ruby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails frameworkRuby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails framework
Pankaj Bhageria
 

Mais procurados (20)

Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
 
Put a Button on It: Removing Barriers to Going Fast
Put a Button on It: Removing Barriers to Going FastPut a Button on It: Removing Barriers to Going Fast
Put a Button on It: Removing Barriers to Going Fast
 
Php converted pdf
Php converted pdfPhp converted pdf
Php converted pdf
 
Ppt php
Ppt phpPpt php
Ppt php
 
Building web framework with Rack
Building web framework with RackBuilding web framework with Rack
Building web framework with Rack
 
Powershell to the People #suguk
Powershell to the People #sugukPowershell to the People #suguk
Powershell to the People #suguk
 
Advanced WordPress Development Environments
Advanced WordPress Development EnvironmentsAdvanced WordPress Development Environments
Advanced WordPress Development Environments
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 
Doing Things the WordPress Way
Doing Things the WordPress WayDoing Things the WordPress Way
Doing Things the WordPress Way
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
Ruby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails frameworkRuby conf 2011, Create your own rails framework
Ruby conf 2011, Create your own rails framework
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Introduction to plugin development
Introduction to plugin developmentIntroduction to plugin development
Introduction to plugin development
 
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST APIWordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
WordCamp Ann Arbor 2015 Introduction to Backbone + WP REST API
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
 
Ruby On Rails Introduction
Ruby On Rails IntroductionRuby On Rails Introduction
Ruby On Rails Introduction
 
Modernizing Legacy Applications in PHP, por Paul Jones
Modernizing Legacy Applications in PHP, por Paul JonesModernizing Legacy Applications in PHP, por Paul Jones
Modernizing Legacy Applications in PHP, por Paul Jones
 
doing_it_right() with WordPress
doing_it_right() with WordPressdoing_it_right() with WordPress
doing_it_right() with WordPress
 

Destaque

Phrase based Indexing and Information Retrieval
Phrase based Indexing and Information RetrievalPhrase based Indexing and Information Retrieval
Phrase based Indexing and Information Retrieval
Bala Abirami
 
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
Elena Williams
 

Destaque (17)

YASPS OPENNING
YASPS OPENNINGYASPS OPENNING
YASPS OPENNING
 
CPAN Dependency Heaven
CPAN Dependency HeavenCPAN Dependency Heaven
CPAN Dependency Heaven
 
Phrase based Indexing and Information Retrieval
Phrase based Indexing and Information RetrievalPhrase based Indexing and Information Retrieval
Phrase based Indexing and Information Retrieval
 
Perl
PerlPerl
Perl
 
Creating Perl modules with Dist::Zilla
Creating Perl modules with Dist::ZillaCreating Perl modules with Dist::Zilla
Creating Perl modules with Dist::Zilla
 
The Malaysian Government Interopersbility Framework For Open Source Software ...
The Malaysian Government Interopersbility Framework For Open Source Software ...The Malaysian Government Interopersbility Framework For Open Source Software ...
The Malaysian Government Interopersbility Framework For Open Source Software ...
 
Enterprise Content Management 101 for Government
Enterprise Content Management 101 for GovernmentEnterprise Content Management 101 for Government
Enterprise Content Management 101 for Government
 
Open Source for Government - PSEICT Conference - British Council Case Study u...
Open Source for Government - PSEICT Conference - British Council Case Study u...Open Source for Government - PSEICT Conference - British Council Case Study u...
Open Source for Government - PSEICT Conference - British Council Case Study u...
 
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
The Hitchhikers' Guide to Free and Open Source Software Development (CompCon ...
 
Best practices gov oss collab
Best practices gov oss collabBest practices gov oss collab
Best practices gov oss collab
 
Case Study
Case StudyCase Study
Case Study
 
The Flexibility of Open Source: A Case Study of a large Corporate Intranet
The Flexibility of Open Source: A Case Study of a large Corporate IntranetThe Flexibility of Open Source: A Case Study of a large Corporate Intranet
The Flexibility of Open Source: A Case Study of a large Corporate Intranet
 
A pioneer open source software development Company | Redian Software
A pioneer open source software development Company | Redian SoftwareA pioneer open source software development Company | Redian Software
A pioneer open source software development Company | Redian Software
 
Open source software development
Open source software developmentOpen source software development
Open source software development
 
Open Source and Economic Development
Open Source and Economic DevelopmentOpen Source and Economic Development
Open Source and Economic Development
 
Open Source Software Development by TLV Partners
Open Source Software Development by TLV PartnersOpen Source Software Development by TLV Partners
Open Source Software Development by TLV Partners
 
Alfresco Day Benelux Inholland studentendossier
Alfresco Day Benelux Inholland studentendossierAlfresco Day Benelux Inholland studentendossier
Alfresco Day Benelux Inholland studentendossier
 

Semelhante a OpenERP and Perl

Socket applications
Socket applicationsSocket applications
Socket applications
João Moura
 
Dirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP ExtensionDirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP Extension
Adam Trachtenberg
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Muhamad Al Imran
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Muhamad Al Imran
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Paulo Ragonha
 
Web aplikāciju izstrāde ar Ruby on Rails un Oracle DB
Web aplikāciju izstrāde ar Ruby on Rails un Oracle DBWeb aplikāciju izstrāde ar Ruby on Rails un Oracle DB
Web aplikāciju izstrāde ar Ruby on Rails un Oracle DB
Raimonds Simanovskis
 

Semelhante a OpenERP and Perl (20)

PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
 
Ams adapters
Ams adaptersAms adapters
Ams adapters
 
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram ArnoldEfficient Rails Test Driven Development (class 3) by Wolfram Arnold
Efficient Rails Test Driven Development (class 3) by Wolfram Arnold
 
Crossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end FrameworkCrossing the Bridge: Connecting Rails and your Front-end Framework
Crossing the Bridge: Connecting Rails and your Front-end Framework
 
PHP Basic
PHP BasicPHP Basic
PHP Basic
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
SproutCore and the Future of Web Apps
SproutCore and the Future of Web AppsSproutCore and the Future of Web Apps
SproutCore and the Future of Web Apps
 
Ruby/Rails
Ruby/RailsRuby/Rails
Ruby/Rails
 
Dirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP ExtensionDirty Secrets of the PHP SOAP Extension
Dirty Secrets of the PHP SOAP Extension
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
(BDT402) Performance Profiling in Production: Analyzing Web Requests at Scale...
 
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
Php i basic chapter 3 (syahir chaer's conflicted copy 2013-04-22)
 
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
Php i basic chapter 3 (afifah rosli's conflicted copy 2013-04-23)
 
Php i basic chapter 3
Php i basic chapter 3Php i basic chapter 3
Php i basic chapter 3
 
(APP202) Deploy, Manage, and Scale Your Apps with AWS OpsWorks and AWS Elasti...
(APP202) Deploy, Manage, and Scale Your Apps with AWS OpsWorks and AWS Elasti...(APP202) Deploy, Manage, and Scale Your Apps with AWS OpsWorks and AWS Elasti...
(APP202) Deploy, Manage, and Scale Your Apps with AWS OpsWorks and AWS Elasti...
 
(APP202) Deploy, Manage, Scale Apps w/ AWS OpsWorks & AWS Elastic Beanstalk |...
(APP202) Deploy, Manage, Scale Apps w/ AWS OpsWorks & AWS Elastic Beanstalk |...(APP202) Deploy, Manage, Scale Apps w/ AWS OpsWorks & AWS Elastic Beanstalk |...
(APP202) Deploy, Manage, Scale Apps w/ AWS OpsWorks & AWS Elastic Beanstalk |...
 
Isomorphic App Development with Ruby and Volt - Rubyconf2014
Isomorphic App Development with Ruby and Volt - Rubyconf2014Isomorphic App Development with Ruby and Volt - Rubyconf2014
Isomorphic App Development with Ruby and Volt - Rubyconf2014
 
Xopus Application Framework
Xopus Application FrameworkXopus Application Framework
Xopus Application Framework
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
Web aplikāciju izstrāde ar Ruby on Rails un Oracle DB
Web aplikāciju izstrāde ar Ruby on Rails un Oracle DBWeb aplikāciju izstrāde ar Ruby on Rails un Oracle DB
Web aplikāciju izstrāde ar Ruby on Rails un Oracle DB
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

OpenERP and Perl