oca-ocb-core/odoo-bringout-oca-ocb-purchase/purchase/views/purchase_views.xml
Ernad Husremovic 2d3ee4855a 19.0 vanilla
2026-03-09 09:30:27 +01:00

944 lines
61 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Top menu item -->
<menuitem name="Purchase"
id="menu_purchase_root"
groups="group_purchase_manager,group_purchase_user"
web_icon="purchase,static/description/icon.png"
sequence="135"/>
<menuitem id="menu_procurement_management" name="Orders"
parent="menu_purchase_root" sequence="1" />
<!--Supplier menu-->
<menuitem id="menu_procurement_management_supplier_name" name="Vendors"
parent="menu_procurement_management"
action="account.res_partner_action_supplier" sequence="15"/>
<menuitem id="menu_purchase_config" name="Configuration" parent="menu_purchase_root" sequence="100" groups="group_purchase_manager"/>
<menuitem
action="product.product_supplierinfo_type_action" id="menu_product_pricelist_action2_purchase"
parent="menu_purchase_config" sequence="1"/>
<menuitem
id="menu_product_in_config_purchase" name="Products"
parent="menu_purchase_config" sequence="30"/>
<record model="ir.ui.menu" id="menu_product_in_config_purchase">
<field name="group_ids" eval="False"/>
</record>
<menuitem id="menu_product_attribute_action"
action="product.attribute_action" name="Attributes"
parent="purchase.menu_product_in_config_purchase" groups="product.group_product_variant" sequence="1"/>
<menuitem
action="product.product_category_action_form" id="menu_product_category_config_purchase"
parent="purchase.menu_product_in_config_purchase" sequence="3" />
<menuitem
action="uom.product_uom_form_action" id="menu_purchase_uom_form_action" name="Units &amp; Packagings"
parent="purchase.menu_product_in_config_purchase" sequence="10" groups="uom.group_uom"/>
<!-- Products Control Menu -->
<menuitem id="menu_purchase_products" name="Products" parent="purchase.menu_purchase_root" sequence="5"/>
<record id="product_normal_action_puchased" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">product.template</field>
<field name="path">purchase-products</field>
<field name="view_ids" eval="[Command.clear(),
Command.create({'view_mode': 'kanban'}),
Command.create({'view_mode': 'list', 'view_id': ref('account.product_template_list_view_purchasable_inherit')}),
Command.create({'view_mode': 'form'}),
Command.create({'view_mode': 'activity'})]"/>
<field name="context">{"search_default_filter_to_purchase":1, "purchase_product_template": 1}</field>
<field name="search_view_id" ref="product.product_template_search_view"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No product found. Let's create one!
</p><p>
You must define a product for everything you sell or purchase,
whether it's a storable product, a consumable or a service.
</p>
</field>
</record>
<!-- Product menu-->
<menuitem name="Products" id="menu_procurement_partner_contact_form" action="product_normal_action_puchased"
parent="menu_purchase_products" sequence="20"/>
<record id="product_product_action" model="ir.actions.act_window">
<field name="name">Product Variants</field>
<field name="res_model">product.product</field>
<field name="view_mode">list,kanban,form,activity</field>
<field name="search_view_id" ref="product.product_search_form_view"/>
<field name="context">{"search_default_filter_to_purchase": 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product variant
</p><p>
You must define a product for everything you sell or purchase,
whether it's a storable product, a consumable or a service.
</p>
</field>
</record>
<menuitem id="product_product_menu" name="Product Variants" action="product_product_action"
parent="menu_purchase_products" sequence="21" groups="product.group_product_variant"/>
<record model="ir.ui.view" id="purchase_order_calendar">
<field name="name">purchase.order.calendar</field>
<field name="model">purchase.order</field>
<field name="priority" eval="2"/>
<field name="arch" type="xml">
<calendar string="Calendar View" date_start="date_calendar_start" color="partner_id" hide_time="true" event_limit="5" create="false">
<field name="currency_id" invisible="1"/>
<field name="partner_ref"/>
<field name="amount_total" widget="monetary"/>
<field name="partner_id" filters="1"/>
</calendar>
</field>
</record>
<record model="ir.ui.view" id="purchase_order_pivot">
<field name="name">purchase.order.pivot</field>
<field name="model">purchase.order</field>
<field name="arch" type="xml">
<pivot string="Purchase Order" display_quantity="1" sample="1">
<field name="partner_id" type="row"/>
<field name="amount_total" type="measure"/>
</pivot>
</field>
</record>
<record model="ir.ui.view" id="purchase_order_graph">
<field name="name">purchase.order.graph</field>
<field name="model">purchase.order</field>
<field name="arch" type="xml">
<graph string="Purchase Order" sample="1">
<field name="partner_id"/>
<field name="amount_total" type="measure"/>
</graph>
</field>
</record>
<record id="purchase_order_form" model="ir.ui.view">
<field name="name">purchase.order.form</field>
<field name="model">purchase.order</field>
<field name="arch" type="xml">
<form string="Purchase Order" class="o_purchase_order">
<header>
<field name="locked" invisible="1"/>
<field name="lock_confirmed_po" invisible="1"/>
<button name="action_rfq_send" invisible="state != 'draft'" string="Send RFQ" type="object" context="{'send_rfq':True}" class="oe_highlight" data-hotkey="g"/>
<button name="button_confirm" type="object" invisible="state != 'sent'" string="Confirm Order" context="{'validate_analytic': True}" class="oe_highlight" id="bid_confirm" data-hotkey="q"/>
<button name="button_approve" type="object" invisible="state != 'to approve'" string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager" data-hotkey="z"/>
<button name="action_rfq_send" invisible="state != 'sent'" string="Send RFQ" type="object" context="{'send_rfq':True}" data-hotkey="g"/>
<button name="button_confirm" type="object" invisible="state != 'draft'" context="{'validate_analytic': True}" string="Confirm Order" id="draft_confirm" data-hotkey="q"/>
<widget name="purchase_file_uploader" invisible="state != 'purchase'"/>
<button name="action_rfq_send" invisible="state != 'purchase'" string="Send PO" type="object" context="{'send_rfq':False}" data-hotkey="g"/>
<button name="action_acknowledge" string="Acknowledge" type="object" invisible="acknowledged or state != 'purchase'"/>
<button name="button_draft" invisible="state != 'cancel'" string="Set to Draft" type="object" data-hotkey="o"/>
<button name="print_quotation" string="Print" type="object" groups="base.group_user" data-hotkey="k" invisible="state == 'purchase'"/>
<button name="%(purchase.action_report_purchase_order)d" string="Print" type="action" groups="base.group_user" data-hotkey="k" invisible="state != 'purchase'"/>
<button name="button_cancel" invisible="state not in ('draft', 'to approve', 'sent', 'purchase') or locked" string="Cancel" type="object" data-hotkey="x"/>
<button name="button_lock" type="object" string="Lock" invisible="locked or state != 'purchase' or not lock_confirmed_po == 'lock'" data-hotkey="l"/>
<button name="button_unlock" type="object" string="Unlock" invisible="not locked" groups="purchase.group_purchase_manager" data-hotkey="l"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,purchase" readonly="1"/>
</header>
<div class="alert alert-warning" role="alert" invisible="not purchase_warning_text">
<field name="purchase_warning_text" class="fw-bold"/>
</div>
<div
class="alert alert-warning w-100 d-flex align-items-center gap-1"
invisible="state != 'draft' or not duplicated_order_ids"
role="alert"
>
<span>Warning: this order might be a duplicate of</span>
<field
name="duplicated_order_ids"
widget="x2many_buttons"
string="Duplicated Documents"
/>
</div>
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button"
name="action_bill_matching"
type="object"
groups="account.group_account_invoice"
icon="fa-bullseye"
invisible="not partner_id or state != 'purchase' or not partner_bill_count or invoice_status == 'invoiced'">
<div class="o_field_statinfo">
<span class="o_stat_text">Bill Matching</span>
</div>
</button>
<button type="object" name="action_view_invoice"
class="oe_stat_button"
icon="fa-pencil-square-o" invisible="invoice_count == 0 or state in ('draft', 'sent', 'to approve')">
<field name="invoice_count" widget="statinfo" string="Vendor Bills"/>
<field name='invoice_ids' invisible="1"/>
</button>
<button type="object" name="action_purchase_comparison"
class="oe_stat_button" invisible="not show_comparison"
icon="fa-dollar">
<div class="o_field_statinfo">
<span class="o_stat_text">Price Comparison</span>
</div>
<field name="show_comparison" invisible="1"/>
</button>
</div>
<div class="badge rounded-pill text-bg-secondary float-end fs-6 border-0"
invisible="not locked">
<i class="fa fa-lock"/>
Locked
</div>
<div class="oe_title">
<span class="o_form_label" invisible="state not in ('draft', 'sent')">Request for Quotation </span>
<span class="o_form_label" invisible="state in ('draft', 'sent')">Purchase Order </span>
<h1 class="d-flex">
<field name="priority" widget="priority" class="me-3"/>
<field name="name" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="partner_id" widget="res_partner_many2one" context="{'res_partner_search_mode': 'supplier', 'show_vat': True}"
placeholder="Name, TIN, Email, or Reference"
readonly="state in ['cancel', 'purchase']"/>
<field name="partner_ref"/>
<field name="currency_id" groups="base.group_multi_currency" force_save="1" readonly="state in ['cancel', 'purchase']"/>
<field name="id" invisible="1"/>
<field name="company_id" invisible="1" readonly="state in ['cancel', 'purchase']"/>
<field name="currency_id" invisible="1" readonly="state in ['cancel', 'purchase']" groups="!base.group_multi_currency"/>
<field name="tax_calculation_rounding_method" invisible="1"/>
</group>
<group>
<field name="date_order" invisible="state == 'purchase'" readonly="state in ['cancel', 'purchase']"/>
<label for="date_approve" invisible="state != 'purchase'"/>
<div name="date_approve" invisible="state != 'purchase'" class="o_row">
<field name="date_approve"/>
</div>
<label for="date_planned"/>
<div name="date_planned_div" class="o_row">
<field name="date_planned" readonly="state not in ('draft', 'sent', 'to approve', 'purchase')"/>
</div>
<label for="receipt_reminder_email" class="d-none" groups="purchase.group_send_reminder"/>
<div name="reminder" class="o_row" groups='purchase.group_send_reminder' title="Automatically send a confirmation email to the vendor X days before the expected receipt date, asking him to confirm the exact date.">
<field name="receipt_reminder_email"/>
<span>Ask confirmation</span>
<div class="o_row oe_inline" invisible="not receipt_reminder_email">
<field name="reminder_date_before_receipt" class="oe_inline" style="max-width: 30px;"/>
day(s) before
<widget name='toaster_button' button_name="send_reminder_preview" title="Preview the reminder email by sending it to yourself." invisible="not id"/>
</div>
</div>
</group>
</group>
<notebook>
<page string="Products" name="products">
<field name="tax_country_id" invisible="1"/>
<field name="order_line"
widget="product_label_section_and_note_field_o2m"
mode="list,kanban"
context="{'default_state': 'draft'}"
readonly="state == 'cancel' or locked"
options="{ 'subsections': True }">
<list string="Purchase Order Lines" editable="bottom" limit="200"
decoration-warning="purchase_line_warn_msg">
<control>
<create name="add_product_control" string="Add a product"/>
<create name="add_section_control" string="Add a section" context="{'default_display_type': 'line_section'}"/>
<create name="add_note_control" string="Add a note" context="{'default_display_type': 'line_note'}"/>
<button name="action_add_from_catalog" string="Catalog" type="object" class="px-4 btn-link" context="{'order_id': parent.id}"/>
</control>
<field name="tax_calculation_rounding_method" column_invisible="True"/>
<field name="display_type" column_invisible="True"/>
<field name="company_id" column_invisible="True"/>
<field name="currency_id" column_invisible="True"/>
<field name="state" column_invisible="True"/>
<field name="product_type" column_invisible="True"/>
<field name="invoice_lines" column_invisible="True"/>
<field name="technical_price_unit" column_invisible="True"/>
<field name="sequence" widget="handle"/>
<!-- optional="show" allows name (description) to be editable -->
<field
name="product_id"
widget="product_label_section_and_note_field"
readonly="state in ('purchase', 'to approve', 'cancel') or is_downpayment"
required="not display_type and not is_downpayment"
optional="show"
context="{'partner_id':parent.partner_id, 'quantity':product_qty, 'company_id': parent.company_id}"
options="{'show_label_warning': True}"
force_save="1" domain="[('purchase_ok', '=', True), '|', ('company_id', '=', False), ('company_id', 'parent_of', parent.company_id)]"/>
<field name="name" widget="section_and_note_text" optional="show"/>
<field name="date_planned" optional="hide" required="not display_type and not is_downpayment" force_save="1" readonly="is_downpayment"/>
<field name="analytic_distribution" widget="analytic_distribution"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'purchase_order', 'amount_field': 'price_subtotal'}"/>
<field name="product_qty" readonly="is_downpayment"/>
<field name="qty_received_manual" column_invisible="True"/>
<field name="qty_received_method" column_invisible="True"/>
<field name="qty_received" string="Received" column_invisible="parent.state != 'purchase'" readonly="qty_received_method != 'manual' or is_downpayment" optional="show"/>
<field name="qty_invoiced" string="Billed" column_invisible="parent.state != 'purchase'" optional="show"/>
<field name="product_uom_id" groups="uom.group_uom"
readonly="state in ('purchase', 'cancel') or is_downpayment"
required="not display_type and not is_downpayment"
options="{'no_create': True, 'no_open': True, 'quantity_field': 'product_qty'}"
widget="many2one_uom"
force_save="1" optional="show"/>
<field name="price_unit" readonly="qty_invoiced != 0"/>
<field name="tax_ids" widget="many2many_tax_tags" domain="[('type_tax_use', '=', 'purchase'), ('company_id', 'parent_of', parent.company_id), ('country_id', '=', parent.tax_country_id), ('active', '=', True)]" context="{'default_type_tax_use': 'purchase', 'search_view_ref': 'account.account_tax_view_search'}" options="{'no_create': True}" optional="show" readonly="is_downpayment"/>
<field name="discount" string="Disc.%" width="50px" readonly="qty_invoiced != 0" optional="hide"/>
<field name="price_subtotal" string="Amount"/>
</list>
<form string="Purchase Order Line">
<field name="tax_calculation_rounding_method" invisible="1"/>
<field name="state" invisible="1"/>
<field name="display_type" invisible="1"/>
<field name="company_id" invisible="1"/>
<group invisible="display_type">
<group>
<field name="product_id"
context="{'partner_id': parent.partner_id}"
widget="many2one_barcode"
domain="[('purchase_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
readonly="state in ('purchase', 'to approve', 'cancel')"
/>
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom" required="not display_type and not is_downpayment" widget="many2one_uom"/>
</div>
<field name="qty_received_method" invisible="1"/>
<field name="qty_received" string="Received Quantity" invisible="parent.state != 'purchase'" readonly="qty_received_method != 'manual'"/>
<field name="qty_invoiced" string="Billed Quantity" invisible="parent.state != 'purchase'"/>
<field name="price_unit"/>
<field name="discount"/>
<field name="tax_ids" widget="many2many_tax_tags" domain="[('type_tax_use', '=', 'purchase'), ('company_id', 'parent_of', parent.company_id), ('country_id', '=', parent.tax_country_id)]" options="{'no_create': True}"/>
</group>
<group>
<field name="date_planned" required="not display_type and not is_downpayment"/>
<field name="analytic_distribution" widget="analytic_distribution"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'purchase_order'}"/>
</group>
<group>
<notebook colspan="4">
<page string="Notes" name="notes">
<field name="name"/>
</page>
<page string="Invoices and Incoming Shipments" name="invoices_incoming_shiptments">
<field name="invoice_lines"/>
</page>
</notebook>
</group>
</group>
<label for="name" string="Section Name (eg. Products, Services)" invisible="display_type != 'line_section'"/>
<label for="name" string="Subsection Name" invisible="display_type != 'line_subsection'"/>
<label for="name" string="Note" invisible="display_type != 'line_note'"/>
<field name="name" nolabel="1" invisible="not display_type"/>
</form>
<kanban class="o_kanban_mobile">
<field name="display_type"/>
<field name="tax_calculation_rounding_method"/>
<templates>
<t t-name="card">
<t t-if="!record.display_type.raw_value">
<div class="row">
<field name="product_id" class="fw-bold col-8"/>
<span class="fw-bold col-4">
Tax excl.: <field name="price_subtotal" class="float-end"/>
</span>
</div>
<div class="row">
<span class="col-8 text-muted">
Quantity:
<field name="product_qty" />
<field name="product_uom_id" groups="uom.group_uom" class="small"/>
</span>
<span class="fw-bold col-4" t-if="record.tax_calculation_rounding_method.raw_value === 'round_per_line'">
Tax incl.: <field name="price_total" />
</span>
</div>
<span class="text-muted">
Unit Price:
<field name="price_unit" />
</span>
<span class="text-muted" t-if="record.discount.raw_value">
Discount: <field name="discount" />%
</span>
</t>
<div t-elif="['line_section', 'line_subsection', 'line_note'].includes(record.display_type.raw_value)">
<div t-att-class="{
'fw-bolder': record.display_type.raw_value === 'line_section',
'fw-bold': record.display_type.raw_value === 'line_subsection',
'fst-italic': record.display_type.raw_value === 'line_note',
}">
<field name="name" />
</div>
</div>
</t>
</templates>
</kanban>
</field>
<group>
<group>
<field colspan="2" name="note" nolabel="1" placeholder="Define your terms and conditions ..."/>
</group>
<group class="oe_subtotal_footer">
<field name="tax_totals" widget="account-tax-totals-field" nolabel="1" readonly="1"/>
</group>
</group>
<div class="clearfix"/>
</page>
<page string="Other Information" name="purchase_delivery_invoice">
<group>
<group name="other_info">
<field name="user_id" domain="[('share', '=', False)]" widget="many2one_avatar_user"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" readonly="state in ['cancel', 'purchase']"/>
<field name="origin"/>
</group>
<group name="invoice_info">
<field name="invoice_status" invisible="state in ('draft', 'sent', 'to approve', 'cancel')"/>
<field name="payment_term_id" readonly="invoice_status == 'invoiced' or locked" options="{'no_create': True}"/>
<field name="fiscal_position_id" options="{'no_create': True}" readonly="invoice_status == 'invoiced' or locked"/>
</group>
</group>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="view_purchase_order_filter" model="ir.ui.view">
<field name="name">request.quotation.select</field>
<field name="model">purchase.order</field>
<field name="arch" type="xml">
<search string="Search Purchase Order">
<field name="name" string="Order"
filter_domain="['|', '|', ('name', 'ilike', self), ('partner_ref', 'ilike', self), ('partner_id', 'child_of', self)]"/>
<field name="partner_id" operator="child_of"/>
<field name="user_id"/>
<field name="product_id"/>
<field name="origin"/>
<filter name="my_purchases" string="My Purchases" domain="[('user_id', '=', uid)]"/>
<filter string="Starred" name="starred" domain="[('priority', '=', '1')]"/>
<separator/>
<filter name="to_approve" string="To Approve" domain="[('state', '=', 'to approve')]" invisible="1"/>
<separator/>
<filter name="draft_rfqs" string="New" domain="[('state', '=', 'draft')]"/>
<filter name="waiting_rfqs" string="Sent" domain="[('state', '=', 'sent')]"/>
<filter name="approved" string="Purchase Orders" domain="[('state', '=', 'purchase')]"/>
<separator/>
<filter name="late" string="Late" domain="[('state', 'in', ['draft', 'sent', 'to approve']),('date_order', '&lt;', 'now')]"/>
<filter name="not_acknowledged" string="Not Acknowledged" domain="[('state', 'in', ['purchase', 'done']), ('acknowledged', '=', False)]"/>
<filter name="late_receipt" string="Late Receipts" domain="[('state', 'in', ['purchase', 'done']), ('is_late', '=', True)]"/>
<separator/>
<filter name="order_date" string="Order Date" date="date_order"/>
<filter invisible="1" string="My Activities" name="filter_activities_my"
domain="[('activity_user_id', '=', uid)]"/>
<separator invisible="1"/>
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', 'today')]"
help="Show all records whose next activity date is past"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', 'today')]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '&gt;', 'today')]"/>
<separator/>
<filter string="Warnings" name="activities_exception"
domain="[('activity_exception_decoration', '!=', False)]"/>
<group>
<filter string="Vendor" name="vendor" domain="[]" context="{'group_by': 'partner_id'}"/>
<filter string="Buyer" name="representative" domain="[]" context="{'group_by': 'user_id'}"/>
<filter string="Order Date" name="order_date" domain="[]" context="{'group_by': 'date_order'}"/>
</group>
</search>
</field>
</record>
<record id="purchase_order_view_search" model="ir.ui.view">
<field name="name">purchase.order.select</field>
<field name="model">purchase.order</field>
<field name="arch" type="xml">
<search string="Search Purchase Order">
<field name="name" string="Order"
filter_domain="['|', '|', ('name', 'ilike', self), ('partner_ref', 'ilike', self), ('partner_id', 'child_of', self)]"/>
<field name="partner_id" operator="child_of"/>
<field name="user_id"/>
<field name="product_id"/>
<field name="activity_user_id" string="Activities of"/>
<field name="activity_type_id" string="Activity type"/>
<filter name="my_Orders" string="My Orders" domain="[('user_id', '=', uid)]"/>
<filter string="Starred" name="starred" domain="[('priority', '=', '1')]"/>
<separator/>
<filter name="not_invoiced" string="Waiting Bills" domain="[('invoice_status', '=', 'to invoice')]" help="Purchase orders that include lines not invoiced."/>
<filter name="invoiced" string="Bills Received" domain="[('invoice_status', '=', 'invoiced')]" help="Purchase orders that have been invoiced."/>
<separator/>
<filter name="order_date" string="Order Date" date="date_order"/>
<separator/>
<filter invisible="1" string="My Activities" name="filter_activities_my"
domain="[('activity_user_id', '=', uid)]"/>
<separator invisible="1"/>
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', 'today')]"
help="Show all records whose next activity date is past"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', 'today')]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '&gt;', 'today')]"/>
<separator/>
<filter string="Warnings" name="activities_exception"
domain="[('activity_exception_decoration', '!=', False)]"/>
<group>
<filter string="Vendor" name="vendor" domain="[]" context="{'group_by': 'partner_id'}"/>
<filter string="Buyer" name="representative" domain="[]" context="{'group_by': 'user_id'}"/>
<filter string="Order Date" name="order_date" domain="[]" context="{'group_by': 'date_order'}"/>
</group>
</search>
</field>
</record>
<!-- Purchase Orders Kanban View -->
<record model="ir.ui.view" id="view_purchase_order_kanban">
<field name="name">purchase.order.kanban</field>
<field name="model">purchase.order</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" js_class="purchase_dashboard_kanban" sample="1" quick_create="false">
<field name="date_order"/>
<field name="currency_id"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="card">
<div class="d-flex align-items-baseline">
<field name="priority" widget="priority" class="mt-1 me-1"/>
<field name="partner_id" class="fw-bolder fs-5 me-2"/>
<field name="amount_total" widget="monetary" class="fw-bolder ms-auto flex-shrink-0"/>
</div>
<footer class="align-items-end">
<div class="d-flex flex-wrap gap-1 text-nowrap">
<field name="name"/>
<field name="date_order" options="{'show_time': false}"/>
<field name="activity_ids" widget="kanban_activity"/>
</div>
<field name="state" widget="label_selection" options="{'classes': {'draft': 'default', 'cancel': 'default', 'approved': 'warning'}}" class="ms-auto"/>
</footer>
</t>
</templates>
</kanban>
</field>
</record>
<record id="purchase_order_view_kanban_without_dashboard" model="ir.ui.view">
<field name="name">purchase.order.view.kanban.without.dashboard</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.view_purchase_order_kanban"/>
<field name="mode">primary</field>
<field name="priority">20</field>
<field name="arch" type="xml">
<xpath expr="//kanban" position="attributes">
<attribute name="js_class"/>
</xpath>
</field>
</record>
<record id="purchase_order_tree" model="ir.ui.view">
<field name="name">purchase.order.list</field>
<field name="model">purchase.order</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<list string="Purchase Order"
decoration-muted="state=='cancel'" sample="1">
<field name="priority" optional="show" widget="priority" nolabel="1"/>
<field name="partner_ref" optional="hide"/>
<field name="name" string="Reference" readonly="1" decoration-info="state in ('draft','sent')"/>
<field name="date_order" column_invisible="not context.get('quotation_only', False)" readonly="state in ['cancel', 'purchase']" optional="show"/>
<field name="date_approve" column_invisible="context.get('quotation_only', False)" optional="show"/>
<field name="partner_id" readonly="1"/>
<field name="company_id" readonly="1" options="{'no_create': True}"
groups="base.group_multi_company" optional="show"/>
<field name="activity_ids" string="Next Activity" widget="list_activity"/>
<field name="user_id" optional="show"/>
<field name="origin" optional="hide"/>
<field name="amount_untaxed" sum="Total Untaxed amount" string="Untaxed" widget="monetary" optional="hide"/>
<field name="amount_total" sum="Total amount" widget="monetary" optional="show"/>
<field name="currency_id" column_invisible="True" readonly="state in ['cancel', 'purchase']"/>
<field name="state" optional="show"/>
<field name="date_planned" column_invisible="context.get('quotation_only', False)" optional="show"/>
<field name="invoice_status" column_invisible="context.get('quotation_only', False)" optional="hide"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
</list>
</field>
</record>
<!-- Unfortunately we want the purchase kpis table to only show up in some list views,
so we have to duplicate code to support both view versions -->
<record id="purchase_order_kpis_tree" model="ir.ui.view">
<field name="name">purchase.order.inherit.purchase.order.list</field>
<field name="model">purchase.order</field>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<list string="Purchase Order" decoration-info="state in ['draft', 'sent']"
decoration-muted="state == 'cancel'"
multi_edit="1"
class="o_purchase_order" js_class="purchase_dashboard_list" sample="1">
<header>
<button name="button_cancel" type="object" string="Cancel"
confirm="Are you sure you want to cancel the selected RFQs/Orders?"/>
</header>
<field name="priority" optional="show" widget="priority" nolabel="1"/>
<field name="partner_ref" optional="hide"/>
<field name="name" string="Reference" readonly="1" decoration-bf="1"/>
<field name="date_approve" column_invisible="context.get('quotation_only', False)" optional="show"/>
<field name="partner_id" readonly="1"/>
<field name="company_id" readonly="1" options="{'no_create': True}"
groups="base.group_multi_company" optional="show"/>
<field name="company_id" groups="!base.group_multi_company" column_invisible="True" readonly="state in ['cancel', 'purchase']"/>
<field name="date_planned" column_invisible="context.get('quotation_only', False)" optional="show"/>
<field name="user_id" optional="show" widget="many2one_avatar_user"/>
<field name="date_order"
invisible="state == 'purchase' or state == 'cancel'"
column_invisible="not context.get('quotation_only', False)"
readonly="state in ['cancel', 'purchase']" widget="remaining_days" optional="show"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="origin" optional="hide"/>
<field name="amount_untaxed" sum="Total Untaxed amount" string="Untaxed" widget="monetary" optional="hide"/>
<field name="amount_total" sum="Total amount" widget="monetary" optional="show" decoration-bf="state == 'purchase'"/>
<field name="currency_id" column_invisible="True" readonly="state in ['cancel', 'purchase']"/>
<field name="amount_total_cc" sum="Total amount" widget="monetary" optional="hide"/>
<field name="company_currency_id" column_invisible="True"/>
<field name="state" optional="show" widget="badge" decoration-success="state == 'purchase'"
decoration-warning="state == 'to approve'" decoration-info="state == 'draft' or state == 'sent'"/>
<field name="invoice_status" optional="hide"/>
</list>
</field>
</record>
<record id="purchase_order_view_tree" model="ir.ui.view">
<field name="name">purchase.order.view.list</field>
<field name="model">purchase.order</field>
<field name="arch" type="xml">
<list decoration-muted="state == 'cancel'"
decoration-info="invoice_status == 'to invoice'"
string="Purchase Order"
class="o_purchase_order"
multi_edit="1"
sample="1">
<header>
<button name="action_create_invoice" type="object" string="Create Bills"/>
<button name="button_cancel" type="object" string="Cancel"
confirm="Are you sure you want to cancel the selected RFQs/Orders?"/>
</header>
<field name="priority" optional="show" widget="priority" nolabel="1"/>
<field name="partner_ref" optional="hide"/>
<field name="name" string="Reference" readonly="1" decoration-bf="1" decoration-info="state in ('draft','sent')"/>
<field name="date_approve" column_invisible="context.get('quotation_only', False)" optional="show"/>
<field name="partner_id" readonly="state in ['cancel', 'purchase']"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" optional="show" readonly="state in ['cancel', 'purchase']"/>
<field name="company_id" groups="!base.group_multi_company" column_invisible="True" readonly="state in ['cancel', 'purchase']"/>
<field name="user_id" widget="many2one_avatar_user" optional="show"/>
<field name="date_order" column_invisible="not context.get('quotation_only', False)" readonly="state in ['cancel', 'purchase']" optional="show"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="origin" optional="show"/>
<field name="amount_untaxed" sum="Total Untaxed amount" string="Untaxed" widget="monetary" optional="hide"/>
<field name="amount_total" sum="Total amount" widget="monetary" optional="show" decoration-bf="1"/>
<field name="currency_id" column_invisible="True" readonly="state in ['cancel', 'purchase']"/>
<field name="state" column_invisible="True"/>
<field name="amount_total_cc" sum="Total amount" widget="monetary" optional="hide"/>
<field name="company_currency_id" column_invisible="True"/>
<field name="invoice_status" widget="badge" decoration-success="invoice_status == 'invoiced'" decoration-info="invoice_status == 'to invoice'" optional="show"/>
<field name="date_planned" column_invisible="context.get('quotation_only', False)" optional="show"/>
</list>
</field>
</record>
<record id="purchase_order_view_activity" model="ir.ui.view">
<field name="name">purchase.order.activity</field>
<field name="model">purchase.order</field>
<field name="arch" type="xml">
<activity string="Purchase Order">
<field name="currency_id"/>
<templates>
<div t-name="activity-box" class="d-block">
<div class="d-flex justify-content-between">
<field name="name" display="full" class="o_text_block o_text_bold"/>
<div class="m-1"/>
<field name="amount_total" widget="monetary"/>
</div>
<div class="d-flex justify-content-between">
<field name="partner_id" muted="1" display="full" class="o_text_block"/>
<div class="m-1"/>
<field name="state" widget="badge"
decoration-success="state == 'purchase'"
decoration-warning="state == 'to approve'"
decoration-info="state == 'draft' or state == 'sent'"/>
</div>
</div>
</templates>
</activity>
</field>
</record>
<record id="purchase_rfq" model="ir.actions.act_window">
<field name="name">Requests for Quotation</field>
<field name="path">purchase</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">list,kanban,form,pivot,graph,calendar,activity</field>
<field name="view_id" ref="purchase_order_kpis_tree"/>
<field name="domain">[]</field>
<field name="search_view_id" ref="view_purchase_order_filter"/>
<field name="context">{'quotation_only': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No request for quotation found. Let's create one!
</p><p>
Requests for quotation are documents that will be sent to your suppliers to request prices for different products you consider buying.
Once an agreement has been found with the supplier, they will be confirmed and turned into purchase orders.
</p>
</field>
</record>
<menuitem action="purchase_rfq" id="menu_purchase_rfq"
parent="menu_procurement_management"
sequence="0"/>
<record id="purchase_form_action" model="ir.actions.act_window">
<field name="name">Purchase Orders</field>
<field name="res_model">purchase.order</field>
<field name="path">purchase-orders</field>
<field name="view_mode">list,kanban,form,pivot,graph,calendar,activity</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'list', 'view_id': ref('purchase.purchase_order_view_tree')}),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('purchase.purchase_order_view_kanban_without_dashboard')}),
]"/>
<field name="domain">[('state','=', 'purchase')]</field>
<field name="search_view_id" ref="purchase_order_view_search"/>
<field name="context">{}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No purchase order found. Let's create one!
</p><p>
Once you ordered your products to your supplier, confirm your request for quotation and it will turn into a purchase order.
</p>
</field>
</record>
<menuitem action="purchase_form_action" id="menu_purchase_form_action" parent="menu_procurement_management" sequence="6"/>
<record id="purchase_order_line_tree" model="ir.ui.view">
<field name="name">purchase.order.line.list</field>
<field name="model">purchase.order.line</field>
<field name="arch" type="xml">
<list string="Purchase Order Lines" create="false">
<field name="order_id"/>
<field name="name"/>
<field name="partner_id" string="Vendor" />
<field name="product_id"/>
<field name="price_unit"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom" widget="many2one_uom"/>
<field name="price_subtotal" widget="monetary"/>
<field name="currency_id" column_invisible="True"/>
<field name="date_planned"/>
</list>
</field>
</record>
<record id="purchase_order_line_form2" model="ir.ui.view">
<field name="name">purchase.order.line.form2</field>
<field name="model">purchase.order.line</field>
<field name="priority" eval="20"/>
<field name="arch" type="xml">
<form string="Purchase Order Line" create="false">
<sheet>
<label for="order_id"/>
<h1>
<field name="order_id" class="oe_inline"/>
<label string="," for="date_order" invisible="not date_order"/>
<field name="date_order" class="oe_inline"/>
</h1>
<label for="partner_id"/>
<h2><field name="partner_id"/></h2>
<group>
<group>
<field name="product_id" readonly="1"/>
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty" readonly="1"/>
<field name="product_uom_id" readonly="1" groups="uom.group_uom"/>
</div>
<field name="price_unit"/>
</group>
<group>
<field name="tax_ids" widget="many2many_tax_tags"
domain="[('type_tax_use', '=', 'purchase')]"/>
<field name="date_planned" readonly="1"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
<field name="analytic_distribution" widget="analytic_distribution"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'purchase_order'}"/>
</group>
</group>
<field name="name"/>
<separator string="Manual Invoices"/>
<field name="invoice_lines"/>
</sheet>
</form>
</field>
</record>
<record id="purchase_order_line_search" model="ir.ui.view">
<field name="name">purchase.order.line.search</field>
<field name="model">purchase.order.line</field>
<field name="arch" type="xml">
<search string="Search Purchase Order">
<field name="order_id"/>
<field name="product_id"/>
<field name="partner_id" string="Vendor"/>
<filter name="hide_cancelled" string="Hide cancelled lines" domain="[('state', '!=', 'cancel')]"/>
<filter string="Status" name="purchase_state" domain="[('state', '=', 'purchase')]"/>
<separator/>
<filter name="filter_date_order" date="date_order" default_period="month"/>
<filter name="order_date_last_year" string="Order Date: Last 365 Days"
domain="[
('date_order', '>', 'today -1y')
]" invisible="1"/>
<group>
<filter name="groupby_supplier" string="Vendor" domain="[]" context="{'group_by' : 'partner_id'}" />
<filter name="groupby_product" string="Product" domain="[]" context="{'group_by' : 'product_id'}" />
<filter string="Order Reference" name="order_reference" domain="[]" context="{'group_by' :'order_id'}"/>
<separator/>
<filter string="Order Date" name="group_by_date_order" context="{'group_by': 'date_order'}"/>
</group>
</search>
</field>
</record>
<record id="purchase_history_tree" model="ir.ui.view">
<field name="name">purchase.history.list</field>
<field name="model">purchase.order.line</field>
<field name="arch" type="xml">
<list create="false" default_order="order_id asc"
decoration-info="order_id == context.get('active_id')"
action="action_open_order" type="object">
<field name="currency_id" column_invisible="True"/>
<field name="order_id" widget="many2one"/>
<field name="date_approve"/>
<field name="partner_id" string="Vendor"/>
<field name="company_id" optional="show" groups="base.group_multi_company"/>
<field name="product_uom_qty" string="Quantity"/>
<field name="price_unit_product_uom" widget="monetary" string="Unit Price"/>
<field name="price_subtotal" widget="monetary" string="Total Untaxed"/>
<field name="state" optional="hide"/>
</list>
</field>
</record>
<record id="purchase_history_pivot" model="ir.ui.view">
<field name="name">purchase.history.pivot</field>
<field name="model">purchase.order.line</field>
<field name="arch" type="xml">
<pivot>
<field name="price_total" string="Total purchased amount" type="measure"/>
<field name="product_uom_qty" string="Total Qty purchased" type="measure"/>
</pivot>
</field>
</record>
<record id="purchase_history_graph" model="ir.ui.view">
<field name="name">purchase.history.graph</field>
<field name="model">purchase.order.line</field>
<field name="arch" type="xml">
<graph type="line">
<field name="date_order" interval="month"/>
<field name="product_uom_qty" type="measure"/>
</graph>
</field>
</record>
<record id="action_purchase_history" model="ir.actions.act_window">
<field name="res_model">purchase.order.line</field>
<field name="view_mode">list,pivot,graph</field>
<field name="view_id" ref="purchase.purchase_history_tree"/>
<field name="context">{
'search_default_order_date_last_year': 1,
'search_default_groupby_product': 1,
}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No purchase order were made for this product yet!
</p>
</field>
</record>
<record id="action_purchase_send_reminder" model="ir.actions.server">
<field name="name">Send Reminder</field>
<field name="model_id" ref="purchase.model_purchase_order"/>
<field name="binding_model_id" ref="purchase.model_purchase_order"/>
<field name='group_ids' eval="[(4, ref('purchase.group_send_reminder'))]"/>
<field name="binding_view_types">form</field>
<field name="state">code</field>
<field name="code">
if records:
action = records._send_reminder_mail(send_single=True)
</field>
</record>
<record id="action_accrued_expense_entry" model="ir.actions.act_window">
<field name="name">Accrued Expense Entry</field>
<field name="res_model">account.accrued.orders.wizard</field>
<field name="view_mode">form</field>
<field name="binding_model_id" ref="purchase.model_purchase_order"/>
<field name="group_ids" eval="[(4, ref('account.group_account_user'))]"/>
<field name="target">new</field>
</record>
<record id="action_merger" model="ir.actions.server">
<field name="name">Merge RFQs</field>
<field name="model_id" ref="purchase.model_purchase_order"/>
<field name="binding_model_id" ref="purchase.model_purchase_order"/>
<field name='group_ids' eval="[(4, ref('account.group_account_invoice'))]"/>
<field name="state">code</field>
<field name="sequence">1</field>
<field name="binding_view_types">list</field>
<field name="code">
if records:
action = records.action_merge()
</field>
</record>
<record id="action_rfq_form" model="ir.actions.act_window">
<field name="name">Requests for Quotation</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">form</field>
<field name="view_id" ref="purchase.purchase_order_form"/>
<field name="search_view_id" ref="view_purchase_order_filter"/>
<field name="target">main</field>
</record>
<record id="action_confirm_rfqs" model="ir.actions.server">
<field name="name">Confirm RFQ</field>
<field name="model_id" ref="purchase.model_purchase_order"/>
<field name="binding_model_id" ref="purchase.model_purchase_order"/>
<field name="binding_view_types">list,kanban</field>
<field name="state">code</field>
<field name="code">
if records:
res = records.button_confirm()
if isinstance(res, dict):
action = res
</field>
</record>
<record id="mail_followers_edit_action_from_purchase" model="ir.actions.act_window">
<field name="name">Add/Remove Followers</field>
<field name="res_model">mail.followers.edit</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="context">{'default_res_model': 'purchase.order', 'default_res_ids': active_ids}</field>
<field name="binding_model_id" ref="purchase.model_purchase_order"/>
<field name="binding_view_types">list,kanban</field>
</record>
</odoo>