Hi,
I want to get the invoice_date when paying an invoice how could I doing this??
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi,
I want to get the invoice_date when paying an invoice how could I doing this??
Thanks
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.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up