在向导中设置必填字段之前,Odoo 10可单击按钮

时间:2019-01-28 13:29:18

标签: python xml python-2.7 odoo odoo-10

我想先创建可点击的按钮,然后再在向导中设置必填字段,以按产品树视图分组。

enter image description here

是否有可能忽略必填字段并使按钮变为可点击状态?

xml:

<button string="Show quants from" name="button_show_quants_from" type="object" class="btn-primary"/>

python:

@api.multi
def button_show_quants_from(self):
    view = self.env.ref('my_stock.view_my_stock_quant_tree')
    self.ensure_one()
    return {
        'name': _('Quants from'),
        'view_type': 'form',
        'view_mode': 'tree',
        'views': [(view.id, 'tree')],
        'view_id': view.id,
        'res_model': 'stock.quant',
        'type': 'ir.actions.act_window',
        'target':'new',
        'domain': [('location_id','=',self.location_to_id.id),('reservation_id','=',False)],
    'context': {'group_by': 'product_id'},
    }

我当时在考虑此向导表单视图中的树形视图,但是我无法按产品将其分组,也无法看到包含大量产品数量块的混乱视图。

现在我有一个这样的清单:

enter image description here

0 个答案:

没有答案
相关问题