Initial commit: Core packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:45 +02:00
commit 12c29a983b
9512 changed files with 8379910 additions and 0 deletions

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_move_form_inherit_purchase" model="ir.ui.view">
<field name="name">account.move.inherit.purchase</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<!-- Auto-complete could be done from either a bill either a purchase order -->
<field name="invoice_vendor_bill_id" position="after">
<t groups="purchase.group_purchase_user">
<field name="purchase_id" invisible="1"/>
<label for="purchase_vendor_bill_id" string="Auto-Complete" class="oe_edit_only"
attrs="{'invisible': ['|', ('state','!=','draft'), ('move_type', '!=', 'in_invoice')]}" />
<field name="purchase_vendor_bill_id" nolabel="1"
attrs="{'invisible': ['|', ('state','!=','draft'), ('move_type', '!=', 'in_invoice')]}"
class="oe_edit_only"
domain="partner_id and [('company_id', '=', company_id), ('partner_id.commercial_partner_id', '=', commercial_partner_id)] or [('company_id', '=', company_id)]"
placeholder="Select a purchase order or an old bill"
context="{'show_total_amount': True}"
options="{'no_create': True, 'no_open': True}"/>
</t>
</field>
<label name="invoice_vendor_bill_id_label" position="attributes">
<attribute name="groups">!purchase.group_purchase_user</attribute>
</label>
<field name="invoice_vendor_bill_id" position="attributes">
<attribute name="groups">!purchase.group_purchase_user</attribute>
</field>
<!-- Add link to purchase_line_id to account.move.line -->
<xpath expr="//field[@name='invoice_line_ids']/tree/field[@name='company_id']" position="after">
<field name="purchase_line_id" groups="purchase.group_purchase_user" invisible="1"/>
<field name="purchase_order_id" groups="purchase.group_purchase_user" attrs="{'column_invisible': [('parent.move_type', '!=', 'in_invoice')]}" optional="hide"/>
</xpath>
<xpath expr="//field[@name='line_ids']/tree/field[@name='company_id']" position="after">
<field name="purchase_line_id" groups="purchase.group_purchase_user" invisible="1"/>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_stat_button"
name="action_view_source_purchase_orders"
type="object"
groups="purchase.group_purchase_user"
icon="fa-pencil-square-o"
attrs="{'invisible': ['|', ('purchase_order_count', '=', 0), ('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}">
<field string="Purchases" name="purchase_order_count" widget="statinfo"/>
</button>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="account_analytic_account_view_form_purchase" model="ir.ui.view">
<field name="name">account.analytic.account.form.purchase</field>
<field name="model">account.analytic.account</field>
<field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
<field eval="10" name="priority"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" type="object" name="action_view_purchase_orders"
icon="fa-credit-card" attrs="{'invisible': [('purchase_order_count', '=', 0)]}"
groups="purchase.group_purchase_user">
<field string="Purchase Orders" name="purchase_order_count" widget="statinfo"/>
</button>
</div>
</field>
</record>
</odoo>

View file

