hi, i am trying to transfer data from a few selected cases in a customized model called 'x_case' at tree view to account.invoice, by using server action. From sample code, it has created case model and case_line model and transfer the data to invoice model and invoice_line model. While i tried to avoid the case_line for my own purpose. however, i've got the attribute error. i've browsed around and cannot find the right solution. Can you please help? i am new to python and coding.
ValueError: <class 'AttributeError'>: "'x_case' object has no attribute 'x_case'" while evaluating
case_lines=[]
for case_line in record.x_case:
case_lines.append([0,0,{
'x_studio_case':case_line.x_studio_case_id,
'x_studio_business_unit': case_line.x_studio_billing_centre,
'product_id':case_line.x_studio_field_8Cfba.id,
'name':case_line.x_studio_third_party_name_1,
'x_studio_billing_details':case_line.x_studio_billing_details,
'quantity':1,
'price_unit': case_line.x_studio_price,
'account_id': record.x_studio_field_8Cfba.property_account_income_id.id
}])
env ['account.invoice'].create({
'partner_id':record.x_studio_field_hry7Z.id,
'currency_id':record.x_currency_id.id,
'invoice_line_ids':case_lines
})