<odoo>
   <!-- <record id="view_fg_production_plan_calendar" model="ir.ui.view">
        <field name="name">sos.production.plan.calendar</field>
        <field name="model">sos_production_plan</field>
        <field name="arch" type="xml">
        <calendar string="Production schedule" date_start="week1_date" date_end="target_date" mode="month">
        </calendar>
        </field>
    </record> -->
    <!-- Form View for FG Production Plan -->
    <record id="view_fg_production_plan_form" model="ir.ui.view">
        <field name="name">sos.production.plan.form</field>
        <field name="model">sos_production_plan</field>
        <field name="arch" type="xml">
            <form string="FG Production Plan">
                <sheet>
                    <div style="font-size: 22px; pointer-events: none; color: #793595;">
                        <field name="plan_ref_no" nolabel="1"/></div>

<templates>
<table class="table table-bordered" style="box-shadow: rgba(0, 0, 0, 0.12) 0px 1px 3px, rgba(0, 0, 0, 0.24) 0px 1px 2px;">
<tbody>
<tr>
<td class="column">FG Name</td><td><field name="fg_name" /></td>
<td class="column">QP No</td><td><field name="qp_no"/></td>
<td class="column">Target Date</td><td><field name="target_date"/></td>
<td class="column">Quantity Planned</td><td><field name="required_qty"/></td>  
</tr>
</tbody>
</table>
<div style="padding:10px">

<div>  P = PLANNED  |   A = ACTUAL   |   QC = QUALITY CHECKED</div>
<table class="table table-bordered" style="box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;">
        <thead>
            <tr>

           
                <th class="column">P/A</th>
                <th class="column">I Week</th>
                <th class="column">II Week</th>
                <th class="column">III Week</th>
                <th class="column">IV Week</th>
                <th class="column">V Week</th>
                <th class="column">VI Week</th>
                <th class="column">VII Week</th>
                <th class="column">VIII Week</th>
                <th class="column">Completed Qty</th>
            </tr>
        </thead>
<tbody>
            <tr>
          
                <td>P</td>
                <td><field name="planned_week_1"/></td>
                <td><field name="planned_week_2"/></td>
                <td><field name="planned_week_3"/></td>
                <td><field name="planned_week_4"/></td>
                <td><field name="planned_week_5"/></td>
                <td><field name="planned_week_6"/></td>
                <td><field name="planned_week_7"/></td>
                <td><field name="planned_week_8"/></td>
                <td rowspan="3"><field name="total"/></td>
            </tr>
            <tr>
                <td>A</td>
                <td><field name="actual_week_1"/></td>
                <td><field name="actual_week_2"/></td>
                <td><field name="actual_week_3"/></td>
                <td><field name="actual_week_4"/></td>
                <td><field name="actual_week_5"/></td>
                <td><field name="actual_week_6"/></td>
                <td><field name="actual_week_7"/></td>
                <td><field name="actual_week_8"/></td>
            </tr>
            <tr>
                <td>QC</td>
                <td><field name="qc_week_1"/></td>
                <td><field name="qc_week_2"/></td>
                <td><field name="qc_week_3"/></td>
                <td><field name="qc_week_4"/></td>
                <td><field name="qc_week_5"/></td>
                <td><field name="qc_week_6"/></td>
                <td><field name="qc_week_7"/></td>
                <td><field name="qc_week_8"/></td>
            </tr>
            <!-- Repeat the above block for additional products -->
        </tbody>
</table>

</div>
</templates>
<h3 style="text-decoration: underline;margin-bottom: 20px;">Production Transaction Detailed View</h3>
<field name="line_ids" readonly="1">
                <tree editable="bottom">
                    <field name="name"/>
                    <field name="date"/>
                    <field name="quantity"/>
                </tree>
            </field>
                     
                </sheet>
            </form>
        </field>
    </record>

    <!-- Tree View for FG Production Plan -->
    <record id="view_fg_production_plan_tree" model="ir.ui.view">
        <field name="name">sos_production_plan.tree</field>
        <field name="model">sos_production_plan</field>
        <field name="arch" type="xml">
            <tree string="FG Production Plan" decoration-danger="status == 'cancelled'"  decoration-success="status == 'completed'">
                <field name="plan_ref_no"/>
                <field name="fg_name"/>
                <field name="required_qty" string="Planned Qty"/>
                <field name="total" string="Completed Qty"/>
                <field name="status"/>
                
            </tree>
        </field>
    </record>

    <!-- Action for FG Production Plan -->
    <record id="action_fg_production_plan" model="ir.actions.act_window">
        <field name="name">Production Status</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">sos_production_plan</field>
        <field name="view_mode">tree,form</field>
        <field name="view_id" ref="view_fg_production_plan_tree"/>
         <field name="context">{'group_by': 'plan_ref_no'}</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Nil Production
            </p>
        </field>
    </record>

    <!-- Menu Item for FG Production Plan -->
    <menuitem id="production_fg_plan_menu"
              name="Production Status"
              parent="production_menu_root"
              action="action_fg_production_plan"/>
</odoo>
