<?xml version="1.0" encoding="utf-8" ?>
<odoo>

    <template id="review_report">

        <t t-call="web.external_layout">
            <div class="page">
                <div class="row" style="padding-top:10px">
                    <div class="col-12">
                        <div class="text-center">
                            <h1>
                                <strong>Review Report</strong>
                            </h1>
                        </div>
                    </div>
                </div>
                <div class="row" style="padding-top:10px">
                    <div class="col-12">
                        <div class="text-center">
                            <h1>
                                <strong t-field="doc.name" />
                            </h1>
                        </div>
                    </div>
                </div>
                <div class="row" style="padding-top:10px">
                    <div class="col-3">
                        Confidentiality:
                    </div>
                    <div class="col-9 pull-right">
                        Direction Review
                    </div>
                </div>
                <div class="row">
                    <div class="col-3">
                        Reference:
                    </div>
                    <div class="col-9 pull-right">
                        <span t-field="doc.reference" />
                    </div>
                </div>
                <div class="row">
                    <div class="col-3">
                        Date:
                    </div>
                    <div class="col-9 pull-right">
                        <span t-field="doc.date" />
                    </div>
                </div>
                <div class="row">
                    <div class="col-3">
                        Participants:
                    </div>
                    <div class="col-9 pull-right">
                        <ul class="list-unstyled">
                            <t t-foreach="doc.user_ids" t-as="participant">
                                <li><span t-field="participant.name" /></li>
                            </t>
                        </ul>
                    </div>
                </div>
                <div class="row" style="padding-top:10px">
                    <div class="col-12">
                        <h2>
                            <strong>Policies:</strong>
                        </h2>
                        <span t-field="doc.policy" />
                    </div>
                </div>
                <div class="row" style="padding-top:10px">
                    <div class="col-12">
                        <h2>
                            <strong>Changes affecting the management systems:</strong>
                        </h2>
                        <span t-field="doc.changes" />
                    </div>
                </div>
                <div class="row" style="padding-top:10px">
                    <div class="col-12">
                        <t t-foreach="doc.line_ids" t-as="line">
                            <h3>
                                <strong>
                                    <span t-field="line.name" />
                                </strong>
                            </h3>

                            <ul class="list-unstyled" style="padding-left:15px">
                                <li>Action:
                                    <t t-if="line.type=='action'">
                                        <span t-field="line.action_id.name" />
                                    </t>
                                    <t t-if="line.type=='nonconformity'">
                                        <span
                                            t-field="line.nonconformity_id.description"
                                        />
                                    </t>
                                </li>
                                <li>State:
                                    <t t-if="line.type=='action'">
                                        <span t-field="line.action_id.stage_id.name" />
                                    </t>
                                    <t t-if="line.type=='nonconformity'">
                                        <span t-field="line.nonconformity_id.state" />
                                    </t>
                                </li>
                                <li>Decision:
                                    <span t-field="line.decision" /></li>
                                <li>Reference :
                                    <t t-if="line.type=='action'">
                                        Action
                                        <span t-field="line.action_id.reference" />
                                    </t>
                                    <t t-if="line.type=='nonconformity'">
                                        Nonconformity
                                        <span t-field="line.nonconformity_id.ref" />
                                    </t>
                                </li>
                            </ul>
                        </t>
                    </div>
                </div>
                <div class="row" style="padding-top:10px">
                    <div class="col-12">
                        <h2>
                            <strong>Conclusion:</strong>
                        </h2>
                        <span t-field="doc.conclusion" />
                    </div>
                </div>

            </div>
        </t>
    </template>

</odoo>
