OpenERP::OOM::Class
version 0.44
package Package::OpenERP::Class::Account; use 5.010; use OpenERP::OOM::Class; object_type 'Package::OpenERP::Object::Account'; around 'create' => sub { my ($orig, $self, $object) = @_; # Make sure active is set to 1 $object->{active} = 1; # Create the object return $self->$orig($object); }; sub account_by_code { my $self = shift; my $code = shift; return $self->find([ 'code', '=', $code ]); } 1;
Use this module to create the 'classes' for your modules. It also implicitly loads Moose too. In addition to the Moose bindings it also ties up the class with a corresponding class for your individual objects using the object_type property.
This is in internal method that hooks up your class to inherit the class OpenERP::OOM::Class::Base.
OpenERP::OOM::Class::Base
See the OpenERP::OOM::Class::Base class for the methods your objects that use this class will automatically have available.
This links the class to the object class. When you create a new object using create or you are returned objects after doing a find or search they will be of the type specified.
Copyright (C) 2011 OpusVL
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Jon Allen (JJ), <jj@opusvl.com>
This software is copyright (c) 2011-2016 by OpusVL.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install OpenERP::OOM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenERP::OOM
CPAN shell
perl -MCPAN -e shell install OpenERP::OOM
For more information on module installation, please visit the detailed CPAN module installation guide.