Odoo 도움말


3 응답

Med Said BARA 알제리아

--Med Said BARA--

| 6 5 10
Guelma, 알제리아
--Med Said BARA--

Med Said BARA 알제리아
19. 3. 7. 오후 2:30

This is exactly what you need (a module with a simple JS file) (tested on V7.0): web_autoswitch_to_form

DenisK Germany
19. 3. 4. 오전 1:45

Thanks for the reply. I've implemented for now in the JS code where I check the response items length. Changing the action/response on the server side may be a problem as I figured out when testing. Because when a user toggles back from the form mode to the list mode the same query is send to the server and would response the action to show the form mode again. So the user would stay trapped on the form view.

To manage this I've inspected the JS code if there is any condition to check whether the user searched by himself via the search field or if the search is fired by view toggling. In both cases the same information are send to the server. To modify the search field at this moment also seems to be no option.

So I came along working on the response client side to figure out if I should show the form or not. With a flag that indicates that the user currently switched from form to view mode I can surpress the redirect to the form if there was only one item returned in the search response.

DRC Systems India
19. 3. 4. 오전 1:09

When you return the action on the button click, check in result how many record you are getting using len().

If you are getting exact 1 record then browse the particular models form view which you want to show and pass this in the action..

If  you are getting more than 1 record then browse the particular models list view which you want to show and pass this in the action..

Keep Informed
1 팔로워
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now