This commit is contained in:
gsinghpal
2026-04-14 08:05:56 -04:00
parent d3c8782505
commit b62d4b1f36
15 changed files with 1272 additions and 30 deletions

View File

@@ -80,9 +80,35 @@
invisible="not model_attachment_id"/>
</div>
<field name="surface_area_uom"/>
<field name="masking_area_sqin"/>
<field name="effective_area_sqin" readonly="1"/>
<field name="weight"/>
<field name="material_weight_kg" readonly="1"/>
</group>
</group>
<!-- Auto-extracted geometry from 3D model -->
<group string="3D Model Analysis"
invisible="not volume_mm3 and not bbox_summary_in and hole_count == 0">
<group>
<field name="bbox_summary_in" readonly="1"/>
<field name="volume_mm3" readonly="1"/>
<field name="bbox_length_mm" invisible="1"/>
<field name="bbox_width_mm" invisible="1"/>
<field name="bbox_height_mm" invisible="1"/>
</group>
<group>
<field name="hole_count" readonly="1"/>
<field name="hole_summary" readonly="1" invisible="not hole_summary"/>
<field name="is_manifold" widget="boolean_toggle" readonly="1"/>
</group>
<div class="alert alert-warning mb-0"
colspan="2"
invisible="is_manifold or not model_attachment_id">
<i class="fa fa-exclamation-triangle me-1"/>
<strong>Geometry warning:</strong> 3D model is not watertight (manifold).
This often indicates open shells or invalid surfaces. Review before quoting.
</div>
</group>
<notebook>
<page string="Dimensions &amp; Complexity" name="dimensions">
<group>
@@ -106,7 +132,7 @@
<page string="Attachments" name="attachments">
<group>
<field name="model_attachment_id"/>
<field name="drawing_attachment_ids" widget="many2many_binary"/>
<field name="drawing_attachment_ids" widget="fp_pdf_preview_binary"/>
</group>
<div invisible="not model_attachment_id" class="mt-3">
<field name="model_attachment_id" widget="fp_3d_preview" nolabel="1"/>

View File

