Initial commit: OCA Workflow Process packages (456 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:00 +02:00
commit d366e42934
18799 changed files with 1284507 additions and 0 deletions

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018-2019 ForgeFlow, S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
<record model="ir.ui.view" id="product_template_form_view_inherit">
<field name="name">product.template.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.view_template_property_form" />
<field name="arch" type="xml">
<group name="operations" position="inside">
<field name="purchase_request" widget="boolean" />
</group>
</field>
</record>
</odoo>

View file

@ -0,0 +1,50 @@
<?xml version="1.0" ?>
<!-- Copyright 2018-2019 ForgeFlow, S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
<record id="purchase_order_form" model="ir.ui.view">
<field name="name">purchase.order.form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/tree" position="inside">
<field name="purchase_request_lines" invisible="1" />
<button
attrs="{'invisible': [('purchase_request_lines', '=', [])]}"
name="action_open_request_line_tree_view"
title="Request Lines"
type="object"
icon="fa-folder-open-o"
/>
</xpath>
</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="inherit_id" ref="purchase.purchase_order_line_form2" />
<field name="arch" type="xml">
<field name="name" position="after">
<separator string="Purchase Request Lines" />
<field name="purchase_request_lines" />
</field>
</field>
</record>
<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="inherit_id" ref="purchase.purchase_order_line_tree" />
<field name="arch" type="xml">
<xpath expr="//tree" position="inside">
<field name="purchase_request_lines" invisible="1" />
<button
attrs="{'invisible': [('purchase_request_lines', '=', [])]}"
name="action_open_request_line_tree_view"
title="Request Lines"
type="object"
icon="fa-folder-open-o"
/>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,628 @@
<?xml version="1.0" ?>
<!-- Copyright 2018-2019 ForgeFlow, S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
<record id="purchase_request_line_tree" model="ir.ui.view">
<field name="name">purchase.request.line.tree</field>
<field name="model">purchase.request.line</field>
<field name="arch" type="xml">
<tree
name="Purchase Request Lines"
create="false"
decoration-muted="cancelled == True"
decoration-info="request_state in ('draft', 'to_approve')"
>
<field name="request_id" />
<field
name="request_state"
widget="badge"
decoration-success="request_state in ('done', 'approved', 'in_progress')"
decoration-info="request_state in ('draft', 'to_approve')"
decoration-danger="request_state == 'rejected'"
/>
<field name="requested_by" widget="many2one_avatar_user" />
<field name="assigned_to" widget="many2one_avatar_user" />
<field name="date_required" />
<field name="estimated_cost" widget="monetary" />
<field name="currency_id" invisible="1" />
<field name="purchased_qty" />
<field
name="purchase_state"
widget="badge"
decoration-success="purchase_state == 'done'"
decoration-muted="purchase_state == 'draft'"
decoration-info="purchase_state in ('sent', 'purchase')"
decoration-warning="purchase_state == 'to_approve'"
decoration-danger="purchase_state == 'cancelled'"
/>
<field name="product_id" />
<field name="name" />
<field name="product_qty" />
<field name="product_uom_category_id" invisible="1" />
<field name="product_uom_id" groups="uom.group_uom" />
<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="supplier_id" />
<field
name="company_id"
groups="base.group_multi_company"
widget="selection"
/>
<field name="cancelled" invisible="1" />
<field name="qty_in_progress" invisible="1" />
<field name="qty_done" invisible="1" />
<field name="qty_cancelled" invisible="1" />
</tree>
</field>
</record>
<record id="purchase_request_line_form" model="ir.ui.view">
<field name="name">purchase.request.line.form</field>
<field name="model">purchase.request.line</field>
<field name="priority" eval="20" />
<field name="arch" type="xml">
<form string="Purchase Request Line" create="false" duplicate="false">
<header>
<field
name="request_state"
widget="statusbar"
statusbar_visible="draft,to_approve,approved,done,in_progress"
/>
</header>
<sheet>
<h1>
<field name="request_id" />
</h1>
<group name="main">
<group name="info">
<field
name="origin"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="requested_by"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="assigned_to"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="description"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="date_start"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="company_id"
groups="base.group_multi_company"
widget="selection"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field name="is_editable" invisible="1" />
</group>
<group name="settings">
<field
name="product_id"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="name"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<label for="product_qty" />
<div>
<field
name="product_qty"
class="oe_inline"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field name="product_uom_category_id" invisible="1" />
<field
name="product_uom_id"
groups="uom.group_uom"
class="oe_inline"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
</div>
<field
name="analytic_distribution"
widget="analytic_distribution"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'purchase_order'}"
/>
<field
name="date_required"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="estimated_cost"
widget="monetary"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field name="currency_id" invisible="1" />
<field name="cancelled" />
</group>
</group>
<group name="specifications">
<separator string="Specifications" />
<newline />
<field
name="specifications"
nolabel="1"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
</group>
<group name="quantities" string="Tracking">
<group>
<field name="pending_qty_to_receive" />
<field name="qty_in_progress" />
<field name="qty_done" />
<field name="qty_cancelled" />
</group>
</group>
<notebook>
<page name="purchase_lines" string="Purchase Order Lines">
<group>
<field name="purchased_qty" />
<field name="purchase_state" />
</group>
<field
name="purchase_lines"
mode="tree"
attrs="{'readonly': [('purchase_state', 'in', ('cancel'))]}"
domain="[('product_id', '=', product_id)]"
context="{'form_view_ref' : 'purchase_request.purchase_order_line_form2_sub',
'tree_view_ref' : 'purchase_request.purchase_order_line_tree_sub',
'search_view_ref' : 'purchase_request.purchase_order_line_search_sub'}"
/>
</page>
<page name="allocations" string="Allocations">
<field name="purchase_request_allocation_ids">
<tree decoration-muted="purchase_state == 'cancel'">
<field name="purchase_line_id" />
<field name="stock_move_id" />
<field name="product_id" />
<field name="requested_product_uom_qty" />
<field name="allocated_product_qty" />
<field name="open_product_qty" />
<field name="product_uom_id" />
<field name="purchase_state" invisible="1" />
</tree>
</field>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<record id="purchase_request_line_search" model="ir.ui.view">
<field name="name">purchase.request.line.search</field>
<field name="model">purchase.request.line</field>
<field name="arch" type="xml">
<search string="Search Purchase Request">
<field name="request_id" />
<field name="product_id" />
<field name="requested_by" />
<field name="assigned_to" />
<field name="date_start" />
<field name="date_required" />
<filter
name="purchase_state_none"
string="Purchasing not started"
domain="[('purchase_state','=', False)]"
help="No RFQ or Purchase has been created"
/>
<filter
name="purchase_state_draft"
string="Requested for Quotation"
domain="[('purchase_state','=','draft')]"
help="At least a Draft PO has been created"
/>
<filter
name="purchase_state_confirmed"
string="Purchase Confirmed"
domain="[('purchase_state','=','confirmed')]"
help="At least a PO has been confirmed"
/>
<filter
name="purchase_state_done"
string="Purchase Done"
domain="[('purchase_state','=','done')]"
help="At least a PO has been completed"
/>
<field
name="analytic_distribution"
groups="analytic.group_analytic_accounting"
/>
<field name="cancelled" invisible="1" />
<filter
name="request_state_draft"
string="Draft"
domain="[('request_state','=','draft')]"
help="Request is to be approved"
/>
<filter
name="request_state_to_approve"
string="To Approve"
domain="[('request_state','=','to_approve')]"
help="Request is to be approved"
/>
<filter
name="request_state_approved"
string="Approved"
domain="[('request_state','=','approved')]"
help="Request is approved"
/>
<filter
name="request_state_rejected"
string="Rejected"
domain="[('request_state','=','rejected')]"
help="Request is rejected"
/>
<filter
name="request_state_in_progress"
string="In Progress"
domain="[('request_state','=','in_progress')]"
help="Request is in progress"
/>
<filter
name="assigned_to_me"
domain="[( 'assigned_to','=', uid)]"
help="Assigned to me"
/>
<filter
name="my_requests"
domain="[('requested_by','=', uid)]"
help="My requests"
/>
<filter
name="uncancelled"
domain="[('cancelled','=', False)]"
string="Uncancelled"
/>
<filter
name="qty_to_buy"
string="Pending Qty to Receive"
domain="[('qty_to_buy','=',True)]"
/>
<filter
name="all_bought"
string="All Bought"
domain="[('qty_to_buy','=',False)]"
/>
<filter
name="open"
domain="[('qty_in_progress','!=', 0.0)]"
string="Open Quantity"
/>
<filter
name="cancel"
domain="[('qty_cancelled','>', 0.0)]"
string="Cancelled Quantity"
/>
<group expand="0" string="Group By...">
<filter
name="product"
string="Product"
domain="[]"
context="{'group_by' : 'product_id'}"
/>
<filter
name="requested_by"
string="Requested by"
domain="[]"
context="{'group_by':'requested_by'}"
/>
<filter
name="assigned_to"
string="Assigned to"
domain="[]"
context="{'group_by':'assigned_to'}"
/>
<filter
name="request_status"
string="Request status"
domain="[]"
context="{'group_by':'request_state'}"
/>
<filter
name="group_analytic_distribution"
string="Analytic Distribution"
domain="[]"
context="{'group_by':'analytic_distribution'}"
groups="analytic.group_analytic_accounting"
/>
<filter
name="purchase_status"
string="Purchase Status"
domain="[]"
context="{'group_by':'purchase_state'}"
/>
<filter
name="request"
string="Request"
domain="[]"
context="{'group_by':'request_id'}"
/>
</group>
</search>
</field>
</record>
<record
id="action_purchase_request_line_product_tree"
model="ir.actions.act_window"
>
<field name="context">
{'search_default_product_id': [active_id], 'default_product_id': active_id}
</field>
<field name="name">Purchase Requests</field>
<field name="res_model">purchase.request.line</field>
<field name="binding_model_id" ref="product.model_product_product" />
<field
name="groups_id"
eval="[(4, ref('purchase_request.group_purchase_request_user')),(4, ref('purchase_request.group_purchase_request_manager'))]"
/>
</record>
<record id="purchase_request_line_form_action" model="ir.actions.act_window">
<field name="name">Purchase Request Lines</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.request.line</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="purchase_request_line_search" />
</record>
<record
id="purchase_request_line_form_action_tree"
model="ir.actions.act_window.view"
>
<field eval="1" name="sequence" />
<field name="view_mode">tree</field>
<field name="view_id" ref="purchase_request_line_tree" />
<field name="act_window_id" ref="purchase_request_line_form_action" />
</record>
<record
id="purchase_request_line_form_action_form2"
model="ir.actions.act_window.view"
>
<field eval="2" name="sequence" />
<field name="view_mode">form</field>
<field name="view_id" ref="purchase_request_line_form" />
<field name="act_window_id" ref="purchase_request_line_form_action" />
</record>
<record id="purchase_order_line_form2_sub" model="ir.ui.view">
<field name="name">purchase.order.line.form2</field>
<field name="model">purchase.order.line</field>
<field name="arch" type="xml">
<form string="Purchase Order Lines" create="false" readonly="1">
<sheet>
<label for="order_id" readonly="1" class="oe_edit_only" />
<h1>
<field name="order_id" readonly="1" class="oe_inline" />
<label
for="date_order"
string=","
readonly="1"
attrs="{'invisible':[('date_order','=',False)]}"
/>
<field name="date_order" readonly="1" class="oe_inline" />
</h1>
<label for="partner_id" readonly="1" class="oe_edit_only" />
<h2>
<field name="partner_id" readonly="1" />
</h2>
<group>
<group>
<field name="product_id" readonly="1" />
<label for="product_qty" readonly="1" />
<div>
<field
name="product_qty"
readonly="1"
class="oe_inline"
/>
<field
name="product_uom"
readonly="1"
groups="uom.group_uom"
class="oe_inline"
/>
<field name="product_uom_category_id" invisible="1" />
</div>
<field name="price_unit" widget="monetary" readonly="1" />
</group>
<group>
<field
name="taxes_id"
widget="many2many_tags"
domain="[('type_tax_use', '=', 'purchase')]"
readonly="1"
/>
<field name="date_planned" widget="date" readonly="1" />
<field
name="company_id"
readonly="1"
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'}"
colspan="4"
/>
</group>
</group>
<field name="name" readonly="1" />
<separator string="Manual Invoices" />
<field name="invoice_lines" readonly="1" />
<separator string="Stock Moves" />
<field name="move_ids" readonly="1" />
<separator string="Purchase Request Lines" />
<field name="purchase_request_lines" readonly="1" />
</sheet>
</form>
</field>
</record>
<record id="purchase_order_line_tree_sub" 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 name="Purchase Order Lines" create="true">
<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="date_planned" widget="date" />
<field name="purchase_request_lines" invisible="1" />
</tree>
</field>
</record>
<record id="purchase_order_line_search_sub" 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 Line">
<field name="order_id" />
<field name="product_id" />
<field
name="partner_id"
string="Vendor"
filter_domain="[('partner_id', 'child_of', self)]"
/>
<filter
name="hide_cancelled"
string="Hide cancelled lines"
domain="[('state', '!=', 'cancel')]"
/>
<group expand="0" string="Group By">
<filter
name="order_reference"
string="Order Reference"
domain="[]"
context="{'group_by': 'order_id'}"
/>
<filter
name="groupby_supplier"
string="Vendor"
domain="[]"
context="{'group_by': 'partner_id'}"
/>
</group>
</search>
</field>
</record>
<record id="view_purchase_request_line_details" model="ir.ui.view">
<field name="name">purchase.request.line.details.form</field>
<field name="model">purchase.request.line</field>
<field name="priority">1000</field>
<field name="arch" type="xml">
<form>
<sheet>
<group name="main">
<group>
<field name="is_editable" invisible="1" />
<field
name="product_id"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="name"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<label for="product_qty" />
<div class="o_row">
<field
name="product_qty"
class="oe_inline"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field name="product_uom_category_id" invisible="1" />
<field
name="product_uom_id"
groups="uom.group_uom"
class="oe_inline"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
</div>
<field
name="analytic_distribution"
widget="analytic_distribution"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'purchase_order'}"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="date_required"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="estimated_cost"
widget="monetary"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field name="currency_id" invisible="1" />
<field name="cancelled" widget="boolean" />
</group>
</group>
<group name="specifications">
<separator string="Specifications" />
<newline />
<field
name="specifications"
nolabel="1"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
</group>
<group name="quantities" string="Tracking">
<group>
<field name="pending_qty_to_receive" />
<field name="qty_in_progress" />
<field name="qty_done" />
<field name="qty_cancelled" />
</group>
</group>
<notebook>
<page name="purchase_lines" string="Purchase Order Lines">
<group>
<group name="purchase_state">
<field name="purchased_qty" />
<field name="purchase_state" />
<field name="qty_in_progress" />
<field name="qty_done" />
</group>
</group>
<field name="purchase_lines" nolabel="1" />
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<menuitem
action="purchase_request_line_form_action"
id="menu_purchase_request_line"
parent="purchase.menu_procurement_management"
/>
<menuitem
id="menu_purchase_request_line_act"
sequence="20"
parent="menu_purchase_request"
action="purchase_request_line_form_action"
/>
</odoo>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2018-2019 ForgeFlow, S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
<record id="action_report_purchase_requests" model="ir.actions.report">
<field name="name">Purchase Request</field>
<field name="binding_model_id" ref="model_purchase_request" />
<field name="model">purchase.request</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">purchase_request.report_purchase_request</field>
<field name="report_file">purchase_request.report_purchase_request</field>
</record>
</odoo>

