Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
3500 Weergaven

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
Annuleer
Auteur

its not working

Beste antwoord

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
Annuleer
Auteur

thank you

Gerelateerde posts Antwoorden Weergaven Activiteit
3
mrt. 15
4974
1
jul. 25
491
2
jul. 25
649
1
jul. 25
1718
3
apr. 25
1740