@ -0,0 +1,393 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="portal_my_home_menu_purchase" name="Portal layout : purchase menu entries" inherit_id="portal.portal_breadcrumbs" priority="25">
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li t-if="page_name == 'rfq' or order and order.state == 'sent'" t-attf-class="breadcrumb-item #{'active ' if not order else ''}">
<a t-if="order" t-attf-href="/my/rfq?{{ keep_query() }}">Requests for Quotation</a>
<t t-else="">Requests for Quotation</t>
</li>
<li t-if="page_name == 'purchase' or order and order.state != 'sent'" t-attf-class="breadcrumb-item #{'active ' if not order else ''}">
<a t-if="order" t-attf-href="/my/purchase?{{ keep_query() }}">Purchase Orders</a>
<t t-else="">Purchase Orders</t>
</li>
<li t-if="order" class="breadcrumb-item active">
<t t-esc="order.name"/>
</li>
</xpath>
</template>
<template id="portal_my_home_purchase" name="Show Requests for Quotation / Purchase Orders" customize_show="True" inherit_id="portal.portal_my_home" priority="25">
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-call="portal.portal_docs_entry">
<t t-set="title">Requests for Quotation</t>
<t t-set="url" t-value="'/my/rfq'"/>
<t t-set="placeholder_count" t-value="'rfq_count'"/>
</t>
<t t-call="portal.portal_docs_entry">
<t t-set="title">Purchase Orders</t>
<t t-set="url" t-value="'/my/purchase'"/>
<t t-set="placeholder_count" t-value="'purchase_count'"/>
</t>
</xpath>
</template>
<template id="portal_my_purchase_rfqs" name="My Requests For Quotation">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title" >Requests For Quotation</t>
</t>
<t t-if="not rfqs">
<p>There are currently no requests for quotation for your account.</p>
</t>
<t t-if="rfqs" t-call="portal.portal_table">
<thead>
<tr class="active">
<th>
<span class='d-none d-md-inline'>Request for Quotation #</span>
<span class='d-block d-md-none'>Ref.</span>
</th>
<th class="text-end">Order Deadline</th>
<th class="text-end">Total</th>
</tr>
</thead>
<t t-foreach="rfqs" t-as="rfq">
<tr>
<td><a t-att-href="rfq.get_portal_url()"><t t-esc="rfq.name"/></a></td>
<td class="text-end">
<span t-field="rfq.date_order" t-options="{'widget': 'date'}"/>&amp;nbsp;
<span class='d-none d-md-inline' t-field="rfq.date_order" t-options="{'time_only': True}"/>
</td>
<td class="text-end">
<span t-field="rfq.amount_total"/>
</td>
</tr>
</t>
</t>
</t>
</template>
<template id="portal_my_purchase_orders" name="My Purchase Orders">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title">Purchase Orders</t>
</t>
<t t-if="not orders">
<p>There are currently no purchase orders for your account.</p>
</t>
<t t-if="orders" t-call="portal.portal_table">
<thead>
<tr class="active">
<th>
<span class='d-none d-md-inline'>Purchase Order #</span>
<span class='d-block d-md-none'>Ref.</span>
</th>
<th class="text-end">
<span class='d-none d-md-inline'>Confirmation Date</span>
<span class='d-block d-md-none'>Confirmation</span>
</th>
<th class="text-center"/>
<th class="text-end">Total</th>
</tr>
</thead>
<t t-foreach="orders" t-as="order">
<tr>
<td><a t-att-href="order.get_portal_url()"><t t-esc="order.name"/></a></td>
<td class="text-end">
<span t-field="order.date_approve" t-options="{'widget': 'date'}"/>&amp;nbsp;
<span class='d-none d-md-inline' t-field="order.date_approve" t-options="{'time_only': True}"/>
</td>
<td class="text-center">
<span t-if="order.invoice_status == 'to invoice'" class="badge rounded-pill text-bg-info">
<i class="fa fa-fw fa-file-text" role="img" aria-label="Waiting for Bill" title="Waiting for Bill"></i><span class="d-none d-md-inline"> Waiting for Bill</span>
</span>
<span t-if="order.state == 'cancel'" class="badge rounded-pill text-bg-secondary">
<i class="fa fa-fw fa-remove" role="img" aria-label="Cancelled" title="Cancelled"></i><span class="d-none d-md-inline"> Cancelled</span>
</span>
<span t-if="order.state == 'done'" class="badge rounded-pill text-bg-success">
<i class="fa fa-fw fa-check" role="img" aria-label="Done" title="Done"></i><span class="d-none d-md-inline"> Done</span>
</span>
</td>
<td class="text-end"><span t-field="order.amount_total"/></td>
</tr>
</t>
</t>
</t>
</template>
<template id="portal_my_purchase_order" name="Purchase Order Portal Template" inherit_id="portal.portal_sidebar" primary="True">
<xpath expr="//div[hasclass('o_portal_sidebar')]" position="inside">
<t t-set="o_portal_fullwidth_alert" groups="purchase.group_purchase_manager">
<t t-call="portal.portal_back_in_edit_mode">
<t t-set="backend_url" t-value="'/web#model=%s&amp;id=%s&amp;action=%s&amp;view_type=form' % (order._name, order.id, order.env.ref('purchase.purchase_rfq').id)"/>
</t>
</t>
<div class="row mt16 o_portal_purchase_sidebar">
<!-- Sidebar -->
<t t-call="portal.portal_record_sidebar">
<t t-set="classes" t-value="'col-lg-auto d-print-none'"/>
<t t-set="title">
<h2 class="mb-0"><b t-field="order.amount_total" data-id="total_amount"/> </h2>
</t>
<t t-set="entries">
<ul class="list-group list-group-flush flex-wrap flex-row flex-lg-column">
<li class="list-group-item flex-grow-1">
<div class="o_download_pdf btn-toolbar flex-sm-nowrap">
<div class="btn-group flex-grow-1 me-1 mb-1">
<a class="btn btn-secondary btn-block o_download_btn" t-att-href="order.get_portal_url(report_type='pdf', download=True)" title="Download"><i class="fa fa-download"/> Download</a>
</div>
<div class="btn-group flex-grow-1 mb-1">
<a class="btn btn-secondary btn-block o_print_btn o_portal_invoice_print" t-att-href="order.get_portal_url(report_type='pdf')" id="print_invoice_report" title="Print" target="_blank"><i class="fa fa-print"/> Print</a>
</div>
</div>
</li>
<li class="navspy list-group-item ps-0 flex-grow-1" t-ignore="true" role="complementary">
<ul class="nav flex-column bs-sidenav"></ul>
</li>
<li t-if="order.user_id" class="list-group-item flex-grow-1">
<div class="small mb-1"><strong class="text-muted">Purchase Representative</strong></div>
<div class="row flex-nowrap">
<div class="col flex-grow-0 pe-2">
<img class="rounded-circle mr4 float-start o_portal_contact_img" t-att-src="image_data_uri(order.user_id.avatar_128)" alt="Contact"/>
</div>
<div class="col ps-0" style="min-width: 150px">
<span t-field="order.user_id" t-options='{"widget": "contact", "fields": ["name", "phone"], "no_marker": True}'/>
<a href="#discussion" class="small"><i class="fa fa-comment"></i> Send message</a>
</div>
</div>
</li>
</ul>
</t>
</t>
<!-- Page content -->
<div id="quote_content" class="col-12 col-lg justify-content-end">
<!-- status messages -->
<div t-if="order.state == 'cancel'" class="alert alert-danger alert-dismissable d-print-none" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="close"></button>
<strong>This purchase has been canceled.</strong>
</div>
<!-- main content -->
<div t-attf-class="card #{'pb-5' if report_type == 'html' else ''}" id="portal_purchase_content">
<div t-call="purchase.purchase_order_portal_content"/>
</div>
<!-- chatter -->
<div id="purchase_order_communication" class="mt-4">
<h2>History</h2>
<t t-call="portal.message_thread"/>
</div>
</div><!-- // #quote_content -->
</div>
</xpath>
</template>
<template id="purchase_order_portal_content" name="Purchase Order Portal Content">
<!-- Intro -->
<div id="introduction" t-attf-class="pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}">
<h2 class="my-0">
<t t-if="order.state in ['draft', 'sent']">Request for Quotation</t>
<t t-else="1">
Purchase Order
</t>
<em t-esc="order.name"/>
</h2>
</div>
<div t-attf-class="#{'card-body' if report_type == 'html' else ''}">
<!-- Informations -->
<div id="informations">
<div class="row" id="po_date">
<div class="mb-3 col-6">
<t t-if="order.state in ['draft', 'sent']">
<strong>Request For Quotation Date:</strong>
</t>
<t t-if="order.state in ['purchase', 'done', 'cancel']">
<strong>Order Date:</strong>
</t>
<span t-field="order.date_order" t-options='{"widget": "date"}'/>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<strong class="d-block mb-1">From:</strong>
<address t-field="order.company_id.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
<strong>Confirmation Date:</strong> <span t-field="order.date_approve" t-options='{"widget": "date"}'/><br/>
<div t-att-class="'d-inline' if order.date_planned else 'd-none'">
<strong>Receipt Date:</strong><span class="ms-1" t-field="order.date_planned" t-options='{"widget": "date"}'/>
</div>
</div>
</div>
<t t-set="invoices" t-value="[i for i in order.invoice_ids if i.state not in ['draft', 'cancel']]"/>
<div t-if="invoices" class="row">
<div class="col">
<strong class="d-block mb-1">Invoices</strong>
<ul class="list-group mb-4">
<t t-foreach="invoices" t-as="i">
<t t-set="report_url" t-value="i.get_portal_url(report_type='pdf', download=True)"/>
<div class="d-flex flex-wrap align-items-center justify-content-between">
<div>
<a t-att-href="report_url">
<span t-esc="i.name"/>
</a>
<div class="small d-lg-inline-block">Date: <span class="text-muted" t-field="i.invoice_date"/></div>
</div>
<span t-if="i.payment_state in ('paid', 'in_payment')" class="small badge text-bg-success"><i class="fa fa-fw fa-check"/> <b>Paid</b></span>
<span t-elif="i.payment_state == 'reversed'" class="small badge text-bg-success"><i class="fa fa-fw fa-check"/> <b>Reversed</b></span>
<span t-else="" class="small badge text-bg-info"><i class="fa fa-fw fa-clock-o"/> <b>Waiting Payment</b></span>
</div>
</t>
</ul>
</div>
</div>
</div>
<section id="details" style="page-break-inside: auto;" class="mt32">
<h3 id="details">Pricing</h3>
<div class="table-responsive">
<table t-att-data-order-id="order.id" t-att-data-token="order.access_token" class="table table-sm" id="purchase_order_table">
<thead class="bg-100">
<tr>
<th class="text-start">Products</th>
<th class="text-end">Quantity</th>
<th t-if="update_dates" class="text-end">Scheduled Date</th>
<th t-if="update_dates" class="text-end"><strong>Update Here</strong></th>
<th t-if="not update_dates and order.state in ['purchase', 'done']" t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">Unit Price</th>
<th t-if="not update_dates and order.state in ['purchase', 'done']" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span>Taxes</span>
</th>
<th class="text-end" t-if="order.state in ['purchase', 'done']" >
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span>
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span>
</th>
</tr>
</thead>
<tbody class="purchase_tbody">
<t t-set="current_subtotal" t-value="0"/>
<t t-foreach="order.order_line" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
<tr t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic text-break' if line.display_type == 'line_note' else ''">
<t t-if="not line.display_type">
<td id="product_name">
<img t-att-src="image_data_uri(resize_to_48(line.product_id.image_1024))" alt="Product" class="d-none d-lg-inline"/>
<span t-field="line.name"/>
</td>
<td class="text-end">
<div id="quote_qty">
<span t-field="line.product_qty"/>
<span t-field="line.product_uom" groups="uom.group_uom"/>
</div>
</td>
<td t-if="update_dates" class="text-end"><span t-esc="line.date_planned.date()"/></td>
<td t-if="update_dates" class="text-end">
<form t-attf-action="/my/purchase/#{order.id}/update?access_token=#{order.access_token}" method="post">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<div class="container">
<div class="mb-3">
<div class="input-group date">
<input type="text" class="form-control datetimepicker-input o-purchase-datetimepicker" t-attf-id="datetimepicker_#{line.id}" t-att-name="line.id"
data-toggle="datetimepicker" data-date-format="YYYY-MM-DD" t-attf-data-target="#datetimepicker_#{line.id}"/>
</div>
</div>
</div>
</form>
</td>
<td t-if="not update_dates and order.state in ['purchase', 'done']" t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<div
t-field="line.price_unit"
class="text-end"
/>
</td>
<td t-if="not update_dates and order.state in ['purchase', 'done']" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.taxes_id))"/>
</td>
<td class="text-end" t-if="not update_dates and order.state in ['purchase', 'done']">
<span class="oe_order_line_price_subtotal" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<span class="oe_order_line_price_total" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
</td>
</t>
<t t-if="line.display_type == 'line_section'">
<td colspan="99">
<span t-field="line.name"/>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
</t>
<t t-if="line.display_type == 'line_note'">
<td colspan="99">
<span t-field="line.name"/>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or order.order_line[line_index+1].display_type == 'line_section') and order.state in ['purchase', 'done']">
<tr class="is-subtotal text-end">
<td colspan="99">
<strong class="mr16">Subtotal</strong>
<span
t-esc="current_subtotal"
t-options='{"widget": "monetary", "display_currency": order.currency_id}'
/>
</td>
</tr>
</t>
</t>
</tbody>
</table>
</div>
<div id="total" t-if="order.state in ['purchase', 'done']" class="row" name="total" style="page-break-inside: avoid;">
<div t-attf-class="#{'col-4' if report_type != 'html' else 'col-sm-7 col-md-5'} ms-auto">
<t t-call="purchase.purchase_order_portal_content_totals_table"/>
</div>
</div>
</section>
<section id="terms" class="mt-5" t-if="order.notes">
<h3 class="">Terms &amp; Conditions</h3>
<hr class="mt-0 mb-1"/>
<em t-field="order.notes"/>
</section>
<section class="mt-5" t-if="order.payment_term_id">
<h3 class="">Payment terms</h3>
<hr class="mt-0 mb-1"/>
<span t-field="order.payment_term_id"/>
</section>
</div>
</template>
<template id="purchase_order_portal_content_totals_table">
<table class="table table-sm">
<t t-set="tax_totals" t-value="order.tax_totals"/>
<t t-call="account.document_tax_totals"/>
</table>
</template>
<template id="portal_my_purchase_order_update_date" name="Portal: My Purchase Order Update Dates" inherit_id="purchase.portal_my_purchase_order" primary="True">
<xpath expr="////div[@id='portal_purchase_content']" position="replace">
<div t-attf-class="card #{'pb-5' if report_type == 'html' else ''}" id="portal_purchase_content">
<t t-set="update_dates" t-value="True"/>
<div t-call="purchase.purchase_order_portal_content"/>
</div>
</xpath>
</template>
</odoo>

