Skip to Content
Menu
This question has been flagged
1 Reply
1962 Views

Hi,

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

Thanks

Avatar
Discard
Best Answer

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.

Avatar
Discard