View file

@ -0,0 +1,483 @@
<?xml version="1.0" ?>
<!-- Copyright 2018-2019 ForgeFlow, S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<odoo>
<record id="view_purchase_request_form" model="ir.ui.view">
<field name="name">purchase.request.form</field>
<field name="model">purchase.request</field>
<field name="arch" type="xml">
<form string="Purchase Request">
<header>
<button
name="button_draft"
states="to_approve,approved,rejected,in_progress,done"
string="Reset"
type="object"
groups="purchase_request.group_purchase_request_manager"
/>
<button
name="button_to_approve"
states="draft"
string="Request approval"
type="object"
class="oe_highlight"
/>
<button
name="button_approved"
states="to_approve"
string="Approve"
type="object"
class="oe_highlight"
groups="purchase_request.group_purchase_request_manager"
/>
<button
name="button_in_progress"
states="approved"
string="In Progress"
type="object"
groups="purchase_request.group_purchase_request_manager"
/>
<button
name="%(action_purchase_request_line_make_purchase_order)d"
states="approved,in_progress"
string="Create RFQ"
type="action"
/>
<button
name="button_done"
states="approved,in_progress"
string="Done"
type="object"
class="oe_highlight"
groups="purchase_request.group_purchase_request_manager"
/>
<button
name="button_rejected"
states="to_approve,approved,in_progress"
string="Reject"
type="object"
groups="purchase_request.group_purchase_request_manager"
/>
<field
name="state"
widget="statusbar"
statusbar_visible="draft,to_approve,approved,done,in_progress"
statusbar_colors='{"approved":"blue"}'
/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button
type="object"
name="action_view_purchase_request_line"
class="oe_stat_button"
attrs="{'invisible':[('line_count', '=', 0)]}"
icon="fa-list"
>
<field name="line_count" widget="statinfo" string="Lines" />
</button>
<button
type="object"
name="action_view_purchase_order"
class="oe_stat_button"
attrs="{'invisible':[('purchase_count', '=', 0)]}"
icon="fa-shopping-cart"
string="Purchase Order"
>
<field
name="purchase_count"
widget="statinfo"
string="Purchase Orders"
/>
</button>
<button
type="object"
name="action_view_stock_picking"
class="oe_stat_button"
attrs="{'invisible':[('move_count', '=', 0)]}"
groups="stock.group_stock_manager"
icon="fa-truck"
string="Picking"
>
<field
name="move_count"
widget="statinfo"
string="Pickings"
/>
</button>
</div>
<div class="oe_edit_only">
<label for="name" class="oe_inline" />
</div>
<h1>
<field name="is_editable" invisible="1" />
<field name="is_name_editable" invisible="1" />
<field
name="name"
class="oe_inline"
attrs="{'readonly': [('is_name_editable','=', False)]}"
/>
</h1>
<group>
<group>
<field
name="requested_by"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="assigned_to"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
</group>
<group>
<field
name="origin"
class="oe_inline"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="description"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="group_id"
attrs="{'readonly': [('is_editable','=', False)]}"
groups="base.group_no_one"
/>
</group>
<group>
<field
name="date_start"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field
name="picking_type_id"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
<field name="company_id" invisible="1" />
<field
name="company_id"
groups="base.group_multi_company"
widget="selection"
attrs="{'readonly': [('is_editable','=', False)]}"
/>
</group>
</group>
<notebook>
<page string="Products">
<field
name="line_ids"
attrs="{'readonly': [('state', '!=', 'draft')]}"
>
<tree
decoration-muted="cancelled == True"
editable="bottom"
>
<field name="product_id" />
<field name="name" />
<field name="product_qty" />
<field
name="product_uom_category_id"
invisible="1"
/>
<field
name="product_uom_id"
invisible="1"
groups="!uom.group_uom"
/>
<field
name="product_uom_id"
groups="uom.group_uom"
/>
<field
name="analytic_distribution"
widget="analytic_distribution"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'purchase_order'}"
optional="hide"
/>
<field name="date_required" />
<field name="estimated_cost" widget="monetary" />
<field name="currency_id" invisible="1" />
<field name="cancelled" invisible="1" />
<field name="is_editable" invisible="1" />
<field name="purchased_qty" />
<field
name="purchase_state"
widget="badge"
decoration-success="purchase_state == ('done')"
decoration-muted="purchase_state == ('draft')"
decoration-info="purchase_state in ('sent', 'purchase')"
decoration-warning="purchase_state == ('to_approve')"
decoration-danger="purchase_state == 'cancelled'"
/>
<button
name="action_show_details"
type="object"
icon="fa-list"
title="Show Details"
width="0.1"
options='{"warn": true}'
/>
</tree>
</field>
<group class="oe_subtotal_footer oe_right">
<field name="currency_id" invisible="1" />
<div class="oe_subtotal_footer_separator oe_inline">
<label for="estimated_cost" />
</div>
<field
name="estimated_cost"
nolabel="1"
class="oe_subtotal_footer_separator"
widget="monetary"
options="{'currency_field': 'currency_id'}"
/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="activity_ids" widget="mail_activity" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<record id="view_purchase_request_tree" model="ir.ui.view">
<field name="name">purchase.request.tree</field>
<field name="model">purchase.request</field>
<field name="arch" type="xml">
<tree
decoration-bf="message_needaction==True"
decoration-info="state in ('draft','to_approve')"
decoration-muted="state in ('rejected')"
name="Purchase Request"
>
<field name="message_needaction" invisible="1" />
<field name="name" />
<field name="date_start" />
<field name="requested_by" widget="many2one_avatar_user" />
<field
name="company_id"
groups="base.group_multi_company"
widget="selection"
/>
<field name="activity_ids" widget="list_activity" optional="show" />
<field name="origin" />
<field name="currency_id" invisible="1" />
<field name="estimated_cost" optional="hide" />
<field
name="state"
widget="badge"
decoration-success="state in ('done', 'approved', 'in_progress')"
decoration-muted="state == 'draft'"
decoration-warning="state == 'to_approve'"
decoration-danger="state == 'rejected'"
/>
</tree>
</field>
</record>
<record id="view_purchase_request_search" model="ir.ui.view">
<field name="name">purchase.request.list.select</field>
<field name="model">purchase.request</field>
<field name="arch" type="xml">
<search string="Search Purchase Request">
<field name="name" string="Purchase Request" />
<separator />
<field name="product_id" />
<field name="state" />
<filter
name="unassigned"
string="Unassigned"
domain="[('assigned_to','=', False)]"
help="Unassigned Request"
/>
<separator />
<filter
name="state_draft"
string="Draft"
domain="[('state','=','draft')]"
help="Request is to be approved"
/>
<filter
name="state_to_approve"
string="To Approve"
domain="[('state','=','to_approve')]"
help="Request is to be approved"
/>
<filter
name="state_approved"
string="Approved"
domain="[('state','=','approved')]"
help="Request is approved"
/>
<filter
name="state_in_progress"
string="In Progress"
domain="[('state','=','in_progress')]"
help="Request is in progress"
/>
<filter
name="state_rejected"
string="Rejected"
domain="[('state','=','rejected')]"
help="Request is rejected"
/>
<filter
name="state_done"
string="Done"
domain="[('state','=','done')]"
help="Request is done"
/>
<separator />
<filter
string="Unread Messages"
name="message_needaction"
domain="[('message_needaction','=',True)]"
/>
<filter
name="assigned_to_me"
domain="[('assigned_to','=', uid)]"
help="Assigned to me"
/>
<filter
name="my_requests"
domain="[('requested_by','=', uid)]"
help="My requests"
/>
<field name="requested_by" />
<field name="assigned_to" />
<field name="picking_type_id" />
<group expand="0" string="Group By...">
<filter
name="requested_by"
string="Requested by"
icon="fa-user"
domain="[]"
context="{'group_by':'requested_by'}"
/>
<filter
name="assigned_to"
string="Assigned to"
icon="fa-user"
domain="[]"
context="{'group_by':'assigned_to'}"
/>
<filter
name="source"
string="Source"
icon="fa-caret-square-o-left"
domain="[]"
context="{'group_by':'origin'}"
/>
<filter
name="start_date"
string="Start Date"
icon="fa-calendar"
domain="[]"
context="{'group_by':'date_start'}"
/>
</group>
</search>
</field>
</record>
<record id="view_purchase_request_kanban" model="ir.ui.view">
<field name="name">purchase.request.kanban</field>
<field name="model">purchase.request</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" quick_create="false">
<field name="name" />
<field name="requested_by" readonly="1" />
<field name="estimated_cost" />
<field name="state" />
<field name="date_start" />
<field name="currency_id" readonly="1" />
<field name="activity_state" />
<progressbar
field="activity_state"
colors="{&quot;planned&quot;: &quot;success&quot;, &quot;today&quot;: &quot;warning&quot;, &quot;overdue&quot;: &quot;danger&quot;}"
/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_record_top mb16">
<div class="o_kanban_record_headings ms-1">
<strong class="o_kanban_record_title"><span><t
t-esc="record.requested_by.value"
/></span></strong>
</div>
<strong><field
name="estimated_cost"
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_start.value"
/></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', 'rejected': 'default', 'done': 'success', 'approved': 'warning'}}"
/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record model="ir.actions.act_window" id="purchase_request_form_action">
<field name="name">Purchase Requests</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">purchase.request</field>
<field name="view_mode">tree,kanban,form</field>
<field name="context">{"search_default_requested_by":uid}</field>
<field name="search_view_id" ref="view_purchase_request_search" />
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to start a new purchase request process.
</p>
<p>
A purchase request is an instruction to Purchasing to procure
a certain quantity of materials services, so that they are
available at a certain point in time.
</p>
</field>
</record>
<menuitem
id="menu_purchase_request_pro_mgt"
parent="purchase.menu_procurement_management"
action="purchase_request_form_action"
/>
<menuitem
id="parent_menu_purchase_request"
name="Purchase Requests"
sequence="22"
web_icon="purchase_request,static/description/icon.png"
groups="group_purchase_request_user,group_purchase_request_manager"
/>
<menuitem
id="menu_purchase_request"
name="Purchase Requests"
parent="parent_menu_purchase_request"
groups="group_purchase_request_user,group_purchase_request_manager"
/>
<menuitem
id="menu_purchase_request_act"
sequence="10"
parent="menu_purchase_request"
action="purchase_request_form_action"
/>
</odoo>

