コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
2701 ビュー
Good morning,
I have an action that should take me to the tree view (account.invoice_tree) and then when clicking on an invoice, go to the form view (account.invoice_form)

I'm trying this code, but when I click the button, it doesn't do anything to me. At the top there is a message that indicates loading, but it stays on the same screen without redirecting me.
That may be wrong.
Thank you.
@api.multi
    def action_boleta_venta4(self):
        tree_view_id = self.env.ref("account.invoice_tree")
        form_view_id = self.env.ref("account.invoice_form")      
        views = [(tree_view_id, 'tree'),(form_view_id, 'form')]
        return {
            "name": _('Invoice'),
            "res_model": "account.invoice",
            "views": views,
            "view_id": False,
            "view_type": "form",
            "view_mode": "tree,form",
            "context": {
                'type': 'out_invoice',
                'journal_type': 'sale',
                'type_code': '08',
                'default_number': 'Nota de Débito'
                }
        }
アバター
破棄
最善の回答

Hi,

Try this code,


@api.multi
def action_boleta_venta4(self):
tree_view_id = self.env.ref('account.invoice_tree').id
form_view_id = self.env.ref('account.invoice_form').id
return {
'type': 'ir.actions.act_window',
'views': [(tree_view_id, 'tree'), (form_view_id, 'form')],
'view_mode': 'tree,form',
'name': _('Invoices'),
'res_model': 'account.invoice',
'context': {
'type': 'out_invoice',
'journal_type': 'sale',
'type_code': '08',
'default_number': 'Nota de Débito'
}
}

Thanks

アバター
破棄
著作者

Tranks.

関連投稿 返信 ビュー 活動
1
6月 25
224
0
5月 25
444
2
4月 25
2560
1
2月 25
881
2
2月 25
1390