View file

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_packaging_form_view_purchase" model="ir.ui.view">
<field name="name">product.packaging.form.view.purchase</field>
<field name="model">product.packaging</field>
<field name="inherit_id" ref="product.product_packaging_form_view"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='group_product']" position="inside">
<field name="purchase"/>
</xpath>
</field>
</record>
<record id="product_packaging_tree_view_purchase" model="ir.ui.view">
<field name="name">product.packaging.tree.view.purchase</field>
<field name="model">product.packaging</field>
<field name="inherit_id" ref="product.product_packaging_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='product_uom_id']" position="after">
<field name="purchase" optional="show"/>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Product Suppliers-->
<record id="product_supplierinfo_tree_view2" model="ir.ui.view">
<field name="name">product.supplierinfo.tree.view2</field>
<field name="model">product.supplierinfo</field>
<field name="inherit_id" ref="product.product_supplierinfo_tree_view"/>
<field name="mode">primary</field>
<field name="priority" eval="1000"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="editable">bottom</attribute>
</xpath>
<xpath expr="//tree" position="inside">
<field name="company_id" invisible="1"/>
</xpath>
<xpath expr="//field[@name='company_id']" position="attributes">
<attribute name="readonly">0</attribute>
<attribute name="optional">hide</attribute>
</xpath>
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="readonly">0</attribute>
</xpath>
<xpath expr="//field[@name='product_id']" position="attributes">
<attribute name="readonly">0</attribute>
<attribute name="options">{'no_create': True, 'no_open': True}</attribute>
</xpath>
<xpath expr="//field[@name='delay']" position="attributes">
<attribute name="optional">show</attribute>
</xpath>
</field>
</record>
<record id="view_product_supplier_inherit" model="ir.ui.view">
<field name="name">product.template.supplier.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='purchase']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<group name="purchase" position="before">
<field name="seller_ids" context="{'default_product_tmpl_id':context.get('product_tmpl_id',active_id), 'product_template_invisible_variant': True, 'tree_view_ref':'purchase.product_supplierinfo_tree_view2'}" nolabel="1" attrs="{'invisible': [('product_variant_count','&gt;',1)], 'readonly': [('product_variant_count','&gt;',1)]}"/>
<field name="variant_seller_ids" context="{'model': active_model, 'active_id': active_id, 'tree_view_ref':'purchase.product_supplierinfo_tree_view2'}" nolabel="1" attrs="{'invisible': [('product_variant_count','&lt;=',1)], 'readonly': [('product_variant_count','&lt;=',1)]}"/>
</group>
<group name="bill" position="attributes">
<attribute name="groups">purchase.group_purchase_manager</attribute>
</group>
<group name="bill" position="inside">
<field name="purchase_method" widget="radio"/>
</group>
<group name="purchase" position="inside">
<group col="1">
<group string="Purchase Description">
<field name="description_purchase" nolabel="1" colspan="2"
placeholder="This note is added to purchase orders."/>
</group>
<group string="Warning when Purchasing this Product" groups="purchase.group_warning_purchase">
<field name="purchase_line_warn" nolabel="1" colspan="2"/>
<field name="purchase_line_warn_msg" colspan="2" nolabel="1" placeholder="Type a message..."
attrs="{'required':[('purchase_line_warn','!=','no-message')],'readonly':[('purchase_line_warn','=','no-message')], 'invisible':[('purchase_line_warn','=','no-message')]}"/>
</group>
</group>
</group>
</field>
</record>
<record id="view_product_account_purchase_ok_form" model="ir.ui.view">
<field name="name">product.template.account.purchase.ok.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="account.product_template_form_view"/>
<field name="arch" type="xml">
<field name="property_account_expense_id" position="attributes">
<attribute name="attrs">{'readonly': [('purchase_ok', '=', 0)]}</attribute>
</field>
<field name='supplier_taxes_id' position="replace" >
<field name="supplier_taxes_id" colspan="2" widget="many2many_tags" attrs="{'readonly':[('purchase_ok','=',0)]}" context="{'default_type_tax_use':'purchase'}"/>
</field>
</field>
</record>
<record id="view_product_template_purchase_buttons_from" model="ir.ui.view">
<field name="name">product.template.purchase.button.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="action_view_po"
groups="purchase.group_purchase_user"
type="object" icon="fa-credit-card" attrs="{'invisible': [('purchase_ok', '=', False)]}" help="Purchased in the last 365 days">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="purchased_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
<field name="uom_name"/>
</span>
<span class="o_stat_text">Purchased</span>
</div>
</button>
</div>
</field>
</record>
<record id="product_normal_form_view_inherit_purchase" model="ir.ui.view">
<field name="name">product.product.purchase.order</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="action_view_po"
groups="purchase.group_purchase_user"
type="object" icon="fa-credit-card" attrs="{'invisible': [('purchase_ok', '=', False)]}" help="Purchased in the last 365 days">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="purchased_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
<field name="uom_name"/>
</span>
<span class="o_stat_text">Purchased</span>
</div>
</button>
</div>
</field>
</record>
</odoo>

