blended-ideas / angular6-odoo-jsonrpc Goto Github PK
View Code? Open in Web Editor NEWAngular Service for Odoo JSON RPC
Home Page: https://www.npmjs.com/package/angular6-odoo-jsonrpc
License: MIT License
Angular Service for Odoo JSON RPC
Home Page: https://www.npmjs.com/package/angular6-odoo-jsonrpc
License: MIT License
Is there possible to change odoo langage (using files in i18n) please because i want to change it when calling searchread() method.
Hello !
I'm facing that problem :
OPTIONS http://localhost:8069/web/session/authenticate 400 (BAD REQUEST)
Failed to load http://localhost:8069/web/session/authenticate: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
Here is my code :
import {Component, OnInit} from '@angular/core';
import {Ng6OdooRPCService} from 'angular6-odoo-jsonrpc';
import {FormBuilder, FormGroup, Validators} from '@angular/forms';
@component({
selector: 'app-auth',
templateUrl: './auth.component.html',
styleUrls: ['./auth.component.css'],
providers: [Ng6OdooRPCService]
})
export class AuthComponent implements OnInit {
loginForm: FormGroup;
submitted = false;
loading = false;
db_name = 'tpl_bd';
constructor(private odooRPC: Ng6OdooRPCService,
private frombuilder: FormBuilder) {}
ngOnInit() {
this.loginForm = this.frombuilder.group({
username: ['', Validators.required],
password: ['', Validators.required]
});
}
// get Form
get f() {
return this.loginForm.controls;
}
onSubmit() {
this.submitted = true;
if (this.loginForm.invalid) {
return;
}
this.loading = true;
this.odooRPC.init({
odoo_server: 'http://localhost:8069',
// http_auth: 'username:password' // optional
});
this.odooRPC.login(this.db_name, this.f.username.value, this.f.password.value).then(res => {
console.log('Access');
}).catch(err => {
alert(this.db_name);
alert(this.f.username.value);
alert(this.f.password.value);
console.error(' No access !', err);
});
}
}
Anyone could help me please ?
I got this error =>
startday_write call failed Cannot read property 'cookies' of undefined
(anonymous) @ vendor.js:91757
Is it related to angular6-odoo-jsonrpc.
I am using browser's local storage also.
this.odooRPC.call('model_name, 'method_name', parameter, {})
.then(res => {
console.log('call success', res);
})
.catch(err => {
console.error('call failed', err);
});
I have called "method_name" in the above way. How can I timeout the same like HTTP timeout? Need help. Urgent.
Hello,
I have solved my issue using the following way =>
const myObservable = Observable.fromPromise(
this.odooRPC.call('model_name, 'method_name', parameter, {})
);
const mySubscription = myObservable .subscribe(
res => {
console.log('res success');
}, err => {
console.log(err failed');
}
);
setTimeout(() => {
mySubscription .unsubscribe();
}, 3000);
Need Help. Is it the right way?
Because "myObservable.timeout(3000)" is not working. I have tried to use it in the same HTTP fashion. But it does not work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.