Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
3 Antworten
3494 Ansichten

hai

how to pop up a existing module form after a button press?

def action_approve(self):
        self.state='approved'
        invoices=self.env['account.invoice'].create({
            'type': 'out_invoice',
            'partner_id': self.partner_id.id,
            'user_id': self.env.user.id,
            'admission_id': self.name ,
            'origin': self.name,
            'invoice_line_ids': [(0, 0, {
                'name': 'Invoice For Admission',
                'quantity': 1,
                'price_unit': 500,
                'account_id': 41,
            })],
        })



i need to display a form for invoice  created


Avatar
Verwerfen
Autor

its not working

Beste Antwort

hello,

add the return action in your method.

@api.multi

def action_approve(self):
        self.state='approved'
        invoices=self.env['account.invoice'].create({
            'type': 'out_invoice',
            'partner_id': self.partner_id.id,
            'user_id': self.env.user.id,
            'admission_id': self.name ,
            'origin': self.name,
            'invoice_line_ids': [(0, 0, {
                'name': 'Invoice For Admission',
                'quantity': 1,
                'price_unit': 500,
                'account_id': 41,
            })],
        })

        return {
            'name': _('Customer Invoice'),
            'view_type': 'form',
            'view_mode': 'form',
            'res_model': 'account.invoice',
            'type': 'ir.actions.act_window',
           'res_id': invoices.id,
            'context': self.env.context,
        }

 


Avatar
Verwerfen
Autor

thank you

Verknüpfte Beiträge Antworten Ansichten Aktivität
3
März 15
4972
1
Juli 25
483
2
Juli 25
637
1
Juli 25
1711
3
Apr. 25
1740