Odoo Help

7

0
3 Answers
1
Avatar

Mitul Shingala India

--Mitul Shingala--
5354
| 6 4 9
Vadodara, Gujarat, India
--Mitul Shingala--

Odoo Developer

Mitul Shingala India
2/7/19, 12:29 AM

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

 


1 Comment
Abraham Qureshi United Kingdom
2/7/19, 12:48 AM

thank you

Ask a Question
Writer
Tags
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now