Your SlideShare is downloading. ×
0
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
OpenERP and Perl
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

OpenERP and Perl

1,238

Published on

OpenERP is a very flexible open-source ERP system, which handles accounting, CRM, sales, purchasing, manufacturing, and many other business functions. …

OpenERP is a very flexible open-source ERP system, which handles accounting, CRM, sales, purchasing, manufacturing, and many other business functions.

It is written in Python but has an XML-RPC API so we can control all of its functions from Perl. However, despite OpenERP having an object-oriented architecture the API is quite 'low-level', and using it is a very different experience compared to having an ORM like DBIx::Class.

OpenERP::OOM (Object to Object Mapper) bridges this gap, letting us use Moose classes to represent the OpenERP schema. As with an ORM, the schema and object classes can be extended with our own methods and functions.

With this approach the underlying interface to OpenERP becomes transparent - everything is done with Perl - which means we can write Catalyst models, extend OpenERP with CPAN modules, and use all of OpenERP's functions from our Perl code.

Presented at the YAPC Europe 2012 conference in Frankfurt, Germany.

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,238
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
27
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. OpenERP and Perl Jon  Allen  (JJ)  –  jj@opusvl.com  
  • 2. OpenERP www.opusvl.com!
  • 3. enterprise" resource" planning www.opusvl.com!
  • 4. ? www.opusvl.com!
  • 5. core business" applications www.opusvl.com!
  • 6. sales crm"manufacturing" purchasing www.opusvl.com!
  • 7. accounting www.opusvl.com!
  • 8. integratedaccounting www.opusvl.com!
  • 9. www.opusvl.com!
  • 10. Perl? www.opusvl.com!
  • 11. OpenERPwebsite intranet www.opusvl.com!
  • 12. api www.opusvl.com!
  • 13. XML-RPC www.opusvl.com!
  • 14. single"requests www.opusvl.com!
  • 15. stateless www.opusvl.com!
  • 16. object"model www.opusvl.com!
  • 17. relationships www.opusvl.com!
  • 18. res.partner.address one2manyres.partner many2one res.company www.opusvl.com!
  • 19. database www.opusvl.com!
  • 20. ORM www.opusvl.com!
  • 21. object"relational" mapper www.opusvl.com!
  • 22. OOM www.opusvl.com!
  • 23. object to" object"mapper www.opusvl.com!
  • 24. OpenERP::OOM www.opusvl.com!
  • 25. Moose www.opusvl.com!
  • 26. object model www.opusvl.com!
  • 27. SchemaClass Class ClassObject Object OpenERP www.opusvl.com!
  • 28. # 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!
  • 29. schema www.opusvl.com!
  • 30. # MyApp.pm package MyApp; use Moose; extends OpenERP::OOM::Schema; 1; www.opusvl.com!
  • 31. connection www.opusvl.com!
  • 32. use MyApp; my $schema = MyApp->new( openerp_connect => { host => localhost, dbname => jj_test_1, username => admin, password => admin, }, ); www.opusvl.com!
  • 33. classes www.opusvl.com!
  • 34. # 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!
  • 35. objects www.opusvl.com!
  • 36. fields www.opusvl.com!
  • 37. relationships www.opusvl.com!
  • 38. partner"has many"addresses www.opusvl.com!
  • 39. 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!
  • 40. object "creation www.opusvl.com!
  • 41. # Schema -> Class -> Class Method my $partner = $schema->class(Partner)-> create({ name => JJ }); # Updates $partner->update({name => Jon Allen}); say $partner->name; www.opusvl.com!
  • 42. search www.opusvl.com!
  • 43. # Single result my $jj = $schema->class(Partner)-> find([name => = => JJ]); # Multiple results my @partners = $schema->class(Partner)-> search([name => like => J]); www.opusvl.com!
  • 44. related"objects www.opusvl.com!
  • 45. $partner->create_related( addresses, { name => ..., street => ..., city => ..., } ); www.opusvl.com!
  • 46. add"methods www.opusvl.com!
  • 47. extendOpenERP objects www.opusvl.com!
  • 48. external"data sources www.opusvl.com!
  • 49. DBIx::Class www.opusvl.com!
  • 50. not just" data www.opusvl.com!
  • 51. OpenERP"methods www.opusvl.com!
  • 52. workflows www.opusvl.com!
  • 53. integrated"accounting www.opusvl.com!
  • 54. 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!
  • 55. applicationlogic = Perl www.opusvl.com!
  • 56. application"data = DBIC www.opusvl.com!
  • 57. generic logic "= OpenERP www.opusvl.com!
  • 58. generic data "= OpenERP www.opusvl.com!
  • 59. many uses www.opusvl.com!
  • 60. Catalyst model www.opusvl.com!
  • 61. 18 months"development www.opusvl.com!
  • 62. 3 commercial"deployments www.opusvl.com!
  • 63. open sourced" today www.opusvl.com!
  • 64. http://search.cpan.org/ dist/OpenERP-OOM www.opusvl.com!
  • 65. questions? www.opusvl.com!
  • 66. www.opusvl.com!

×