My code runs, but it doesnt fill anything on my one2many list
class fido_reporting(models.Model):
_name = 'fido.reporting'
date = fields.Date(default=fields.Date.today(), string='Date')
incedent = fields.Text(string='Incident')
fido_reporting_ids = fields.One2many('fido.line.report', 'line_report_id', compute="compute_report")
@api.one
@api.depends('date')
def compute_report(self):
report_data = self.env['account.invoice'].search([('date_invoice','=',self.date),('journal_id','=',"Customer Invoices"),('state','!=',"Draft")])
for reports in report_data:
for line_records in reports.invoice_line_ids:
params = {'line_report_id':self.id, 'name': reports.partner_id.name, 'product': line_records.product_id.name, 'quantity': 10, 'price' : 10.0, 'amount': 10.0}
# print params
print params
self.fido_reporting_ids.write(params)