Odoo - prevent button from closing wizard

后端 未结 6 1974
死守一世寂寞
死守一世寂寞 2020-12-29 11:54

I have a transient model that serves as a dialog. In my form view I have a button like this:

6条回答
  •  太阳男子
    2020-12-29 12:12

    on odoo 7

    def traszero(self ,cr ,uid ,ids ,context=None):
            data_obj = self.pool.get('stock.return.picking.line')
            ret_wizard = self.browse(cr, uid, ids, context=context)
            if ret_wizard.product_return_moves:
                line_ids = ret_wizard.product_return_moves.mapped('id')
                data_obj.write(cr, uid, line_ids, {'quantity': 0}, context=context)
            return {'name':"Return Shipment",
                'res_model':"stock.return.picking",
                'src_model':"stock.picking",
                'view_mode':"form",
                'target':"new",
                'key2':"client_action_multi",
                'multi':"True",
                'res_id':ids[0],
                'type': 'ir.actions.act_window',
                }
    

提交回复
热议问题