Assumption, I have a customize field 'd1_analytic_required' (boolean) in model 'account.invoice'
And, a customize field 'd1_analytic' (boolean) in model 'account.account'
I want to check on Vendor Bill, if account field (in line) have attribute d1_analytic = True then 'd1_analytic_required' = True. My code:
for rec in self:
sum1 = 0
for line in rec.invoice_line_ids:
sum1 += 1
if sum1 > 0:
rec.d1_analytic_required = True
rec.d1_analytic_required = False
It's not working!!
Please help me! Thank in advance!