Giter Site home page Giter Site logo

blended-ideas / angular6-odoo-jsonrpc Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 4.0 257 KB

Angular Service for Odoo JSON RPC

Home Page: https://www.npmjs.com/package/angular6-odoo-jsonrpc

License: MIT License

JavaScript 13.75% TypeScript 78.45% HTML 7.39% CSS 0.41%
angular-odoo-jsonrpc angular6 angular6-odoo-jsonrpc jsonrpc odoo

angular6-odoo-jsonrpc's Introduction

What am I doing?

angular6-odoo-jsonrpc's People

Contributors

blended-ideas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

angular6-odoo-jsonrpc's Issues

Is is the right way to implement timeout in odoo?

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.

Cannot read property 'cookies' of undefined

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.

Failed to load http://localhost:8069/web/session/authenticate

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 ?

API is failing continuously

odoo error stack trace

Can u help me to solve this issue? Why am I getting this error?
Because this API call is working successfully for the first time but then now failing continuously.
Need help.

Changing language

Is there possible to change odoo langage (using files in i18n) please because i want to change it when calling searchread() method.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.