小编Zad*_*100的帖子

Odoo 8从向导打开Treeview

我有一个向导来研究结果并将其添加到表中,并且创建了一个树状视图来读取该表中的项目。我希望我的向导在完成研究后打开该树视图,但是我找不到从python重定向到特定视图的方法。有人有主意吗?

我的模块称为sale_recherche_client_produit

我所有的文件都在我的项目文件夹的根目录下

我的主要python文件(sale_recherche_client_produit_wizard.py)

# -*- coding: utf-8 -*-
from openerp import models, fields, api, tools, exceptions
from openerp.exceptions import Warning
import math, json, urllib


class SaleRechercheClientProduitWizard(models.TransientModel):
    _name = "sale.order.line.search"

products = fields.Many2one("product.template", string="Meubles", required=True)
lieu = fields.Char(string="Lieu", required=False)
distance = fields.Selection([
    ('10', "10km"),
    ('50', "50km"),
    ('100', "100km"),
    ('aucune', "Aucune limite"),
], default='50',string="Distance", required=True)

@api.one
def recherche(self):
    lieu = self.lieu
    distance = self.distance
    products = self.products

    clients = self.env["res.partner"].search([['is_company', '=', True], ['customer', '=', True]])
    clients_proches = []

    if (distance=="aucune"): …
Run Code Online (Sandbox Code Playgroud)

python xml openerp odoo-8

3
推荐指数
1
解决办法
2845
查看次数

标签 统计

odoo-8 ×1

openerp ×1

python ×1

xml ×1