View file

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_stock_move_operations" model="ir.ui.view">
<field name="name">stock.move.operations.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_stock_move_operations" />
<field name="arch" type="xml">
<field name="move_line_ids" position="after">
<newline />
<field name="purchase_request_allocation_ids" />
</field>
</field>
</record>
<record id="purchase_request_allocation" model="ir.ui.view">
<field name="name">purchase.request.allocation</field>
<field name="model">purchase.request.allocation</field>
<field name="arch" type="xml">
<tree name="Allocations">
<field name="id" />
<field name="purchase_request_line_id" />
<field name="stock_move_id" />
<field name="purchase_line_id" />
<field name="product_id" />
<field name="requested_product_uom_qty" />
<field name="allocated_product_qty" />
<field name="open_product_qty" />
</tree>
</field>
</record>
<record id="view_move_form" model="ir.ui.view">
<field name="name">stock.move.form</field>
<field name="model">stock.move</field>
<field name="inherit_id" ref="stock.view_move_form" />
<field name="arch" type="xml">
<group name="linked_group" position="after">
<group name="allocations" string="Purchase Request Allocations">
<field name="purchase_request_allocation_ids" />
</group>
</group>
</field>
</record>
</odoo>

View file

@ -0,0 +1,18 @@
<odoo>
<record id="view_picking_form" model="ir.ui.view">
<field name="name">stock.picking.form</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='move_ids_without_package']/form/group"
position="after"
>
<newline />
<group name="allocations" string="Purchase Request Allocations">
<field name="purchase_request_allocation_ids" />
</group>
</xpath>
</field>
</record>
</odoo>