Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
5771 Lượt xem

I'm working in a project with php and mysql database. and I want that with odoo I can add or update data

An exemple :

-When I add a project in odoo this project will addded in my own project.

I try this code 

_________________________________________

def connexion ():
    db = mysql.connect(host = "localhost",
    user = "root",
    passwd = "",
    database = "test",
    port =int(3306)
    )
    return db

_________________________________________

when I call this function here (when I add a project in odoo )

_________________________________________

@api.model
def create(self, vals):
    db =connexion()
    return super(ProjectProject, self).create(vals) 

_________________________________________

odoo show me this error 

_________________________________________

raise exception.with_traceback(None) from new_cause
mysql.connector.errors.InterfaceError: 2003: Can't connect to MySQL server on 'http://127.0.0.1:3306' (-2 Name or service not known)


can someone help me here with exemples  


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 1 20
26258
1
thg 1 18
5190
0
thg 7 25
1424
2
thg 11 24
6223
2
thg 10 24
3172