Hi Friends,
Can anyone help me in this situation. Have to create database from openerp form on a button click.Please do help
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi Friends,
Can anyone help me in this situation. Have to create database from openerp form on a button click.Please do help
import openerp.netsvc as netsvc
from openerp.service.web_services import db
def create_db(self, cr, uid, ids, context=None):
db = db(netsvc.ExportService)
db.exp_create_database('test', True, 'en_US', user_password='admin') #exp_create_database(self, db_name, demo, lang, user_password='admin'):
return True
Please accept the answer if you find it helpful.
Error thrown as no named db.Im using version openerp 7.0
Please can u post full code to create db function with import files.Do help me
I have udated answer.
UnboundLocalError: local variable 'db' referenced before assignment
you need to import import openerp.netsvc as netsvc from openerp.service.web_services import db
I used your code as it is. But it is shown error as UnboundLocalError: local variable 'db' referenced before assignment
I have tested it and it works .. you are doing something wrong .. share a screenshot here
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj sięPowiązane posty | Odpowiedzi | Widoki | Czynność | |
---|---|---|---|---|
|
0
mar 15
|
4678 | ||
|
1
sie 23
|
2015 | ||
|
0
mar 15
|
5127 | ||
|
1
lis 22
|
3145 | ||
|
2
mar 22
|
10709 |