I created a button that creates an invoice in the invoice module according to data from my Custom module
When I press the button, the data appears in the database, but does not appear in the view
What is the reason for that?
my code :
defcreate_invoice(self):
vals={
'name':'samer',
'partner_id':self.vendor_id.id,
'invoice_date':date.today(),
'state':'draft',
'invoice_line_ids': [(0, 0, {
'price_unit': self.product_id.list_price,
'quantity': 1.0,
'discount': 0.0,
'product_id': self.product_id.name,
})] }
self.update({
'state': '2',
})
return self.env['account.move'].create(vals)