View file

@ -0,0 +1,845 @@
<?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.svg"
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="groups_id" eval="False"/>
</record>
<menuitem id="menu_product_attribute_action"
action="product.attribute_action" name="Product 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
id="menu_unit_of_measure_in_config_purchase" name="Units of Measures"
parent="menu_purchase_config" sequence="40" groups="uom.group_uom" />
<menuitem
action="uom.product_uom_form_action" id="menu_purchase_uom_form_action" active="False"
parent="purchase.menu_unit_of_measure_in_config_purchase" sequence="5" groups="base.group_no_one"/>
<menuitem
action="uom.product_uom_categ_form_action" id="menu_purchase_uom_categ_form_action"
parent="purchase.menu_unit_of_measure_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="type">ir.actions.act_window</field>
<field name="res_model">product.template</field>
<field name="view_mode">kanban,tree,form,activity</field>
<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="view_id" eval="False"/> <!-- Force empty -->
<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">tree,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>
<button name="action_rfq_send" states="draft" string="Send by Email" type="object" context="{'send_rfq':True}" class="oe_highlight" data-hotkey="g"/>
<button name="print_quotation" string="Print RFQ" type="object" states="draft" class="oe_highlight" groups="base.group_user" data-hotkey="k"/>
<button name="button_confirm" type="object" states="sent" string="Confirm Order" context="{'validate_analytic': True}" class="oe_highlight" id="bid_confirm" data-hotkey="v"/>
<button name="button_approve" type="object" states='to approve' string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager" data-hotkey="z"/>
<button name="action_create_invoice" string="Create Bill" type="object" class="oe_highlight" context="{'create_bill':True}" attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'in', ('no', 'invoiced'))]}" data-hotkey="w"/>
<button name="action_rfq_send" states="sent" string="Re-Send by Email" type="object" context="{'send_rfq':True}" data-hotkey="g"/>
<button name="print_quotation" string="Print RFQ" type="object" states="sent" groups="base.group_user" data-hotkey="k"/>
<button name="button_confirm" type="object" states="draft" context="{'validate_analytic': True}" string="Confirm Order" id="draft_confirm"/>
<button name="action_rfq_send" states="purchase" string="Send PO by Email" type="object" context="{'send_rfq':False}" data-hotkey="g"/>
<button name="confirm_reminder_mail" string="Confirm Receipt Date" type="object" attrs="{'invisible': ['|','|', ('state', 'not in', ('purchase', 'done')), ('mail_reminder_confirmed', '=', True), ('date_planned', '=', False)]}" groups="base.group_no_one" data-hotkey="o"/>
<button name="action_create_invoice" string="Create Bill" type="object" context="{'create_bill':True}" attrs="{'invisible': ['|', '|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'not in', ('no', 'invoiced')), ('order_line', '=', [])]}" data-hotkey="w"/>
<button name="button_draft" states="cancel" string="Set to Draft" type="object" data-hotkey="o"/>
<button name="button_cancel" states="draft,to approve,sent,purchase" string="Cancel" type="object" data-hotkey="x" />
<button name="button_done" type="object" string="Lock" states="purchase" data-hotkey="l"/>
<button name="button_unlock" type="object" string="Unlock" states="done" groups="purchase.group_purchase_manager" data-hotkey="l"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,purchase" readonly="1"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button type="object" name="action_view_invoice"
class="oe_stat_button"
icon="fa-pencil-square-o" attrs="{'invisible':['|', ('invoice_count', '=', 0), ('state', 'in', ('draft','sent','to approve'))]}">
<field name="invoice_count" widget="statinfo" string="Vendor Bills"/>
<field name='invoice_ids' invisible="1"/>
</button>
</div>
<div class="oe_title">
<span class="o_form_label" attrs="{'invisible': [('state','not in',('draft','sent'))]}">Request for Quotation </span>
<span class="o_form_label" attrs="{'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"
/>
<field name="partner_ref"/>
<field name="currency_id" groups="base.group_multi_currency" force_save="1"/>
<field name="id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="currency_id" invisible="1" groups="!base.group_multi_currency"/>
</group>
<group>
<field name="date_order" attrs="{'invisible': [('state','in',('purchase','done'))]}"/>
<label for="date_approve" attrs="{'invisible': [('state','not in',('purchase','done'))]}"/>
<div name="date_approve" attrs="{'invisible': [('state','not in',('purchase','done'))]}" class="o_row">
<field name="date_approve"/>
<field name="mail_reception_confirmed" invisible="1"/>
<span class="text-muted" attrs="{'invisible': [('mail_reception_confirmed','=', False)]}">(confirmed by vendor)</span>
</div>
<label for="date_planned"/>
<div name="date_planned_div" class="o_row">
<field name="date_planned" attrs="{'readonly': [('state', 'not in', ('draft', 'sent', 'to approve', 'purchase'))]}"/>
<field name="mail_reminder_confirmed" invisible="1"/>
<span class="text-muted" attrs="{'invisible': [('mail_reminder_confirmed', '=', False)]}">(confirmed by vendor)</span>
</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" attrs="{'invisible': [('receipt_reminder_email', '=', False)]}">
<field name="reminder_date_before_receipt"/>
day(s) before
<widget name='toaster_button' button_name="send_reminder_preview" title="Preview the reminder email by sending it to yourself." attrs="{'invisible': [('id', '=', False)]}"/>
</div>
</div>
</group>
</group>
<notebook>
<page string="Products" name="products">
<field name="tax_country_id" invisible="1"/>
<field name="order_line"
widget="section_and_note_one2many"
mode="tree,kanban"
context="{'default_state': 'draft'}"
attrs="{'readonly': [('state', 'in', ('done', 'cancel'))]}">
<tree string="Purchase Order Lines" editable="bottom">
<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'}"/>
</control>
<field name="display_type" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="state" invisible="1"/>
<field name="product_type" invisible="1"/>
<field name="product_uom" invisible="1" groups="!uom.group_uom"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="invoice_lines" invisible="1"/>
<field name="sequence" widget="handle"/>
<field
name="product_id"
attrs="{
'readonly': [('state', 'in', ('purchase', 'to approve','done', 'cancel'))],
'required': [('display_type', '=', False)],
}"
context="{'partner_id':parent.partner_id, 'quantity':product_qty, 'company_id': parent.company_id}"
force_save="1" domain="[('purchase_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/>
<field name="name" widget="section_and_note_text"/>
<field name="date_planned" optional="hide" attrs="{'required': [('display_type', '=', False)]}" force_save="1"/>
<field name="analytic_distribution" widget="analytic_distribution"
optional="hide"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'purchase_order'}"/>
<field name="product_qty"/>
<field name="qty_received_manual" invisible="1"/>
<field name="qty_received_method" invisible="1"/>
<field name="qty_received" string="Received" attrs="{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))], 'readonly': [('qty_received_method', '!=', 'manual')]}" optional="show"/>
<field name="qty_invoiced" string="Billed" attrs="{'column_invisible': [('parent.state', 'not in', ('purchase', 'done'))]}" optional="show"/>
<field name="product_uom" string="UoM" groups="uom.group_uom"
attrs="{
'readonly': [('state', 'in', ('purchase', 'done', 'cancel'))],
'required': [('display_type', '=', False)]
}"
force_save="1" optional="show"/>
<field name="product_packaging_qty" attrs="{'invisible': ['|', ('product_id', '=', False), ('product_packaging_id', '=', False)]}" groups="product.group_stock_packaging" optional="show"/>
<field name="product_packaging_id" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" groups="product.group_stock_packaging" optional="show"/>
<field name="price_unit" attrs="{'readonly': [('qty_invoiced', '!=', 0)]}"/>
<button name="action_purchase_history" type="object" icon="fa-history" title="Purchase History" attrs="{'invisible': [('id', '=', False)]}"/>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use','=','purchase'), ('company_id', '=', parent.company_id), ('country_id', '=', parent.tax_country_id)]" context="{'default_type_tax_use': 'purchase', 'search_view_ref': 'account.account_tax_view_search'}" options="{'no_create': True}" optional="show"/>
<field name="price_subtotal" widget="monetary"/>
<field name="price_total" invisible="1"/>
<field name="price_tax" invisible="1"/>
</tree>
<form string="Purchase Order Line">
<field name="state" invisible="1"/>
<field name="display_type" invisible="1"/>
<group attrs="{'invisible': [('display_type', '!=', False)]}">
<group>
<field name="product_uom_category_id" invisible="1"/>
<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)]"
/>
<label for="product_qty"/>
<div class="o_row">
<field name="product_qty"/>
<field name="product_uom" groups="uom.group_uom" attrs="{'required': [('display_type', '=', False)]}"/>
</div>
<field name="qty_received_method" invisible="1"/>
<field name="qty_received" string="Received Quantity" attrs="{'invisible': [('parent.state', 'not in', ('purchase', 'done'))], 'readonly': [('qty_received_method', '!=', 'manual')]}"/>
<field name="qty_invoiced" string="Billed Quantity" attrs="{'invisible': [('parent.state', 'not in', ('purchase', 'done'))]}"/>
<field name="product_packaging_qty" attrs="{'invisible': ['|', ('product_id', '=', False), ('product_packaging_id', '=', False)]}" groups="product.group_stock_packaging"/>
<field name="product_packaging_id" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" groups="product.group_stock_packaging" />
<field name="price_unit"/>
<field name="taxes_id" widget="many2many_tags" domain="[('type_tax_use', '=', 'purchase'), ('company_id', '=', parent.company_id), ('country_id', '=', parent.tax_country_id)]" options="{'no_create': True}"/>
</group>
<group>
<field name="date_planned" widget="date" attrs="{'required': [('display_type', '=', False)]}"/>
<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)" attrs="{'invisible': [('display_type', '!=', 'line_section')]}"/>
<label for="name" string="Note" attrs="{'invisible': [('display_type', '!=', 'line_note')]}"/>
<field name="name" nolabel="1" attrs="{'invisible': [('display_type', '=', False)]}"/>
</form>
<kanban class="o_kanban_mobile">
<field name="name"/>
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom" groups="uom.group_uom"/>
<field name="price_subtotal"/>
<field name="price_tax" invisible="1"/>
<field name="price_total" invisible="1"/>
<field name="price_unit"/>
<field name="display_type"/>
<field name="taxes_id" invisible="1"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click {{ record.display_type.raw_value ? 'o_is_' + record.display_type.raw_value : '' }}">
<t t-if="!record.display_type.raw_value">
<div class="row">
<div class="col-8">
<strong>
<span t-esc="record.product_id.value"/>
</strong>
</div>
<div class="col-4">
<strong>
<span t-esc="record.price_subtotal.value" class="float-end text-end"/>
</strong>
</div>
</div>
<div class="row">
<div class="col-12 text-muted">
<span>
Quantity:
<t t-esc="record.product_qty.value"/>
<t t-esc="record.product_uom.value" groups="uom.group_uom"/>
</span>
</div>
</div>
<div class="row">
<div class="col-12 text-muted">
<span>
Unit Price:
<field name="price_unit"/>
</span>
</div>
</div>
</t>
<div
t-elif="record.display_type.raw_value === 'line_section' || record.display_type.raw_value === 'line_note'"
class="row">
<div class="col-12">
<span t-esc="record.name.value"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
<group>
<group>
<field colspan="2" name="notes" nolabel="1" placeholder="Define your terms and conditions ..."/>
</group>
<group class="oe_subtotal_footer oe_right">
<field name="tax_totals" widget="account-tax-totals-field" nolabel="1" colspan="2" 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}"/>
<field name="origin"/>
</group>
<group name="invoice_info">
<field name="invoice_status" attrs="{'invisible': [('state', 'in', ('draft', 'sent', 'to approve', 'cancel'))]}"/>
<field name="payment_term_id" attrs="{'readonly': ['|', ('invoice_status','=', 'invoiced'), ('state', '=', 'done')]}" options="{'no_create': True}"/>
<field name="fiscal_position_id" options="{'no_create': True}" attrs="{'readonly': ['|', ('invoice_status','=', 'invoiced'), ('state', '=', 'done')]}"/>
</group>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</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="draft" string="RFQs" domain="[('state', 'in', ('draft', 'sent', 'to approve'))]"/>
<separator/>
<filter name="approved" string="Purchase Orders" domain="[('state', 'in', ('purchase', 'done'))]"/>
<filter name="to_approve" string="To Approve" domain="[('state', '=', 'to approve')]"/>
<separator/>
<filter name="order_date" string="Order Date" date="date_order"/>
<filter name="draft_rfqs" string="Draft RFQs" domain="[('state', '=', 'draft')]"/>
<filter name="waiting_rfqs" string="Waiting RFQs" domain="[('state', '=', 'sent'), ('date_order', '&gt;=', datetime.datetime.now())]"/>
<filter name="late_rfqs" string="Late RFQs" domain="[('state', 'in', ['draft', 'sent', 'to approve']),('date_order', '&lt;', datetime.datetime.now())]"/>
<separator/>
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
<separator/>
<filter string="Warnings" name="activities_exception"
domain="[('activity_exception_decoration', '!=', False)]"/>
<group expand="0" string="Group By">
<filter string="Vendor" name="vendor" domain="[]" context="{'group_by': 'partner_id'}"/>
<filter string="Purchase Representative" 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"/>
<filter name="my_Orders" string="My Orders" domain="[('user_id', '=', uid)]"/>
<filter string="Starred" name="starred" domain="[('priority', '=', '1')]"/>
<separator/>
<filter name="unconfirmed" string="Not Acknowledged" domain="[('mail_reception_confirmed', '=', False), ('state', '=', 'purchase')]"/>
<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="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
<separator/>
<filter string="Warnings" name="activities_exception"
domain="[('activity_exception_decoration', '!=', False)]"/>
<group expand="0" string="Group By">
<filter string="Vendor" name="vendor" domain="[]" context="{'group_by': 'partner_id'}"/>
<filter string="Purchase Representative" 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="name"/>
<field name="partner_id" readonly="1"/>
<field name="amount_total"/>
<field name="state"/>
<field name="date_order"/>
<field name="currency_id" readonly="1"/>
<field name="activity_state"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_record_top mb16">
<field name="priority" widget="priority"/>
<div class="o_kanban_record_headings ms-1">
<strong class="o_kanban_record_title"><span><t t-esc="record.partner_id.value"/></span></strong>
</div>
<strong><field name="amount_total" widget="monetary"/></strong>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<span><t t-esc="record.name.value"/> <t t-esc="record.date_order.value and record.date_order.value.split(' ')[0] or False"/></span>
<field name="activity_ids" widget="kanban_activity"/>
</div>
<div class="oe_kanban_bottom_right">
<field name="state" widget="label_selection" options="{'classes': {'draft': 'default', 'cancel': 'default', 'done': 'success', 'approved': 'warning'}}"/>
</div>
</div>
</div>
</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.tree</field>
<field name="model">purchase.order</field>
<field name="priority" eval="1"/>
<field name="arch" type="xml">
<tree 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" invisible="not context.get('quotation_only', False)" optional="show"/>
<field name="date_approve" 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="user_id" 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"/>
<field name="currency_id" invisible="1"/>
<field name="state" optional="show"/>
<field name="date_planned" invisible="context.get('quotation_only', False)" optional="show"/>
<field name="invoice_status" invisible="context.get('quotation_only', False)" optional="hide"/>
<field name="activity_exception_decoration" widget="activity_exception"/>
</tree>
</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.tree</field>
<field name="model">purchase.order</field>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<tree string="Purchase Order" decoration-info="state in ['draft', 'sent']"
decoration-muted="state == 'cancel'"
class="o_purchase_order" js_class="purchase_dashboard_list" sample="1">
<header>
<button name="action_create_invoice" type="object" string="Create Bills"/>
</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" 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" invisible="1"/>
<field name="date_planned" invisible="context.get('quotation_only', False)" optional="show"/>
<field name="user_id" optional="show" widget="many2one_avatar_user"/>
<field name="date_order" attrs="{'invisible': ['|', '|', ('state', '=', 'purchase'), ('state', '=', 'done'), ('state', '=', 'cancel')]}"
invisible="not context.get('quotation_only', False)" widget="remaining_days" 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="state in ['purchase', 'done']"/>
<field name="currency_id" invisible="1"/>
<field name="state" optional="show" widget="badge" decoration-success="state == 'purchase' or state == 'done'"
decoration-warning="state == 'to approve'" decoration-info="state == 'draft' or state == 'sent'"/>
<field name="invoice_status" optional="hide"/>
</tree>
</field>
</record>
<record id="purchase_order_view_tree" model="ir.ui.view">
<field name="name">purchase.order.view.tree</field>
<field name="model">purchase.order</field>
<field name="arch" type="xml">
<tree decoration-muted="state == 'cancel'"
decoration-info="invoice_status == 'to invoice'"
string="Purchase Order"
class="o_purchase_order"
sample="1">
<header>
<button name="action_create_invoice" type="object" string="Create Bills"/>
</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" widget="date" invisible="context.get('quotation_only', False)" optional="show"/>
<field name="partner_id"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" optional="show"/>
<field name="company_id" groups="!base.group_multi_company" invisible="1"/>
<field name="user_id" widget="many2one_avatar_user" optional="show"/>
<field name="date_order" invisible="not context.get('quotation_only', False)" 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" invisible="1"/>
<field name="state" invisible="1"/>
<field name="invoice_status" widget="badge" decoration-success="invoice_status == 'invoiced'" decoration-info="invoice_status == 'to invoice'" optional="show"/>
<field name="date_planned" invisible="context.get('quotation_only', False)" optional="show"/>
</tree>
</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">
<templates>
<div t-name="activity-box">
<div>
<field name="name" display="full"/>
<field name="partner_id" muted="1" display="full"/>
</div>
</div>
</templates>
</activity>
</field>
</record>
<record id="purchase_rfq" model="ir.actions.act_window">
<field name="name">Requests for Quotation</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,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="type">ir.actions.act_window</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,kanban,form,pivot,graph,calendar,activity</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', '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','in',('purchase', 'done'))]</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.tree</field>
<field name="model">purchase.order.line</field>
<field name="arch" type="xml">
<tree 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" groups="uom.group_uom"/>
<field name="price_subtotal" widget="monetary"/>
<field name="currency_id" invisible="1"/>
<field name="date_planned" widget="date"/>
</tree>
</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" attrs="{'invisible':[('date_order','=',False)]}"/>
<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" readonly="1" groups="uom.group_uom"/>
</div>
<field name="price_unit"/>
</group>
<group>
<field name="taxes_id" widget="many2many_tags"
domain="[('type_tax_use', '=', 'purchase')]"/>
<field name="date_planned" widget="date" 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')]"/>
<group expand="0" string="Group By">
<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'}"/>
<filter string="Status" name="status" domain="[]" context="{'group_by' : 'state'}" />
</group>
</search>
</field>
</record>
<record id="purchase_history_tree" model="ir.ui.view">
<field name="name">purchase.history.tree</field>
<field name="model">purchase.order.line</field>
<field name="arch" type="xml">
<tree create="false" default_order="order_id asc">
<field name="order_id" widget="many2one"/>
<field name="date_approve" widget="date"/>
<field name="partner_id"/>
<field name="product_uom_qty"/>
<field name="price_unit"/>
</tree>
</field>
</record>
<record id="action_purchase_history" model="ir.actions.act_window">
<field name="res_model">purchase.order.line</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="purchase.purchase_history_tree"/>
<field name="context">{}</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_batch_bills" model="ir.actions.server">
<field name="name">Create Vendor Bills</field>
<field name="model_id" ref="purchase.model_purchase_order"/>
<field name="binding_model_id" ref="purchase.model_purchase_order"/>
<field name='groups_id' eval="[(4, ref('account.group_account_invoice'))]"/>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_create_invoice()
</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='groups_id' 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="type">ir.actions.act_window</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="groups_id" eval="[(4, ref('account.group_account_user'))]"/>
<field name="target">new</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>
</odoo>

