Odoo Help

0

Invoice Date in the account_voucher

By
Jihen BEN ALI
on 2/9/16, 6:12 AM 479 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)--
1091
| 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.

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