@@ -49,6 +49,33 @@
invisible="not part_catalog_id">
<field name="part_catalog_id" widget="statinfo" string="Part"/>
</button>
<button name="action_view_drawings"
type="object"
class="oe_stat_button"
icon="fa-file-pdf-o"
invisible="drawing_count == 0">
<field name="drawing_count" widget="statinfo" string="Drawings"/>
</button>
<button name="action_view_rfq"
type="object"
class="oe_stat_button"
icon="fa-envelope-o"
invisible="not rfq_attachment_id">
<div class="o_stat_info">
<span class="o_stat_value">1</span>
<span class="o_stat_text">RFQ</span>
</div>
</button>
<button name="action_view_po"
type="object"
class="oe_stat_button"
icon="fa-file-o"
invisible="not po_attachment_id">
<div class="o_stat_info">
<span class="o_stat_value">1</span>
<span class="o_stat_text">PO</span>
</div>
</button>
</div>
<div class="oe_title">
<h1>
@@ -65,16 +92,47 @@
<field name="partner_id"/>
<field name="part_catalog_id"/>
<field name="coating_config_id"/>
<!-- 3D File: upload before, filename + clear button after -->
<field name="upload_3d_file" filename="upload_3d_filename"
invisible="state != 'draft'"
invisible="state != 'draft' or model_attachment_id"
string="Attach 3D File"/>
<field name="upload_3d_filename" invisible="1"/>
<field name="model_attachment_id"
string="3D Model"
invisible="not model_attachment_id"
readonly="state != 'draft'"/>
<!-- Drawing: upload before, filename + clear button after -->
<field name="upload_drawing" filename="upload_drawing_filename"
invisible="state != 'draft'"
invisible="state != 'draft' or drawing_count > 0"
string="Attach Drawing"/>
<field name="upload_drawing_filename" invisible="1"/>
<field name="first_drawing_id"
string="Drawing"
invisible="drawing_count == 0"
readonly="state != 'draft'"/>
<field name="drawing_count" invisible="1"/>
</group>
<group string="Quantity &amp; Options">
<group string="RFQ / PO Documents">
<field name="upload_rfq_file"
filename="upload_rfq_filename"
invisible="state != 'draft' or rfq_attachment_id"
string="Attach RFQ"/>
<field name="upload_rfq_filename" invisible="1"/>
<field name="rfq_attachment_id"
invisible="not rfq_attachment_id"
readonly="state != 'draft'"/>
<field name="upload_po_file"
filename="upload_po_filename"
invisible="state != 'draft' or po_attachment_id"
string="Attach PO"/>
<field name="upload_po_filename" invisible="1"/>
<field name="po_attachment_id"
invisible="not po_attachment_id"
readonly="state != 'draft'"/>
<field name="po_number_preliminary"
string="PO Number"
readonly="state != 'draft'"/>
<separator string="Quantity &amp; Options"/>
<field name="quantity"/>
<field name="batch_size"/>
<field name="complexity"/>
@@ -85,11 +143,42 @@
<group string="Geometry">
<field name="surface_area"/>
<field name="surface_area_uom"/>
<field name="masking_area_sqin"
string="Masking Area (sq in)"/>
<field name="effective_area_sqin"
string="Effective Plating Area"
readonly="1"/>
<field name="thickness_requested"/>
<field name="substrate_material"/>
<field name="masking_zones"/>
<field name="turnaround_days"/>
</group>
<group string="Auto from 3D"
invisible="not part_catalog_id">
<field name="bbox_summary_in"
string="Dimensions"
readonly="1"/>
<field name="material_weight_kg"
string="Weight (kg)"
readonly="1"/>
<field name="hole_count"
string="Holes Detected"
readonly="1"/>
<field name="hole_summary"
readonly="1"
invisible="not hole_summary"/>
<field name="is_manifold"
widget="boolean_toggle"
readonly="1"/>
</group>
</group>
<div class="alert alert-warning"
invisible="is_manifold or not part_catalog_id or not hole_count">
<i class="fa fa-exclamation-triangle me-1"/>
<strong>Warning:</strong> 3D model is not watertight.
Surface area calculation may be inaccurate. Review the file before quoting.
</div>
<group>
<group string="Delivery &amp; Fees">
<field name="delivery_method"/>
<field name="shipping_fee"/>
@@ -112,15 +201,35 @@
</group>
</div>
<!-- RIGHT COLUMN: 3D preview (sticky) -->
<div class="o_fp_cfg_preview" invisible="not model_attachment_id">
<field name="model_attachment_id" widget="fp_3d_preview" nolabel="1"/>
<div class="text-center mt-2">
<button name="action_open_3d_fullscreen"
string="Full Screen"
type="object"
class="btn btn-sm btn-outline-primary"
icon="fa-expand"/>
<!-- RIGHT COLUMN: 3D preview + Drawings preview (sticky) -->
<div class="o_fp_cfg_preview"
invisible="not model_attachment_id and drawing_count == 0">
<!-- 3D viewer -->
<div invisible="not model_attachment_id">
<field name="model_attachment_id" widget="fp_3d_preview" nolabel="1"/>
<div class="text-center mt-2">
<button name="action_open_3d_fullscreen"
string="Full Screen"
type="object"
class="btn btn-sm btn-outline-primary"
icon="fa-expand"/>
</div>
</div>
<!-- Drawings preview (custom OWL widget — fixed height, full screen button) -->
<div invisible="drawing_count == 0" class="mt-3">
<span class="o_form_label fw-bold text-muted small d-block mb-1">Drawing Preview</span>
<field name="first_drawing_id"
widget="fp_pdf_inline_preview"
nolabel="1"
readonly="1"/>
<!-- Multi-drawing list shown only when more than one -->
<div invisible="drawing_count &lt; 2" class="mt-2">
<span class="o_form_label fw-bold text-muted small d-block mb-1">All Drawings</span>
<field name="drawing_attachment_ids"
widget="fp_pdf_preview_binary"
nolabel="1"
readonly="1"/>
</div>
</div>
</div>
</div>

View File

@@ -12,6 +12,28 @@
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
<button name="action_view_rfq"
type="object"
class="oe_stat_button"
icon="fa-envelope-o"
invisible="not x_fc_rfq_attachment_id">
<div class="o_stat_info">
<span class="o_stat_value">1</span>
<span class="o_stat_text">RFQ</span>
</div>
</button>
<button name="action_view_po"
type="object"
class="oe_stat_button"
icon="fa-file-o"
invisible="not x_fc_po_attachment_id">
<div class="o_stat_info">
<span class="o_stat_value">1</span>
<span class="o_stat_text">PO</span>
</div>
</button>
</xpath>
<xpath expr="//notebook" position="inside">
<page string="Plating" name="plating_tab">
<group>
@@ -20,9 +42,22 @@
<field name="x_fc_part_catalog_id"/>
<field name="x_fc_coating_config_id"/>
</group>
<group string="Customer PO">
<group string="RFQ / PO">
<field name="x_fc_po_number"/>
<field name="x_fc_po_attachment_id"/>
<field name="upload_rfq_file"
filename="upload_rfq_filename"
invisible="x_fc_rfq_attachment_id"
string="Attach RFQ"/>
<field name="upload_rfq_filename" invisible="1"/>
<field name="x_fc_rfq_attachment_id"
invisible="not x_fc_rfq_attachment_id"/>
<field name="upload_po_file"
filename="upload_po_filename"
invisible="x_fc_po_attachment_id"
string="Attach PO"/>
<field name="upload_po_filename" invisible="1"/>
<field name="x_fc_po_attachment_id"
invisible="not x_fc_po_attachment_id"/>
<field name="x_fc_po_received"/>
<field name="x_fc_po_override"
groups="fusion_plating.group_fusion_plating_manager"/>