|
@ -8,6 +8,25 @@ import json |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class opendons(http.Controller): |
|
|
class opendons(http.Controller): |
|
|
|
|
|
|
|
|
|
|
|
@http.route(['/opendons/object'], type='http', auth='public', website=True, sitemap=False,csrf=False) |
|
|
|
|
|
def object(self,model,id,*args,**kw): |
|
|
|
|
|
|
|
|
|
|
|
field_list=request.env[model].sudo().fields_get() |
|
|
|
|
|
objet=request.env[model].search([('id','=',int(id))]) |
|
|
|
|
|
|
|
|
|
|
|
# result=[] |
|
|
|
|
|
# for key in field_list: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# result.append((key,str(objet[key]))) |
|
|
|
|
|
# result.sort() |
|
|
|
|
|
# return json.dumps(result) |
|
|
|
|
|
result="" |
|
|
|
|
|
for key in field_list: |
|
|
|
|
|
result=result+str(key)+':'+str(objet[key])+'<br>' |
|
|
|
|
|
return result |
|
|
|
|
|
|
|
|
@http.route(['/opendons/cp'],type='json', methods=['GET','POST'],auth="public",csrf=False) |
|
|
@http.route(['/opendons/cp'],type='json', methods=['GET','POST'],auth="public",csrf=False) |
|
|
def index(self, **post): |
|
|
def index(self, **post): |
|
|
name = post.get('name', False) |
|
|
name = post.get('name', False) |
|
|