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

Invoice Date in the account_voucher

By
Jihen BEN ALI
on 2/9/16, 6:12 AM 299 views

Hi,

I want to get the invoice_date when paying an invoice how could I doing this??

Thanks

1

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
996
| 5 3 6
Rajkot, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 2/10/16, 3:47 AM

Hello Jihen,

Please refer below code.

class account_voucher(osv.Model):

_inherit = "account.voucher"

def default_get(self, cr, uid, fields, context=None):

data = super(account_voucher, self).default_get(cr, uid, fields, context=context)

if context.get('active_ids'):

acc_inv_obj = self.pool.get('account.invoice')

for acc_inv_data in acc_inv_obj.browse(cr, uid, context.get('active_ids'), context=context):

data['date_inv'] = acc_inv_data.date_invoice

return data

Hope that code help for you.

Best Regards,

Ankit H Gandhi.

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: 2/9/16, 6:12 AM
Seen: 299 times
Last updated: 2/10/16, 4:15 AM