Search code examples
odooodoo-10

Oddo Button returning Vendor Bills instead of Customer Invoice


When I click a button I had to goto Customer Invoice's Tree and Form View.Instead now it is going to Vendor Invoice.I tried like this in button click.

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])],
           }

Solution

  • 'views': [(self.env.ref('account.invoice_tree').id, 'tree'),
              (self.env.ref('account.invoice_form').id, 'form')],