Odoo Help

Welcome!

This community 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.

0

Get a field value from wizard

By
Jihen BEN ALI
on 7/27/16, 7:53 AM 212 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--
2081
| 6 4 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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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