Hello fellow odooers
I have a module which calls a method, this method returns a window-action of sale.order's default form-view. The target I use is 'new'. The sale_order gets opened in an editable window, but no button (save/cancel) shows up. The button confirm order, send order etc shows up, but I do not need those buttons at this stage. I'd just like to be able to save my sale_order in the state that I edited it.
Another option for me would be to use the target 'current', but then my new sale_order would not be in edit mode. I have been looking in web's view_form.js and found the method 'to_edit_mode', but I am unsure on how to implement it in my python code to be able to start the view in edit-mode
The option 'inline' also starts in edit mode, but does not show the save/cancel buttons either.
Any help on this would be greatly appreciated.
EDIT: I have tried to install a module referenced in this topic: https://www.odoo.com/fr_FR/forum/help-1/question/closed-open-a-form-in-a-specified-state-edit-browse-3447 , But this module does not do anything. I have tried printing in the beginning of this js file, but with no luck.
So currently I have 3 options:
1) Use target: new, which opens a wizard-like window in edit mode, without the option to save.
2) Use target: inline, which opens a form-view in edit mode, without the option to save.
3) Use target: current, which opens a form-view in view-mode, so I would have to click 'Edit'
The last option is preferred, but it would be perfect if this view could be opened in edit-mode. I tried adding the class oe_form_button_edit to my button (this class triggers edit-mode on click) but am unable to start my view in edit mode.
EDIT2: #openobject at freenode mentioned that a similar question was asked on the mailing list, so I started digging here and found a possible solution. I haven't had the time to figure it out, but I will try this soon and update this post.
https://www.odoo.com/nl_NL/groups/community-framework-62/community-framework-16152974?mode=thread&date_begin=&date_end=