98 lines
4.8 KiB
XML
98 lines
4.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- ============================================================ -->
|
|
<!-- WIZARD FORM VIEW: Create RFQ from PRs -->
|
|
<!-- ============================================================ -->
|
|
<record id="view_epr_create_rfq_wizard_form" model="ir.ui.view">
|
|
<field name="name">epr.create.rfq.wizard.form</field>
|
|
<field name="model">epr.create.rfq.wizard</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Create RFQ from Purchase Requests">
|
|
<sheet>
|
|
<div class="oe_title">
|
|
<h2>Batch Create RFQs</h2>
|
|
<p class="text-muted">
|
|
Review lines below. Assign a <b>Final Vendor</b> to group them.
|
|
Lines with the same Final Vendor will be merged into one RFQ.
|
|
</p>
|
|
</div>
|
|
|
|
<field name="line_ids" nolabel="1">
|
|
<list editable="bottom" create="0" delete="0"
|
|
decoration-danger="not final_vendor_id">
|
|
<!-- PR Reference (readonly) -->
|
|
<field name="request_id"
|
|
string="Source PR"
|
|
readonly="1"
|
|
force_save="1"
|
|
options="{'no_open': True}"/>
|
|
|
|
<!-- Product Description (now editable as requested) -->
|
|
<field name="product_description"/>
|
|
|
|
<!-- Final Product (editable - main action field) -->
|
|
<field name="final_product_id"
|
|
string="Final Product"
|
|
options="{'no_create': True}"
|
|
placeholder="Select Product to Group..."
|
|
decoration-bf="final_product_id"/>
|
|
|
|
<!-- Quantity -->
|
|
<field name="quantity"/>
|
|
<field name="price_unit" string="Est. Price"/>
|
|
|
|
<!-- UOM -->
|
|
<field name="uom_name" optional="show" string="PR UoM"/>
|
|
<field name="uom_id" groups="uom.group_uom" optional="show"/>
|
|
|
|
<!-- Suggested Vendor Text (readonly - for reference) -->
|
|
<field name="suggested_vendor_name"
|
|
string="Suggested Vendor"
|
|
decoration-muted="1"
|
|
optional="show"/>
|
|
|
|
<!-- Final Vendor (editable - main action field) -->
|
|
<field name="final_vendor_id"
|
|
string="Final Vendor"
|
|
options="{'no_create': True}"
|
|
placeholder="Select Vendor to Group..."
|
|
decoration-bf="final_vendor_id"/>
|
|
|
|
<!-- Hidden fields -->
|
|
<field name="pr_line_id" column_invisible="True"/>
|
|
</list>
|
|
</field>
|
|
</sheet>
|
|
|
|
<footer>
|
|
<button name="action_create_rfqs"
|
|
string="Create RFQ(s)"
|
|
type="object"
|
|
class="btn-primary"
|
|
data-hotkey="q"/>
|
|
<button string="Cancel"
|
|
class="btn-secondary"
|
|
special="cancel"
|
|
data-hotkey="z"/>
|
|
</footer>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ============================================================ -->
|
|
<!-- ACTION: Binding to PR List View -->
|
|
<!-- ============================================================ -->
|
|
<record id="action_epr_pr_create_rfq" model="ir.actions.act_window">
|
|
<field name="name">Create RFQ</field>
|
|
<field name="res_model">epr.create.rfq.wizard</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="target">new</field>
|
|
<!-- Binding to epr.purchase.request list view -->
|
|
<field name="binding_model_id" ref="model_epr_purchase_request"/>
|
|
<field name="binding_view_types">list</field>
|
|
<!-- Only Purchasing Officer and Admin can see this action -->
|
|
<field name="groups_id" eval="[(4, ref('epr.group_epr_purchasing_officer')), (4, ref('epr.group_epr_admin'))]"/>
|
|
</record>
|
|
|
|
</odoo>
|