當畫面只有一個按鈕(class=btn-primary)時
可以考慮買這個 app
才看一場電影的錢
但是只有10版的沒有14版的
雖然他教的是「如何把 enter key 由 submit 改成 tab」(跟你要的剛好相反)
還是可以參考這篇
如果只是用轉換頁面
return {
'res_model': 'test.model',
'type': 'ir.actions.act_window',
'name': _(text),
'context': {},
'view_mode': 'form',
'target': 'new',
}
執行會出現錯誤
Odoo Server Error
Traceback (most recent call last):
File "C:\odoo\server\odoo\addons\base\models\ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "C:\odoo\server\odoo\http.py", line 683, in dispatch
result = self._call_function(**self.params)
File "C:\odoo\server\odoo\http.py", line 359, in _call_function
return checked_call(self.db, *args, **kwargs)
File "C:\odoo\server\odoo\service\model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "C:\odoo\server\odoo\http.py", line 347, in checked_call
result = self.endpoint(*a, **kw)
File "C:\odoo\server\odoo\http.py", line 912, in call
return self.method(*args, **kw)
File "C:\odoo\server\odoo\http.py", line 531, in response_wrap
response = f(*args, **kw)
File "C:\odoo\server\odoo\addons\web\controllers\main.py", line 1394, in call_kw
return self._call_kw(model, method, args, kwargs)
File "C:\odoo\server\odoo\addons\web\controllers\main.py", line 1386, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "C:\odoo\server\odoo\api.py", line 397, in call_kw
result = _call_kw_model_create(method, model, args, kwargs)
File "C:\odoo\server\odoo\api.py", line 378, in _call_kw_model_create
return result.id if isinstance(args[0], Mapping) else result.ids
Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\odoo\server\odoo\http.py", line 639, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "C:\odoo\server\odoo\http.py", line 315, in _handle_exception
raise exception.with_traceback(None) from new_cause
AttributeError: 'dict' object has no attribute 'id'