Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

1

AngularJS in Openerp 7 ???

By
saibaba
on 1/18/14, 12:56 AM 5,709 views

I would like to know whether the OpenErp v7 supports the angularJS Framework or not ???

2

Gustavo

--Gustavo--
950
| 2 1 4
Buenos Aires, Argentina
--Gustavo--

Python developer, big fan of sailing

Gustavo
On 1/18/14, 7:10 PM

I don't think so... well, it depends, you can develop your application with AngularJS and query and update OpenERP information without any problem. You can do that via xml-rpc calls, that's a safe way to do that.

OpenERP allows you to develop web modules that extend OpenERP's web module, you have more information on this capability in this link:

https://doc.openerp.com/trunk/web/module/

or in the web training page:

https://doc.openerp.com/trunk/training/

Now, if you want to have further information on how to extend OpenERP's web module:

http://thierry-godin.developpez.com/openerp/tutorial-module-creation-pos-modification-english-version/

Hope this information helps,

thankz for sharing the useful links....

saibaba
on 1/22/14, 12:54 AM
1
agb80
On 1/18/14, 7:12 PM

Out of the box Openerp only supports backbone as a javascript framework and there are some works done by community to use marionett.

0
Joeri Belis
On 11/9/16, 9:40 AM

Done some experimenting with Angular 2 and Odoo V7.

So far it seems a good solution to create custom widgets in typescript and integrate these in the Odoo V7 client.

Create your new widget and supply the instance as a parameter so Angular 2 can use dependency injection to inject the instance in your services.

instance.web.form.MyWidget = instance.web.form.FormWidget.extend({        
template: "my_widget_template",
start: function() {
this._super();
System.import('app/main')
.then((module) => { module.main(instance); })
.catch(function(err){ console.error(err); });
console.log(instance);
}
});
instance.web.form.custom_widgets.add('angular2_widget', 'instance.web.form.MyWidget');


Now you have access to the Odoo V7 instance and access the backend it via xml-rpc 


import {Injectable} from '@angular/core';
import {Attachment} from './attachments.component'
import {Inject} from '@angular/core'
@Injectable()
export class OdooService {
constructor(@Inject('openerp') private instance: any) {}
fuction1(attachment: Attachment) {
let model = new this.instance.web.Model('memory.ir.attachment')
Model.call('create', [{test: "Bob"}])
...
}
}


The xpl-rpc calls return deferred object. Just convert it to an observable and is plays nicely in angular

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/18/14, 12:56 AM
Seen: 5709 times
Last updated: 11/9/16, 9:40 AM