Garment_ERP/addons/garment_erp/views/sale_order_views.xml
2026-09-21 16:43:23 +05:30

76 lines
4.0 KiB
XML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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>