我想将这个JS文件包含在我的angular 2项目中,以便将它与odoo连接:
我安装了它:npm install --save odoo-connect,这是脚本。有关如何做到这一点的任何想法?谢谢
const Odoo = require('odoo-connect');
const odoo = new Odoo({
host: 'foobar.com',
port: 9999
});
odoo
.connect({
database: 'unicorn',
username: 'foo',
password: 'bar'
})
.then(client => {
return client.searchRead('product.product', [['list_price', '>', '50']], {limit: 1});
})
.then(products => {
console.log(products);
//=> [{list_price: 52, name: 'Unicorn'}]
});