Show move form after creating a move from a template

issue6267
review29231002
This commit is contained in:
Sergi Almacellas Abellana
2017-02-24 10:02:35 +01:00
parent 6f30d59501
commit 2f07249dd3
2 changed files with 16 additions and 4 deletions
+5 -4
View File
@@ -285,7 +285,7 @@ class CreateMove(Wizard):
Button('Create', 'create_', 'tryton-ok', default=True),
])
create_ = StateTransition()
open_ = StateAction('account.act_move_form')
open_ = StateAction('account.act_move_from_template')
def create_move(self):
template = self.template.template
@@ -312,7 +312,7 @@ class CreateMove(Wizard):
def transition_create_(self):
model = Transaction().context.get('active_model')
if model:
if model == 'account.move.line':
self.create_move()
return 'end'
else:
@@ -324,8 +324,9 @@ class CreateMove(Wizard):
return action, {}
def end(self):
# XXX only for model account.move.line
return 'reload'
model = Transaction().context.get('active_model')
if model == 'account.move.line':
return 'reload'
class CreateMoveTemplate(ModelView):
+11
View File
@@ -183,5 +183,16 @@ this repository contains the full copyright notices and license terms. -->
</record>
<menuitem parent="menu_entries" action="act_move_template_create"
id="menu_move_template_create"/>
<record model="ir.action.act_window" id="act_move_from_template">
<field name="name">Account Move</field>
<field name="res_model">account.move</field>
</record>
<record model="ir.action.act_window.view"
id="act_move_from_template_view1">
<field name="sequence" eval="10"/>
<field name="view" ref="move_view_form"/>
<field name="act_window" ref="act_move_from_template"/>
</record>
</data>
</tryton>