View file

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form_purchase" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.purchase</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="25"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block" data-string="Purchase" string="Purchase" data-key="purchase" groups="purchase.group_purchase_manager">
<field name="po_double_validation" invisible="1"/>
<field name="company_currency_id" invisible="1"/>
<field name="po_lock" invisible="1"/>
<h2>Orders</h2>
<div class="row mt16 o_settings_container" name="purchase_setting_container">
<div class="col-12 col-lg-6 o_setting_box" id="po_order_approval">
<div class="o_setting_left_pane">
<field name="po_order_approval"/>
</div>
<div class="o_setting_right_pane">
<label for="po_order_approval"/>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
<div class="text-muted">
Request managers to approve orders above a minimum amount
</div>
<div class="content-group" attrs="{'invisible': [('po_order_approval', '=', False)]}">
<div class="row mt16">
<label for="po_double_validation_amount" class="col-lg-4 o_light_label"/>
<field name="po_double_validation_amount"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="automatic_lock_confirmed_orders">
<div class="o_setting_left_pane">
<field name="lock_confirmed_po"/>
</div>
<div class="o_setting_right_pane">
<label for="lock_confirmed_po"/>
<div class="text-muted">
Automatically lock confirmed orders to prevent editing
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="get_order_warnings">
<div class="o_setting_left_pane">
<field name="group_warning_purchase"/>
</div>
<div class="o_setting_right_pane">
<label for="group_warning_purchase" string="Warnings"/>
<div class="text-muted">
Get warnings in orders for products or vendors
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box"
id="manage_purchase_agreements"
title="Calls for tenders are when you want to generate requests for quotations with several vendors for a given set of products to compare offers.">
<div class="o_setting_left_pane">
<field name="module_purchase_requisition"/>
</div>
<div class="o_setting_right_pane">
<label for="module_purchase_requisition"/>
<a href="https://www.odoo.com/documentation/16.0/applications/inventory_and_mrp/purchase/manage_deals/agreements.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Manage your purchase agreements (call for tenders, blanket orders)
</div>
<div class="content-group" attrs="{'invisible': [('module_purchase_requisition', '=', False)]}">
<div id="use_purchase_requisition"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="auto_receipt_reminder">
<div class="o_setting_left_pane">
<field name="group_send_reminder"/>
</div>
<div class="o_setting_right_pane">
<label for="group_send_reminder"/>
<div class="text-muted">
Automatically remind the receipt date to your vendors
</div>
</div>
</div>
</div>
<h2>Invoicing</h2>
<div class="row mt16 o_settings_container" name="invoicing_settings_container">
<div class="col-12 col-lg-6 o_setting_box" id="quantities_billed_vendor" title="This default value is applied to any new product created. This can be changed in the product detail form.">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<label for="default_purchase_method"/>
<a href="https://www.odoo.com/documentation/16.0/applications/inventory_and_mrp/purchase/manage_deals/control_bills.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Quantities billed by vendors
</div>
<div class="content-group">
<div class="mt16">
<field name="default_purchase_method" class="o_light_label" widget="radio"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box"
id="three_way_matching"
title="If enabled, activates 3-way matching on vendor bills : the items must be received in order to pay the invoice.">
<div class="o_setting_left_pane">
<field name="module_account_3way_match" string="3-way matching" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_account_3way_match"/>
<a href="https://www.odoo.com/documentation/16.0/applications/inventory_and_mrp/purchase/manage_deals/control_bills.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Make sure you only pay bills for which you received the goods you ordered
</div>
</div>
</div>
</div>
<h2>Products</h2>
<div class="row mt16 o_settings_container" name="matrix_setting_container">
<div class="col-12 col-lg-6 o_setting_box" id="variant_options">
<div class="o_setting_left_pane">
<field name="group_product_variant"/>
</div>
<div class="o_setting_right_pane">
<label for="group_product_variant"/>
<a href="https://www.odoo.com/documentation/16.0/applications/sales/sales/products_prices/products/variants.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Purchase variants of a product using attributes (size, color, etc.)
</div>
<div class="content-group" attrs="{'invisible': [('group_product_variant','=',False)]}">
<div class="mt8">
<button name="%(product.attribute_action)d" icon="fa-arrow-right" type="action" string="Attributes" class="btn-link"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box"
id="product_matrix"
title="If installed, the product variants will be added to purchase orders through a grid entry.">
<div class="o_setting_left_pane">
<field name="module_purchase_product_matrix"/>
</div>
<div class="o_setting_right_pane">
<label for="module_purchase_product_matrix" string="Variant Grid Entry"/>
<div class="text-muted">
Add several variants to the purchase order from a grid
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box"
id="stock_packaging_purchase"
title="Ability to select a package type in purchase orders and to force a quantity that is a multiple of the number of units per package.">
<div class="o_setting_left_pane">
<field name="group_stock_packaging"/>
</div>
<div class="o_setting_right_pane">
<label for="group_stock_packaging"/>
<div class="text-muted">
Purchase products by multiple of unit # per package
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
<record id="action_purchase_configuration" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'purchase', 'bin_size': False}</field>
</record>
<menuitem id="menu_purchase_general_settings" name="Settings" parent="menu_purchase_config"
sequence="0" action="action_purchase_configuration" groups="base.group_system"/>
</odoo>

