Odoo Oddo按钮返回供应商账单而不是客户发票
当我点击一个按钮时,我必须转到“客户发票”的树和表单视图。而现在它将转到“供应商发票”。我在“点击”按钮中尝试了这样的操作Odoo Oddo按钮返回供应商账单而不是客户发票,odoo,odoo-10,Odoo,Odoo 10,当我点击一个按钮时,我必须转到“客户发票”的树和表单视图。而现在它将转到“供应商发票”。我在“点击”按钮中尝试了这样的操作 return { 'name': "Invoice", 'type': 'ir.actions.act_window', 'view_mode': 'tree,form', 'xml_id': 'account.action_invoice_tree1'
return {
'name': "Invoice",
'type': 'ir.actions.act_window',
'view_mode': 'tree,form',
'xml_id': 'account.action_invoice_tree1',
'tree_view_id': self.env.ref('account.invoice_tree').id,
'form_view_id': self.env.ref('account.invoice_form').id,
'target': 'current',
'res_model':'account.invoice',
'domain': [('id','in',[invoice_obj.id])],
}
虽然这可能回答了作者的问题,但它缺少一些解释性的词语和/或指向文档的链接。如果没有一些短语,原始代码片段就没有多大帮助。你也会发现这很有帮助。请编辑你的答案-
'views': [(self.env.ref('account.invoice_tree').id, 'tree'),
(self.env.ref('account.invoice_form').id, 'form')],