Add button next page - wizard - Odoo v8 - python

I'm trying to create a wizard which has several pages.
I know how to pass to 'target' new or current, to pass the action to a form or tree view, but what I actually need, before that, is to create several steps which will be on different "views" of this wizard, like a form with 'next' and 'back' buttons.
Is there some example code I can look for that?
I've searched on default addons, with no success.

The best way to do this is to have a popup target=new and have a statusbar on top right which will be clickable/not readonly (so that the user can go back). And depending on the state of your record, show the appropriate fields
You can of course create a popup, and when the user clicks next destroy that popup and create another one but that doesn't seem like a good idea to me.

Related

Search Menu Location in odoo12

In some forms, the search menu stays at the top. I need to see him always. How to do this?
that is Many2many view, the common list doesn't have that kind of structure, if you really need it, you can try to extend the basic search view in the main structure of Odoo.

How to create an available button in an One2many tree in a wizard?

I need to create a group of Transient Models to allow users to configure several settings through easy wizards.
In the main wizard, I need to show a One2many field (tree editable inline), which points to other Transient Model. The user will be able to add some lines to the One2many field, and each one of these lines will have a button. If the user clicks on this button, it will open another wizard.
The problem is that the button of each line is always readonly, since Odoo does not allow to click on a button whose record is still not stored in the database.
With non-transient models, to click on the button inside a line of the tree view of an One2many field, you must click on the Save button of the parent form before, to store the main record and each one of the lines. This is very uncomfortable for users indeed.
But perform that action in a Transient Model is a non-sense, mainly because it does not have a Save button, but your own buttons.
Any ideas of how to do in this situation?

Option to add extra choices in django form

I am trying to create a model via a form that has multiple other models related to it. Say I have a model Publisher, then another model Article with a foreign key to Publisher. When creating a Publisher via a form, I want to create An article at the same time. I know how to do this via formsets. However, I don't know how to add a button that says add extra article at the same view, without having to be redirected to a new page and losing the old data since the form was not saved. What I want is when someone clicks add new article, for a new form for article to appear and for the user to add a new Article. Is this possible to be done in the same view in django, if so can someone give me and idea how to approach this?
I would show code or my attempts, but I am not sure how to even approach it.
This can only be done using JavaScript. The hard part is to have the management form sync up with the number of rows.
But there's two alternatives:
Semi-javascript (Mezzanine's approach): Generate a ton of rows in the formset and only show one empty. Upon the click of the "add another row" button, unhide the next one. This makes it easier to handle the management form as the unfilled extra's don't need any work.
No fix needed: Add as many rows as is humanly sane. In general, people don't need 40 rows, they get bored with filling out the form or worry that all that work is lost when the browser crashes.
Hope this helps you along. Good luck!

How to create dynamic form in django and implement add new record?

I want to make a page where user can input three form fields like 'car_name','bike_name','views'.
I want to make a html which initially have these 3 form input space. and further i want to add a button "add new entry". when user click on it then on same page 3 new form inputs will appear. and so on.
When user click submit button then all these fields have into database.
How can i do it?
I tried implementing https://docs.djangoproject.com/en/1.9/topics/forms/formsets/
but here we have to provide no of extra forms in views.py itself. but i want to set it from my html page.
how can i do it?
Thanks!

Show different additional information in Django Admin change form depending on change or add?

Is it possible to show different additional information in the Django Admin change form depending on if an instance is being added or changed?
I am not asking about changing the list of fields.
I have an app that allows the user to SAVE BASIC SETUP (save a new instance) then SAVE ADDITIONAL CHANGES (resaves an existing instance with modifications), after completing both saves successfully, the user can click on one of three buttons to be routed to a different place. Everything works, but the user sees all the buttons all the time. I want to limit what the user sees so they only see the SAVE BASIC SETUP button until they have saved the instance, then after the save, I want that button to disappear and have them see the SAVE ADDITIONAL CHANGES button along with the routing options.
Is this possible? Thanks in advance for any suggestions.

Categories