Hello all,
I am creating vendor bill but i got an error that "Record does not exist or has been deleted."
Here is my code:
@api.multi
def action_confirm(self):
account = self.env['account.account'].search([('name', 'ilike', 'Final Settlement')])[0].id
supplier_line = {
'product_id': self.product_id.id,
'name': self.product_id.name,
'quantity': 1,
'account_id': account,
'price_unit': self.total_amount,
}
record_line = {
'partner_id': self.employee_id.id,
'invoice_line_ids': [(0, 0, supplier_line)],
}
record = self.env['account.invoice'].create(record_line)
self.env['account.invoice'].action_invoice_open()
return record