After a server restart, an Odoo 16 nested tree view displays a blank page initially, but the data only becomes visible after clicking on the page

I am implementing a tree view in a tree view to display data. In the job_description model. we have a details_id that links the job description to the job details stored in another table also included below

from odoo import models, fields

class WorkPlan(models.Model):
    _name = 'job.description'
    _description = 'Job Description'

    job_id = fields.Many2one('hr.job', string='Job Position', readonly=True)
    job_purpose = fields.Text(string='Job Purpose', required=True)
    details_ids = fields.One2many('job.description.details', 'job_description_id', string='Details')
from odoo import models, fields


class JobDescriptionDetails(models.Model):
    _name = 'job.description.details'
    _description = 'Job Description Details'

    key_result_area = fields.Text(string='Key Result Area', required=True)
    principal_accountabilities = fields.Text(string='Principal Accountabilities', required=True)
    job_description_id = fields.Many2one('job.description', string='Work Plan')

The following is the xml page that handles the logic. When adding information. I don’t have a problem, it is saving and when I go to check on a particular job it is showing. However when I restart the server the when I go to the record it is showing that it has data but the table is blank. More information included below.

The xml file that handles the view

<odoo>
    <data>
        <record id="view_job_description_details_tree" model="ir.ui.view">
            <field name="name">job.description.details.tree</field>
            <field name="model">job.description.details</field>
            <field name="arch" type="xml">
                <tree editable="bottom">
                    <field name="key_result_area"/>
                    <field name="principal_accountabilities"/>
                </tree>
            </field>
        </record>
        <record id="view_job_description_tree" model="ir.ui.view">
            <field name="name">job.description.form</field>
            <field name="model">job.description</field>
            <field name="arch" type="xml">
                <tree>
                    <field name="job_id"/>
                    <field name="job_purpose"/>
                    <field name="details_ids" widget="one2many_list" options="{'no_create': True}">
                        <tree string="Details" editable="bottom" view_id="view_work_plan_goals_tree"/>
                    </field>
                </tree>
            </field>
        </record>
    </data>

Below is how it is coming up when i restart the server
after server restart

Below when I click on any of the headers after restart
after clicking either add line or the headers

I tried computing the details_id fields using the following code but it makes the data in the details_ids table to disappear completely

class JobDescription(models.Model):
    _name = 'job.description'
    _description = 'Job Description'

    job_id = fields.Many2one('hr.job', string='Job Position', readonly=True)
    job_purpose = fields.Text(string='Job Purpose', required=True)
    details_ids = fields.One2many('job.description.details', 'job_description_id', string='Details', compute='_compute_details_ids')

    @api.depends('job_id')
    def _compute_details_ids(self):
        for record in self:
            if record.job_id:
                record.details_ids = self.env['job.description.details'].search([('job_description_id', '=', record.job_id.id)])
            else:
                record.details_ids = self.env['job.description.details']

    def read(self, fields=None, load='_classic_read'):
        result = super(JobDescription, self).read(fields, load)
        self._compute_details_ids()
        return result

New contributor

HelpDesk Jhpiego is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật