After fill in the required fields and click the 'Confirm' button. I want to show the form view in SAVE/VIEW mode. But it just shows the Form View in EDIT mode like this:
I'd tried to define the 'confirm' button like this:
def confirm(self):
for rec in self:
rec.state='daduocxacnhan'
return {
'view_mode': 'form',
'res_model': 'dieu.chinh',
'context': {'form_view_initial_mode': 'save', 'force_detailed_view': 'true'},
'target': 'current',}
But it still didn't work as expected. It still shows the form view in EDIT mode after clicking the 'confirm' button.
Please help! Thank you!


Nếu Bạn muốn hiển thị form view là 1 cái alert xác nhận có chắc muốn confirm cái thông tin này không thì sử dụng thuộc tính confirm có sẵn trong Odoo và thêm vào button đó
Còn nếu bạn muốn hiển thị form view mà mình custom thì sử dụng wizard nhé.
Link tham khảo wizard:https://minhng.info/odoo/hien-thuc-wizard-odoo.html