Okay so i solved it. Just switched x_survey_id with an existing survey_id in survey.user_input as relation field in survey.survey. But now I can't calculate the fields. I want to use x_rate field from survey.survey model but the other field (x_amount_payable) i want to calculate with x_rate and the field (x_total_paying_fjd) in which it will be displayed is in survey.user_input model. How can I compute x_total_paying_fjd = x_amount_payable/x_rate?
So I'm very new to odoo and I've been tasked to create a one2many field from front end/interface. I have to create the "Add a line.." function that opens a new form to enter details and save to table.
I used pre-existing models to create a one2many field since I don't have backend access to create models for now. I used survey.survey as my main model to implement the one2may field (x_survey_line_ids) and survey.user_input as the sub-model with all other fields I want displayed (x_date, x_amount, x_amount_payable, x_invoice_id - many2one[account.asset.asset], x_purchase_order, x_receipt, x_remarks, x_survey_id - many2one[survey.survey], x_total_paying_fjd, x_wht1, x_wht2).
This is my code in Edit:View Form of survey.survey.
I've used x_survey_id as the relation field and survey.user_input as object relation for x_survey_line_ids.
I can add a line and enter information in the new form that opens but it gives this error when trying to save. What can I do from front end to solve it?
"The operation cannot be completed:
- Create/update: a mandatory field is not set.
- Delete: another model requires the record being deleted. If possible, archive it instead.
Model: Survey User Input (survey.user_input), Field: Survey (survey_id)"