Odoo Help

0

Get a field value from wizard

By
Jihen BEN ALI
on 7/27/16, 7:53 AM 441 views

In the account.invoice.refund which is a wizard I had added a boolean field 'is_refund' how could I get the value of this field from wizard to the invoice forum when creating a refund from the invoice form

Help me please

2

Jignesh Mehta

--Jignesh Mehta--
2206
| 6 5 8
Surat, India
--Jignesh Mehta--


Jignesh Mehta
On 7/28/16, 12:28 AM

Hello Jihen,


Try below code.


class AccountInvoice(models.Model):

    _inherit = "account.invoice"

    is_refund = fields.Boolean('Is Refund')


class AccountInvoiceRefund(models.Model):

    _inherit = "account.invoice.refund"

    is_refund = fields.Boolean('Is Refund')


    @api.multi

    def invoice_refund(self):

        result = super(AccountInvoiceRefund, self).invoice_refund()

        invoice_obj = self.env['account.invoice'].browse(self._context.get('active_id'))

        invoice_obj.is_refund = self.is_refund

        return result


Hope it will helps you.

Thanks,

Thanks a lot

Jihen BEN ALI
on 7/28/16, 1:39 AM

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

Question tools

1 follower(s)

Stats

Asked: 7/27/16, 7:53 AM
Seen: 441 times
Last updated: 7/28/16, 1:39 AM