76 lines
4.0 KiB
XML
76 lines
4.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<odoo>
|
||
|
||
<!-- Inherit Sale Order Form View -->
|
||
<record id="view_garment_sale_order_form" model="ir.ui.view">
|
||
<field name="name">garment.sale.order.form</field>
|
||
<field name="model">sale.order</field>
|
||
<field name="inherit_id" ref="sale.view_order_form"/>
|
||
<field name="arch" type="xml">
|
||
|
||
<!-- Smart Button for Production Plans -->
|
||
<xpath expr="//div[@name='button_box']" position="inside">
|
||
<button name="action_view_production_plans" type="object" class="oe_stat_button" icon="fa-industry" invisible="not is_garment_order">
|
||
<field name="production_plan_count" widget="statinfo" string="Production"/>
|
||
</button>
|
||
</xpath>
|
||
|
||
<!-- Garment Header Info -->
|
||
<xpath expr="//field[@name='partner_id']" position="after">
|
||
<field name="is_garment_order" invisible="1"/>
|
||
<field name="garment_style_id" options="{'no_create': True}" invisible="not is_garment_order"/>
|
||
<field name="buyer_id" invisible="not is_garment_order"/>
|
||
<field name="buyer_po_ref" invisible="not is_garment_order"/>
|
||
</xpath>
|
||
|
||
<xpath expr="//field[@name='payment_term_id']" position="after">
|
||
<field name="season_id" invisible="not is_garment_order"/>
|
||
<field name="ex_factory_date" invisible="not is_garment_order"/>
|
||
<field name="shipment_date" invisible="not is_garment_order"/>
|
||
<field name="shipment_mode" invisible="not is_garment_order"/>
|
||
<field name="destination_port" invisible="not is_garment_order"/>
|
||
<field name="total_garment_qty" invisible="not is_garment_order" class="fw-bold fs-5 text-primary"/>
|
||
</xpath>
|
||
|
||
<!-- Garment Order Matrix Page -->
|
||
<xpath expr="//notebook" position="inside">
|
||
<page string="Garment Order Matrix (Size × Color)" name="order_matrix_page" invisible="not is_garment_order">
|
||
<div class="mb-3 d-flex gap-2">
|
||
<button name="action_sync_matrix_to_order_lines" string="Sync Matrix to Order Lines" type="object" class="btn btn-primary btn-sm" icon="fa-refresh"/>
|
||
<button name="action_create_production_plan" string="Create Production Plan" type="object" class="btn btn-success btn-sm" icon="fa-play"/>
|
||
</div>
|
||
|
||
<separator string="Dynamic Size × Color Breakdown Matrix"/>
|
||
<div class="w-100 my-2">
|
||
<field name="matrix_html_summary" nolabel="1" class="w-100 d-block"/>
|
||
</div>
|
||
|
||
<separator string="Matrix Detail Entries (Color / Size / Quantity / Unit Price)"/>
|
||
<field name="order_matrix_line_ids">
|
||
<list editable="bottom">
|
||
<field name="color_id"/>
|
||
<field name="size_id"/>
|
||
<field name="quantity" sum="Total Pieces"/>
|
||
<field name="unit_price"/>
|
||
<field name="subtotal" sum="Total Amount"/>
|
||
</list>
|
||
</field>
|
||
</page>
|
||
</xpath>
|
||
|
||
</field>
|
||
</record>
|
||
|
||
<!-- Dedicated Garment Sales Orders Action & Menu -->
|
||
<record id="action_garment_sales_order" model="ir.actions.act_window">
|
||
<field name="name">Garment Sales Orders</field>
|
||
<field name="res_model">sale.order</field>
|
||
<field name="view_mode">list,form</field>
|
||
<field name="domain">[('is_garment_order', '=', True)]</field>
|
||
<field name="context">{'default_is_garment_order': True}</field>
|
||
</record>
|
||
|
||
<menuitem id="menu_garment_sales_order" name="Garment Sales Orders" parent="menu_garment_merchandising_root" action="action_garment_sales_order" sequence="20"/>
|
||
|
||
</odoo>
|