if record.employee_id.payroll_archive_ids:
for archive in record.employee_id.payroll_archive_ids:
if archive.payroll_item_id.code == 'PA002' and not archive.expired_date:
result = (archive.amount) * 12
break
占位符表达式:
if record.employee_id.payroll_archive_ids:
for archive in record.employee_id.payroll_archive_ids:
if archive.payroll_item_id.code == 'PA002' and not archive.expired_date:
result = (archive.amount) * 12
break