View file

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_property_form" model="ir.ui.view">
<field name="name">res.partner.purchase.property.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority">36</field>
<field name="arch" type="xml">
<group name="purchase" position="inside">
<div name="receipt_reminder" colspan="2" class="o_checkbox_optional_field" groups='purchase.group_send_reminder'>
<label for="receipt_reminder_email"/>
<field name="receipt_reminder_email"/>
<div attrs="{'invisible': [('receipt_reminder_email', '=', False)]}">
<field name="reminder_date_before_receipt" class="oe_inline"/>
<span> day(s) before</span>
</div>
</div>
<field name="property_purchase_currency_id" options="{'no_create': True, 'no_open': True}" groups='base.group_multi_currency'/>
</group>
</field>
</record>
<record id="act_res_partner_2_purchase_order" model="ir.actions.act_window">
<field name="name">RFQs and Purchases</field>
<field name="res_model">purchase.order</field>
<field name="view_mode">tree,kanban,form,graph</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('purchase.purchase_order_tree')}),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('purchase.purchase_order_view_kanban_without_dashboard')}),
]"/>
<field name="context">{'search_default_partner_id': active_id, 'default_partner_id': active_id}</field>
<field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
This vendor has no purchase order. Create a new RfQ
</p><p>
The request for quotation is the first step of the purchases flow. Once
converted into a purchase order, you will be able to control the receipt
of the products and the vendor bill.
</p>
</field>
</record>
<!-- Partner kanban view inherited -->
<record model="ir.ui.view" id="purchase_partner_kanban_view">
<field name="name">res.partner.kanban.purchaseorder.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
<field name="arch" type="xml">
<field name="mobile" position="after">
<field name="purchase_order_count" groups="purchase.group_purchase_user"/>
</field>
<xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
<a t-if="record.purchase_order_count.value>0" data-type="action" data-name="%(purchase.act_res_partner_2_purchase_order)d"
groups="purchase.group_purchase_user"
href="#" class="oe_kanban_action oe_kanban_action_a me-1">
<span class="badge rounded-pill">
<i class="fa fa-fw fa-credit-card" role="img" aria-label="Purchases" title="Purchases"/>
<t t-out="record.purchase_order_count.value"/>
</span>
</a>
</xpath>
</field>
</record>
<record id="act_res_partner_2_supplier_invoices" model="ir.actions.act_window">
<field name="name">Vendor Bills</field>
<field name="res_model">account.move</field>
<field name="view_mode">tree,form,graph</field>
<field name="domain">[('move_type','in',('in_invoice', 'in_refund'))]</field>
<field name="context">{'search_default_partner_id': active_id, 'default_move_type': 'in_invoice', 'default_partner_id': active_id}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Record a new vendor bill
</p><p>
Vendors bills can be pre-generated based on purchase
orders or receipts. This allows you to control bills
you receive from your vendor according to the draft
document in Odoo.
</p>
</field>
</record>
<record id="res_partner_view_purchase_buttons" model="ir.ui.view">
<field name="name">res.partner.view.purchase.buttons</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="priority" eval="9"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" name="%(purchase.act_res_partner_2_purchase_order)d" type="action"
groups="purchase.group_purchase_user"
icon="fa-credit-card">
<field string="Purchases" name="purchase_order_count" widget="statinfo"/>
</button>
</div>
<page name="internal_notes" position="inside">
<group groups="purchase.group_purchase_user">
<group groups="purchase.group_warning_purchase" col="2">
<separator string="Warning on the Purchase Order" colspan="2"/>
<field name="purchase_warn" nolabel="1" colspan="2" required="1"/>
<field name="purchase_warn_msg" colspan="2" placeholder="Type a message..." nolabel="1"
attrs="{'required':[('purchase_warn','!=', False), ('purchase_warn','!=','no-message')], 'invisible':[('purchase_warn','in',(False,'no-message'))]}"/>
</group>
</group>
</page>
</field>
</record>
<record id="res_partner_view_purchase_account_buttons" model="ir.ui.view">
<field name="name">res.partner.view.purchase.account.buttons</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="priority" eval="12"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
</div>
</field>
</record>
</odoo>