mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-22 08:12:01 +02:00
19.0 vanilla
This commit is contained in:
parent
d1963a3c3a
commit
2d3ee4855a
7430 changed files with 2687981 additions and 2965473 deletions
|
|
@ -8,14 +8,19 @@
|
|||
<!-- 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"/>
|
||||
<field name="purchase_id" invisible="1" readonly="state != 'draft'"/>
|
||||
<label for="purchase_vendor_bill_id" string="Auto-Complete" class="oe_edit_only"
|
||||
attrs="{'invisible': ['|', ('state','!=','draft'), ('move_type', '!=', 'in_invoice')]}" />
|
||||
invisible="state != 'draft' or move_type not in ('in_invoice', 'in_refund')" />
|
||||
<field name="purchase_vendor_bill_id" nolabel="1"
|
||||
attrs="{'invisible': ['|', ('state','!=','draft'), ('move_type', '!=', 'in_invoice')]}"
|
||||
invisible="state != 'draft' or move_type not in ('in_invoice', 'in_refund')"
|
||||
readonly="state != 'draft'"
|
||||
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"
|
||||
domain = "[('partner_id.commercial_partner_id', '=', commercial_partner_id)] if partner_id else [] + [
|
||||
'|',
|
||||
('vendor_bill_id', '=', False),
|
||||
('vendor_bill_id.move_type', '=', move_type)
|
||||
]"
|
||||
placeholder="Select a purchase document"
|
||||
context="{'show_total_amount': True}"
|
||||
options="{'no_create': True, 'no_open': True}"/>
|
||||
</t>
|
||||
|
|
@ -27,23 +32,42 @@
|
|||
<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 expr="//field[@name='invoice_line_ids']/list/field[@name='company_id']" position="after">
|
||||
<field name="purchase_line_id" groups="purchase.group_purchase_user" column_invisible="True"/>
|
||||
<field name="purchase_order_id" groups="purchase.group_purchase_user" column_invisible="parent.move_type not in ('in_invoice', 'in_receipt')" 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 expr="//field[@name='journal_line_ids' or @name='line_ids']/list/field[@name='company_id']" position="after">
|
||||
<field name="purchase_line_id" groups="purchase.group_purchase_user" column_invisible="True"/>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='button_box']" position="inside">
|
||||
<button class="oe_stat_button"
|
||||
name="action_purchase_matching"
|
||||
type="object"
|
||||
groups="purchase.group_purchase_user"
|
||||
icon="fa-bullseye"
|
||||
invisible="not partner_id or move_type not in ('in_invoice', 'in_refund') or is_purchase_matched">
|
||||
<div class="o_field_statinfo">
|
||||
<span class="o_stat_text">Purchase Matching</span>
|
||||
</div>
|
||||
</button>
|
||||
<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"/>
|
||||
invisible="purchase_order_count == 0 or move_type not in ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt')">
|
||||
<field string="Purchases" name="purchase_order_name" widget="statinfo" invisible="purchase_order_count != 1"/>
|
||||
<field string="Purchases" name="purchase_order_count" widget="statinfo" invisible="purchase_order_count == 1"/>
|
||||
</button>
|
||||
</xpath>
|
||||
<header position="after">
|
||||
<div class="alert alert-warning" role="alert" invisible="not purchase_warning_text or move_type != 'in_invoice'">
|
||||
<field name="purchase_warning_text" class="fw-bold"/>
|
||||
</div>
|
||||
</header>
|
||||
<list name="journal_items" position="attributes">
|
||||
<attribute name="decoration-warning" add="(purchase_line_warn_msg and move_type == 'in_invoice')" separator=" or "/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<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)]}"
|
||||
icon="fa-credit-card" invisible="purchase_order_count == 0"
|
||||
groups="purchase.group_purchase_user">
|
||||
<field string="Purchase Orders" name="purchase_order_count" widget="statinfo"/>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -17,19 +17,26 @@
|
|||
</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 id="portal_my_home_purchase" name="Requests for Quotation / Purchase Orders" customize_show="True" inherit_id="portal.portal_my_home" priority="25">
|
||||
<xpath expr="//div[hasclass('o_portal_docs')]" position="before">
|
||||
<t t-set="portal_vendor_category_enable" t-value="True"/>
|
||||
</xpath>
|
||||
<div id="portal_vendor_category" position="inside">
|
||||
<t t-call="portal.portal_docs_entry">
|
||||
<t t-set="icon" t-value="'/web/static/img/rfq.svg'"/>
|
||||
<t t-set="text">Follow your Requests for Quotation</t>
|
||||
<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="icon" t-value="'/purchase/static/src/img/calculator.svg'"/>
|
||||
<t t-set="text">Follow orders you have to fulfill</t>
|
||||
<t t-set="title">Our Orders</t>
|
||||
<t t-set="url" t-value="'/my/purchase'"/>
|
||||
<t t-set="placeholder_count" t-value="'purchase_count'"/>
|
||||
</t>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template id="portal_my_purchase_rfqs" name="My Requests For Quotation">
|
||||
|
|
@ -40,7 +47,7 @@
|
|||
<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>
|
||||
<p class="alert alert-warning">There are currently no requests for quotation for your account.</p>
|
||||
</t>
|
||||
<t t-if="rfqs" t-call="portal.portal_table">
|
||||
<thead>
|
||||
|
|
@ -50,7 +57,6 @@
|
|||
<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">
|
||||
|
|
@ -60,9 +66,6 @@
|
|||
<span t-field="rfq.date_order" t-options="{'widget': 'date'}"/>&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>
|
||||
|
|
@ -77,114 +80,131 @@
|
|||
<t t-set="title">Purchase Orders</t>
|
||||
</t>
|
||||
<t t-if="not orders">
|
||||
<p>There are currently no purchase orders for your account.</p>
|
||||
<p class="alert alert-warning">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>
|
||||
<th id="order_name_header">
|
||||
<span class='d-none d-md-inline'>Purchase Order #</span>
|
||||
<span class='d-block d-md-none'>Ref.</span>
|
||||
</th>
|
||||
<th class="text-end">
|
||||
<th id="order_confirmation_header" 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>
|
||||
<th id="order_badge_header" class="text-center"/>
|
||||
<th id="order_total_header" 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">
|
||||
<td id="order_name"><a t-att-href="order.get_portal_url()"><t t-esc="order.name"/></a></td>
|
||||
<td id="order_confirmation" class="text-end">
|
||||
<span t-field="order.date_approve" t-options="{'widget': 'date'}"/>&nbsp;
|
||||
<span class='d-none d-md-inline' t-field="order.date_approve" t-options="{'time_only': True}"/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<td id="order_badge" 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>
|
||||
<td id="order_total" 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">
|
||||
<template id="portal_my_purchase_order" name="Purchase Order" 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&id=%s&action=%s&view_type=form' % (order._name, order.id, order.env.ref('purchase.purchase_rfq').id)"/>
|
||||
<t t-set="backend_url" t-value="'/odoo/action-purchase.purchase_rfq/%s' % (order.id)"/>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<div class="row mt16 o_portal_purchase_sidebar">
|
||||
<div class="row 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="classes" t-value="'col-lg-4 col-xxl-3 d-print-none'"/>
|
||||
|
||||
<t t-set="title">
|
||||
<h2 class="mb-0"><b t-field="order.amount_total" data-id="total_amount"/> </h2>
|
||||
<h2 t-field="order.amount_total" data-id="total_amount" class="mb-0 text-break"/>
|
||||
</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">
|
||||
<div class="d-flex flex-column gap-4 mt-3">
|
||||
<a class="btn btn-secondary o_print_btn o_portal_invoice_print" t-att-href="order.get_portal_url(report_type='pdf')" id="print_invoice_report" title="View Details" role="button" target="_blank"><i class="fa fa-print me-1"/>Download / Print</a>
|
||||
<div class="navspy flex-grow-1 ps-0" t-ignore="true" role="complementary">
|
||||
<ul class="nav flex-column bs-sidenav"></ul>
|
||||
</li>
|
||||
</div>
|
||||
<div t-if="order.user_id">
|
||||
<h6 class="small text-muted">Buyer</h6>
|
||||
<t t-call="portal.portal_my_contact">
|
||||
<t t-set="_contactAvatar" t-value="image_data_uri(order.user_id.avatar_128)"/>
|
||||
<t t-set="_contactName" t-value="order.user_id.name"/>
|
||||
<t t-set="_contactLink" t-value="True"/>
|
||||
<div t-field="order.user_id" t-options='{"widget": "contact", "fields": ["phone"], "no_marker": False}'/>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<div t-if="order._get_edi_builders()">
|
||||
<button id="portal_connect_software_modal_btn" type="button" class="btn btn-primary"
|
||||
data-bs-toggle="modal" data-bs-target="#portal_connect_software_modal">
|
||||
Connect with your software!
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
<div class="modal fade" id="portal_connect_software_modal" tabindex="-1" role="dialog" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div>
|
||||
<h5>Want to import this document in Odoo?</h5>
|
||||
<p>Drag and drop the request for quotation PDF file into your list of quotations in Odoo. Enjoy the automation!</p>
|
||||
</div>
|
||||
<div>
|
||||
<h5>Not using Odoo?</h5>
|
||||
<div class="input-group mb-3 w-50">
|
||||
<t t-set="base_address" t-value="order.env['ir.config_parameter'].sudo().get_param('web.base.url')"/>
|
||||
<t t-set="doc_url" t-value="base_address + '/my/purchase/' + str(order.id) + '/download_edi?' + str(keep_query())"/>
|
||||
<input type="text" class="form-control" aria-describedby="copy-button" readonly="readonly" t-att-value="doc_url"/>
|
||||
<button class="btn btn-outline-secondary" type="button" id="copy-button"
|
||||
t-attf-onclick="navigator.clipboard.writeText('#{doc_url}')">Copy</button>
|
||||
</div>
|
||||
<p>Use the above REST URL to get structured data of the purchase order in UBL format.
|
||||
<a href="https://www.odoo.com/documentation/">Read the documentation </a>to learn all the ways to connect your software with <a href="https://www.odoo.com">Odoo</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<h5>You don't use a good CRM software?</h5>
|
||||
<p><a href="https://www.odoo.com/app/sales">Start on Odoo</a>, it's 100% free! You'll save time creating beautiful quotations and track sales.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-between">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 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>
|
||||
|
||||
<div id="quote_content" class="o_portal_content col-12 col-lg-8 col-xxl-9">
|
||||
<!-- 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 id="portal_purchase_content">
|
||||
<div><t t-call="purchase.purchase_order_portal_content"/></div>
|
||||
</div>
|
||||
|
||||
<!-- chatter -->
|
||||
<div id="purchase_order_communication" class="mt-4">
|
||||
<h2>History</h2>
|
||||
<hr/>
|
||||
<div id="purchase_order_communication">
|
||||
<h3>Communication history</h3>
|
||||
<t t-call="portal.message_thread"/>
|
||||
</div>
|
||||
</div><!-- // #quote_content -->
|
||||
|
|
@ -194,7 +214,7 @@
|
|||
|
||||
<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 ''}">
|
||||
<div id="introduction" class="mt-5 mt-lg-0 pb-2 pt-0">
|
||||
<h2 class="my-0">
|
||||
<t t-if="order.state in ['draft', 'sent']">Request for Quotation</t>
|
||||
<t t-else="1">
|
||||
|
|
@ -204,7 +224,7 @@
|
|||
</h2>
|
||||
</div>
|
||||
|
||||
<div t-attf-class="#{'card-body' if report_type == 'html' else ''}">
|
||||
<div>
|
||||
<!-- Informations -->
|
||||
<div id="informations">
|
||||
<div class="row" id="po_date">
|
||||
|
|
@ -212,7 +232,7 @@
|
|||
<t t-if="order.state in ['draft', 'sent']">
|
||||
<strong>Request For Quotation Date:</strong>
|
||||
</t>
|
||||
<t t-if="order.state in ['purchase', 'done', 'cancel']">
|
||||
<t t-if="order.state in ['purchase', 'cancel']">
|
||||
<strong>Order Date:</strong>
|
||||
</t>
|
||||
<span t-field="order.date_order" t-options='{"widget": "date"}'/>
|
||||
|
|
@ -222,7 +242,9 @@
|
|||
<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/>
|
||||
<t t-if="order.date_approve">
|
||||
<strong>Confirmation Date:</strong> <span t-field="order.date_approve" t-options='{"widget": "date"}'/><br/>
|
||||
</t>
|
||||
<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>
|
||||
|
|
@ -243,9 +265,9 @@
|
|||
</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>
|
||||
<span t-if="i.payment_state in ('paid', 'in_payment')" class="badge rounded-pill text-bg-success small"><i class="fa fa-fw fa-check"/>Paid</span>
|
||||
<span t-elif="i.payment_state == 'reversed'" class="badge rounded-pill text-bg-success small"><i class="fa fa-fw fa-check"/>Reversed</span>
|
||||
<span t-else="" class="small badge rounded-pill text-bg-primary"><i class="fa fa-fw fa-clock-o"/>Waiting Payment</span>
|
||||
</div>
|
||||
</t>
|
||||
</ul>
|
||||
|
|
@ -258,19 +280,19 @@
|
|||
|
||||
<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">
|
||||
<t t-set="display_price_and_taxes" t-value="not update_dates and order.state == 'purchase'"/>
|
||||
<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 '' }}">
|
||||
<th t-if="display_price_and_taxes" t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">Unit Price</th>
|
||||
<th t-if="display_price_and_taxes" 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 t-if="display_price_and_taxes" t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">Disc.%</th>
|
||||
<th class="text-end" t-if="display_price_and_taxes" >
|
||||
<span>Amount</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -278,52 +300,55 @@
|
|||
|
||||
<t t-set="current_subtotal" t-value="0"/>
|
||||
|
||||
<t t-foreach="order.order_line" t-as="line">
|
||||
<t t-foreach="order.order_line.filtered(lambda l: l.display_type or l.product_qty != 0)" 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"/>
|
||||
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal"/>
|
||||
|
||||
<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 ''">
|
||||
<tr t-att-class="'fw-bolder o_line_section' if line.display_type == 'line_section' else 'fw-bold o_line_subsection' if line.display_type == 'line_subsection' else 'fst-italic text-break o_line_note' 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"/>
|
||||
<td id="product_name" class="d-flex">
|
||||
<img t-att-src="line.product_id.image_128 and image_data_uri(line.product_id.image_128) or '/web/static/img/placeholder.png'"
|
||||
alt="Product" class="d-none d-lg-inline o_purchase_portal_product_image"/>
|
||||
<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"/>
|
||||
<span t-field="line.product_uom_id" 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}"/>
|
||||
<input type="text"
|
||||
class="form-control datetimepicker-input o-purchase-datetimepicker text-end"
|
||||
t-att-data-access-token="order.access_token"
|
||||
t-att-data-order-id="order.id"
|
||||
t-att-data-line-id="line.id"
|
||||
t-att-data-value="line.date_planned.isoformat()"
|
||||
/>
|
||||
</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 '' }}">
|
||||
<td t-if="display_price_and_taxes" 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 t-if="display_price_and_taxes" t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
|
||||
<span t-out="', '.join(map(lambda x: (x.name), line.tax_ids))"/>
|
||||
</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-if="display_price_and_taxes" t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
|
||||
<div t-field="line.discount" class="text-end"/>
|
||||
</td>
|
||||
<td class="text-end" t-if="not update_dates and order.state == 'purchase'">
|
||||
<span class="oe_order_line_price_subtotal" t-field="line.price_subtotal"/>
|
||||
</td>
|
||||
</t>
|
||||
<t t-if="line.display_type == 'line_section'">
|
||||
<t t-if="line.display_type in ('line_section', 'line_subsection')">
|
||||
<td colspan="99">
|
||||
<span t-field="line.name"/>
|
||||
</td>
|
||||
|
|
@ -336,8 +361,7 @@
|
|||
</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']">
|
||||
<t t-if="current_section and (line_last or order.order_line[line_index+1].display_type in ('line_section', 'line_subsection')) and order.state == 'purchase'">
|
||||
<tr class="is-subtotal text-end">
|
||||
<td colspan="99">
|
||||
<strong class="mr16">Subtotal</strong>
|
||||
|
|
@ -353,17 +377,17 @@
|
|||
</table>
|
||||
</div>
|
||||
|
||||
<div id="total" t-if="order.state in ['purchase', 'done']" class="row" name="total" style="page-break-inside: avoid;">
|
||||
<div id="total" t-if="order.state == 'purchase'" 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">
|
||||
<section id="terms" class="mt-5" t-if="order.note">
|
||||
<h3 class="">Terms & Conditions</h3>
|
||||
<hr class="mt-0 mb-1"/>
|
||||
<em t-field="order.notes"/>
|
||||
<em t-field="order.note"/>
|
||||
</section>
|
||||
|
||||
<section class="mt-5" t-if="order.payment_term_id">
|
||||
|
|
@ -376,16 +400,18 @@
|
|||
|
||||
<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"/>
|
||||
<t t-call="purchase.document_tax_totals">
|
||||
<t t-set="tax_totals" t-value="order.tax_totals"/>
|
||||
<t t-set="currency" t-value="order.currency_id"/>
|
||||
</t>
|
||||
</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">
|
||||
<div id="portal_purchase_content">
|
||||
<t t-set="update_dates" t-value="True"/>
|
||||
<div t-call="purchase.purchase_order_portal_content"/>
|
||||
<div><t t-call="purchase.purchase_order_portal_content"/></div>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
<?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>
|
||||
|
|
@ -3,17 +3,17 @@
|
|||
|
||||
<!-- Product Suppliers-->
|
||||
<record id="product_supplierinfo_tree_view2" model="ir.ui.view">
|
||||
<field name="name">product.supplierinfo.tree.view2</field>
|
||||
<field name="name">product.supplierinfo.list.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">
|
||||
<xpath expr="//list" position="attributes">
|
||||
<attribute name="editable">bottom</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//tree" position="inside">
|
||||
<field name="company_id" invisible="1"/>
|
||||
<xpath expr="//list" position="inside">
|
||||
<field name="company_id" column_invisible="True"/>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='company_id']" position="attributes">
|
||||
<attribute name="readonly">0</attribute>
|
||||
|
|
@ -25,10 +25,27 @@
|
|||
<xpath expr="//field[@name='product_id']" position="attributes">
|
||||
<attribute name="readonly">0</attribute>
|
||||
<attribute name="options">{'no_create': True, 'no_open': True}</attribute>
|
||||
<attribute name="domain">[('product_tmpl_id', '=', parent.id)]</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='delay']" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='min_qty']" position="attributes">
|
||||
<attribute name="optional">show</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_product_supplierinfo_tree_view2" model="ir.ui.view">
|
||||
<field name="name">product.supplierinfo.list.view2.product</field>
|
||||
<field name="model">product.supplierinfo</field>
|
||||
<field name="inherit_id" ref="purchase.product_supplierinfo_tree_view2"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="priority" eval="1000"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_id']" position="attributes">
|
||||
<attribute name="domain">[('product_tmpl_id', '=', parent.product_tmpl_id)]</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -38,11 +55,12 @@
|
|||
<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>
|
||||
<attribute name="invisible" remove="1" separator="or"/>
|
||||
<attribute name="groups">purchase.group_purchase_user</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','>',1)], 'readonly': [('product_variant_count','>',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','<=',1)], 'readonly': [('product_variant_count','<=',1)]}"/>
|
||||
<field name="seller_ids" context="{'default_product_tmpl_id': id, 'default_price': standard_price, 'product_template_invisible_variant': True, 'list_view_ref':'purchase.product_supplierinfo_tree_view2'}" nolabel="1" invisible="product_variant_count > 1" readonly="product_variant_count > 1"/>
|
||||
<field name="variant_seller_ids" context="{'model': 'product.template', 'active_id': id, 'list_view_ref':'purchase.product_supplierinfo_tree_view2'}" nolabel="1" invisible="product_variant_count <= 1" readonly="product_variant_count <= 1"/>
|
||||
</group>
|
||||
<group name="bill" position="attributes">
|
||||
<attribute name="groups">purchase.group_purchase_manager</attribute>
|
||||
|
|
@ -56,26 +74,26 @@
|
|||
<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 string="Warning on Purchase Orders" groups="purchase.group_warning_purchase">
|
||||
<field name="purchase_line_warn_msg"
|
||||
placeholder="e.g. There is a newer version of this product."
|
||||
nolabel="1" colspan="2"/>
|
||||
</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"/>
|
||||
<record id="view_product_product_supplier_inherit" model="ir.ui.view">
|
||||
<field name="name">product.product.form</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_normal_form_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_account_expense_id" position="attributes">
|
||||
<attribute name="attrs">{'readonly': [('purchase_ok', '=', 0)]}</attribute>
|
||||
<field name="seller_ids" position="attributes">
|
||||
<attribute name="context">{'default_product_tmpl_id': product_tmpl_id, 'product_template_invisible_variant': True, 'default_price': standard_price, 'list_view_ref':'purchase.product_product_supplierinfo_tree_view2'}</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 name="variant_seller_ids" position="attributes">
|
||||
<attribute name="context">{'model': 'product.product', 'active_id': id, 'default_price': standard_price, 'list_view_ref':'purchase.product_product_supplierinfo_tree_view2'}</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
|
@ -85,19 +103,19 @@
|
|||
<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 name="action_open_documents" position="after">
|
||||
<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">
|
||||
type="object" icon="fa-credit-card" invisible="not purchase_ok" 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 class="o_stat_value d-flex gap-1">
|
||||
<field name="purchased_product_qty" widget="statinfo" nolabel="1" class="oe_inline"/>
|
||||
<field name="uom_name" class="oe_inline" groups="uom.group_uom"/>
|
||||
</span>
|
||||
<span class="o_stat_text">Purchased</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</button>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -109,11 +127,11 @@
|
|||
<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">
|
||||
type="object" icon="fa-credit-card" invisible="not purchase_ok" 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 class="o_stat_value d-flex gap-1">
|
||||
<field name="purchased_product_qty" widget="statinfo" nolabel="1" class="oe_inline"/>
|
||||
<field name="uom_name" class="oe_inline" groups="uom.group_uom"/>
|
||||
</span>
|
||||
<span class="o_stat_text">Purchased</span>
|
||||
</div>
|
||||
|
|
@ -122,4 +140,50 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_template_search_view_purchase" model="ir.ui.view">
|
||||
<field name="name">product.template.search.purchase</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit_id" ref="product.product_template_search_view"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="categ_id" position="after">
|
||||
<field name="seller_ids" string="Vendor"/>
|
||||
</field>
|
||||
<filter name="filter_to_sell" position="after">
|
||||
<filter name="filter_to_purchase" string="Purchase" domain="[('purchase_ok', '=', True)]"/>
|
||||
</filter>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Product catalog -->
|
||||
<record id="product_view_kanban_catalog_purchase_only" model="ir.ui.view">
|
||||
<field name="name">product.view.kanban.catalog.purchase</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="inherit_id" ref="product.product_view_kanban_catalog"/>
|
||||
<field name="mode">primary</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//kanban" position="attributes">
|
||||
<attribute name="js_class">purchase_product_kanban_catalog</attribute>
|
||||
<attribute name="sample">1</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="product_view_search_catalog" model="ir.ui.view">
|
||||
<field name="name">product.view.search.catalog.inherit.purchase</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="mode">primary</field>
|
||||
<field name="inherit_id" ref="product.product_view_search_catalog"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='product_tmpl_id']" position="after">
|
||||
<field name="seller_ids" string="Vendor"/>
|
||||
</xpath>
|
||||
<xpath expr="//filter[@name='goods']" position="after">
|
||||
<separator/>
|
||||
<filter string="In the Order"
|
||||
name="products_in_purchase_order"
|
||||
domain="[('is_in_purchase_order', '=', True)]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="purchase_bill_line_match_tree" model="ir.ui.view">
|
||||
<field name="name">purchase.bill.line.match.list</field>
|
||||
<field name="model">purchase.bill.line.match</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="Purchase Bill Lines"
|
||||
decoration-info="pol_id != False"
|
||||
decoration-muted="state == 'draft'"
|
||||
editable="bottom" edit="1"
|
||||
type="object">
|
||||
<header>
|
||||
<button name="action_match_lines" type="object" string="Match" groups="account.group_account_invoice" class="btn btn-primary"/>
|
||||
<button name="action_add_to_po" type="object" string="Add to PO" groups="purchase.group_purchase_user"/>
|
||||
</header>
|
||||
<field name="partner_id" string="Vendor" optional="hidden"/>
|
||||
<field name="reference" widget="open_match_line_widget"/>
|
||||
<field name="display_name" string="Product Description" decoration-it="not product_id"/>
|
||||
<field name="product_uom_qty" string="Quantity"/>
|
||||
<field name="qty_invoiced" optional="hidden"/>
|
||||
<field name="qty_to_invoice" optional="show"/>
|
||||
<field name="product_uom_id" groups="uom.group_uom"/>
|
||||
<field name="product_uom_price" string="Price"/>
|
||||
<field name="billed_amount_untaxed" widget="monetary_no_zero" sum="Total Billed" string="Billed"/>
|
||||
<field name="purchase_amount_untaxed" widget="monetary_no_zero" sum="Total Purchased" string="Purchased"/>
|
||||
<field name="currency_id" column_invisible="1"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -7,171 +7,74 @@
|
|||
<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">
|
||||
<xpath expr="//form" position="inside">
|
||||
<app data-string="Purchase" string="Purchase" name="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>
|
||||
<block title="Orders" name="purchase_setting_container">
|
||||
<setting id="po_order_approval" company_dependent="1" help="Request managers to approve orders above a minimum amount">
|
||||
<field name="po_order_approval"/>
|
||||
<div class="content-group" invisible="not po_order_approval">
|
||||
<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 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"/>
|
||||
</setting>
|
||||
<setting id="automatic_lock_confirmed_orders" help="Automatically lock confirmed orders to prevent editing">
|
||||
<field name="lock_confirmed_po"/>
|
||||
</setting>
|
||||
<setting id="get_order_warnings" string="Warnings" help="Get warnings in orders for products or vendors">
|
||||
<field name="group_warning_purchase"/>
|
||||
</setting>
|
||||
<setting id="manage_purchase_agreements" title="A blanket purchase order is a purchase agreement between a buyer and a supplier to deliver goods or services to the buyer at a preset price for a period of time." documentation="/applications/inventory_and_mrp/purchase/manage_deals/agreements.html" help="Manage blanket orders and purchase templates">
|
||||
<field name="module_purchase_requisition"/>
|
||||
<div class="content-group" invisible="not module_purchase_requisition">
|
||||
<div id="use_purchase_requisition"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="lock_confirmed_po"/>
|
||||
<div class="text-muted">
|
||||
Automatically lock confirmed orders to prevent editing
|
||||
</setting>
|
||||
<setting id="auto_receipt_reminder" help="Automatically remind the receipt date to your vendors">
|
||||
<field name="group_send_reminder"/>
|
||||
</setting>
|
||||
</block>
|
||||
<block title="Invoicing" name="invoicing_settings_container">
|
||||
<setting 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." documentation="/applications/inventory_and_mrp/purchase/manage_deals/control_bills.html" help="Make sure you only pay bills for which you received the goods you ordered">
|
||||
<field name="module_account_3way_match" string="3-way matching" widget="upgrade_boolean"/>
|
||||
</setting>
|
||||
</block>
|
||||
<block title="Products" name="matrix_setting_container">
|
||||
<setting id="variant_options" help="Purchase variants of a product using attributes (size, color, etc.)" documentation="/applications/sales/sales/products_prices/products/variants.html">
|
||||
<field name="group_product_variant"/>
|
||||
<div class="content-group" invisible="not group_product_variant">
|
||||
<div class="mt8">
|
||||
<button name="%(product.attribute_action)d" icon="oi-arrow-right" type="action" string="Attributes" class="btn-link"/>
|
||||
</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
|
||||
</setting>
|
||||
<setting id="product_matrix" title="If installed, the product variants will be added to purchase orders through a grid entry." string="Variant Grid Entry" help="Add several variants to the purchase order from a grid">
|
||||
<field name="module_purchase_product_matrix"/>
|
||||
</setting>
|
||||
<setting id="sell_purchase_uom" help="Sell and purchase products in different units of measure or packagings"
|
||||
documentation="/applications/inventory_and_mrp/inventory/management/products/uom.html">
|
||||
<field name="group_uom"/>
|
||||
<div class="content-group">
|
||||
<div class="mt8" invisible="not group_uom">
|
||||
<button name="%(uom.product_uom_form_action)d" icon="oi-arrow-right"
|
||||
type="action" string="Units & Packagings" class="btn-link"/>
|
||||
</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>
|
||||
</setting>
|
||||
</block>
|
||||
</app>
|
||||
</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>
|
||||
|
||||
|
|
|
|||
|
|
@ -9,28 +9,35 @@
|
|||
<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 class="o_cell o_wrap_label text-break text-900">
|
||||
<label for="receipt_reminder_email"/>
|
||||
</div>
|
||||
<div class="o_cell o_wrap_input text-break d-flex gap-2">
|
||||
<field name="receipt_reminder_email"/>
|
||||
<div invisible="not receipt_reminder_email">
|
||||
<field name="reminder_date_before_receipt" class="oe_inline"/>
|
||||
<span> day(s) before</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<field name="property_purchase_currency_id" options="{'no_create': True, 'no_open': True}" groups='base.group_multi_currency'/>
|
||||
</group>
|
||||
<field name="property_supplier_payment_term_id" position="before">
|
||||
<field name="buyer_id" domain="[('share', '=', False)]" widget="many2one_avatar_user"/>
|
||||
</field>
|
||||
</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_mode">list,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': 'list', '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="group_ids" 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
|
||||
|
|
@ -42,32 +49,10 @@
|
|||
</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="view_mode">list,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">
|
||||
|
|
@ -95,27 +80,14 @@
|
|||
<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 name="warnings" position="inside">
|
||||
<group groups="purchase.group_warning_purchase" col="2">
|
||||
<separator string="Warning on Purchase Orders and Bills" colspan="2"/>
|
||||
<field name="purchase_warn_msg"
|
||||
placeholder="e.g. This vendor is on vacation until the end of August."
|
||||
nolabel="1" colspan="2"/>
|
||||
</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>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue