Initial commit: Sale packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:49 +02:00
commit 14e3d26998
6469 changed files with 2479670 additions and 0 deletions

View file

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="account_invoice_groupby_inherit" model="ir.ui.view">
<field name="name">account.move.groupby</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<field name="invoice_user_id" position="after">
<field name="team_id"/>
</field>
<xpath expr="//group/filter[@name='status']" position="after">
<filter string="Sales Team" name="sales_channel" domain="[]" context="{'group_by':'team_id'}"/>
</xpath>
</field>
</record>
<record id="account_invoice_view_tree" model="ir.ui.view">
<field name="name">account.move.tree.inherit.sale</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_invoice_tree"/>
<field name="arch" type="xml">
<field name="invoice_user_id" position="after">
<field name="team_id" invisible="context.get('default_move_type') not in ('out_invoice', 'out_refund','out_receipt')" optional="hide"/>
</field>
</field>
</record>
<record model="ir.ui.view" id="account_invoice_form">
<field name="name">Account Invoice</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//group[@name='sale_info_group']/field[@name='invoice_user_id']" position="after">
<field name="team_id" kanban_view_ref="%(sales_team.crm_team_view_kanban)s"/>
</xpath>
<xpath expr="//group[@id='other_tab_group']" position="inside">
<group string="Marketing"
name="utm_link"
groups="base.group_no_one"
attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}">
<field name="campaign_id" options="{'create_name_field': 'title', 'always_reload': True}"/>
<field name="medium_id"/>
<field name="source_id"/>
</group>
</xpath>
<xpath expr="//div[@name='button_box']" position="inside">
<button class="oe_stat_button"
name="action_view_source_sale_orders"
type="object"
icon="fa-pencil-square-o"
attrs="{'invisible': ['|', ('sale_order_count', '=', 0), ('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}">
<field string="Sale Orders" name="sale_order_count" widget="statinfo"/>
</button>
</xpath>
</field>
</record>
<record id="action_invoice_salesteams" model="ir.actions.act_window">
<field name="name">Invoices</field>
<field name="res_model">account.move</field>
<field name="view_mode">tree,form,kanban</field>
<field name="view_id" ref="account.view_move_tree"/>
<field name="domain">[
('state', '=', 'posted'),
('move_type', 'in', ['out_invoice', 'out_refund'])]</field>
<field name="context">{
'search_default_team_id': [active_id],
'default_team_id': active_id,
'default_move_type':'out_invoice',
'move_type':'out_invoice',
'journal_type': 'sale',
}
</field>
<field name="search_view_id" ref="account.view_account_invoice_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a customer invoice
</p><p>
Create invoices, register payments and keep track of the discussions with your customers.
</p>
</field>
</record>
<record id="action_invoice_salesteams_view_tree" model="ir.actions.act_window.view">
<field name="sequence">1</field>
<field name="view_mode">tree</field>
<field name="act_window_id" ref="sale.action_invoice_salesteams"/>
</record>
<record id="action_invoice_salesteams_view_form" model="ir.actions.act_window.view">
<field name="sequence">2</field>
<field name="view_mode">form</field>
<field name="view_id" ref="account.view_move_form"/>
<field name="act_window_id" ref="sale.action_invoice_salesteams"/>
</record>
</odoo>

View file

@ -0,0 +1,186 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Dedicated actions used in views below -->
<record id="action_quotations_salesteams" model="ir.actions.act_window">
<field name="name">Quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_id" ref="sale.view_quotation_tree"/>
<field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
<field name="context">{
'search_default_team_id': [active_id],
'default_team_id': active_id,
'show_address': 1,
}
</field>
<field name="domain">[]</field>
<field name="search_view_id" ref="sale.sale_order_view_search_inherit_quotation"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="action_quotation_form" model="ir.actions.act_window">
<field name="name">New Quotation</field>
<field name="res_model">sale.order</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">form</field>
<field name="context">{
'search_default_team_id': [active_id],
'default_team_id': active_id,
'default_user_id': uid,
}
</field>
<field name="search_view_id" ref="sale_order_view_search_inherit_quotation"/>
</record>
<record id="action_orders_salesteams" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
<field name="search_view_id" ref="sale.sale_order_view_search_inherit_sale"/>
<field name="domain">[('state','not in',('draft','sent','cancel'))]</field>
<field name="context">{
'search_default_team_id': [active_id],
'default_team_id': active_id,
}
</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="action_orders_to_invoice_salesteams" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form,calendar,graph,kanban,pivot</field>
<field name="search_view_id" ref="sale.sale_order_view_search_inherit_sale"/>
<field name="domain">[('invoice_status','=','to invoice')]</field>
<field name="context">{
'search_default_team_id': [active_id],
'default_team_id': active_id,
}
</field>
</record>
<!-- crm.team views (& actions) -->
<record id="crm_team_salesteams_view_form" model="ir.ui.view">
<field name="name">crm.team.form</field>
<field name="model">crm.team</field>
<field name="priority">9</field>
<field name="inherit_id" ref="sales_team.crm_team_view_form"/>
<field name="arch" type="xml">
<div name="options_active" position="inside">
<div class="o_row" style="display:inherit">
<field name="use_quotations"/><label for="use_quotations"/>
</div>
</div>
<field name="company_id" position="after">
<label for="invoiced_target"/>
<div class="o_row">
<field name="invoiced_target" widget="monetary" options="{'currency_field': 'currency_id'}" class="oe_inline"/>
<span class="flex-grow-1">/ Month</span>
</div>
</field>
</field>
</record>
<record id="crm_team_view_kanban_dashboard" model="ir.ui.view">
<field name="name">crm.team.view.kanban.dashboard.inherit.sale</field>
<field name="model">crm.team</field>
<field name="inherit_id" ref="sales_team.crm_team_view_kanban_dashboard"/>
<field name="arch" type="xml">
<xpath expr="//templates" position="before">
<field name="use_quotations"/>
<field name="invoiced_target"/>
</xpath>
<xpath expr="//t[@name='second_options']" position="after">
<div class="row" t-if="record.quotations_count.raw_value">
<div class="col">
<a name="%(action_quotations_salesteams)d" type="action" context="{'search_default_draft': True, 'search_default_sent': True}">
<field name="quotations_count" class="me-1"/>
<t t-if="record.quotations_count.raw_value == 1">Quotation</t>
<t t-else="">Quotations</t>
</a>
</div>
<div class="col-auto text-truncate">
<field name="quotations_amount" widget="monetary"/>
</div>
</div>
<div class="row" name="orders_to_invoice" t-if="record.sales_to_invoice_count.raw_value">
<div class="col-8">
<a name="%(action_orders_to_invoice_salesteams)d" type="action">
<field name="sales_to_invoice_count" class="me-1"/>
<t t-if="record.sales_to_invoice_count.raw_value == 1">Order to Invoice</t>
<t t-else="">Orders to Invoice</t>
</a>
</div>
</div>
</xpath>
<xpath expr="//div[hasclass('o_kanban_primary_bottom')]" position="after">
<t groups="sales_team.group_sale_manager">
<div class="col-12 o_kanban_primary_bottom bottom_block">
<field name="invoiced" widget="sales_team_progressbar" title="Invoicing" options="{'current_value': 'invoiced', 'max_value': 'invoiced_target', 'editable': true, 'edit_max_value': true, 'on_change': 'update_invoiced_target'}"/>
</div>
</t>
</xpath>
<xpath expr="//div[hasclass('o_kanban_manage_view')]" position="inside">
<div t-if="record.use_quotations.raw_value">
<a name="%(action_quotations_salesteams)d" type="action" class="o_quotation_view_button">Quotations</a>
</div>
<div>
<a name="%(action_orders_salesteams)d" type="action">Sales Orders</a>
</div>
<div groups="account.group_account_invoice">
<a name="%(action_invoice_salesteams)d" type="action">Invoices</a>
</div>
</xpath>
<xpath expr="//div[hasclass('o_kanban_manage_new')]" position="inside">
<div t-if="record.use_quotations.raw_value">
<a name="%(action_quotation_form)d" type="action">
Quotation
</a>
</div>
</xpath>
<div name="o_team_kanban_report_separator" position="before">
<div t-if="record.use_quotations.raw_value">
<a name="%(action_order_report_quotation_salesteam)d" type="action">
Quotations
</a>
</div>
<div name="sales_report">
<a name="%(action_order_report_so_salesteam)d" type="action">
Sales
</a>
</div>
<div groups="account.group_account_invoice" name="invoices_report">
<a name="%(action_account_invoice_report_salesteam)d" type="action">
Invoices
</a>
</div>
</div>
</field>
</record>
<record id="sales_team.mail_activity_type_action_config_sales" model="ir.actions.act_window">
<field name="domain">['|', ('res_model', '=', False), ('res_model', 'in', ['sale.order', 'res.partner', 'product.template', 'product.product'])]</field>
</record>
</odoo>

View file

@ -0,0 +1,12 @@
<?xml version="1.0"?>
<odoo>
<record id="mail_activity_type_action_config_sale" model="ir.actions.act_window">
<field name="name">Activity Types</field>
<field name="res_model">mail.activity.type</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|', ('res_model', '=', False), ('res_model', '=', 'sale.order')]</field>
<field name="context">{'default_res_model': 'sale.order'}</field>
</record>
</odoo>

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Include sale-related values in payment checkout form to pass them to the client -->
<template id="payment_checkout_inherit" inherit_id="payment.checkout">
<xpath expr="//form[@name='o_payment_checkout']" position="attributes">
<attribute name="t-att-data-sale-order-id">sale_order_id</attribute>
</xpath>
</template>
<!-- Include sale-related values in payment manage form to pass them to the client -->
<template id="payment_manage_inherit" inherit_id="payment.manage">
<xpath expr="//form[@name='o_payment_manage']" position="attributes">
<attribute name="t-att-data-sale-order-id">sale_order_id</attribute>
</xpath>
</template>
</odoo>

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="payment_provider_form" model="ir.ui.view">
<field name="name">payment.provider.form.inherit.sale</field>
<field name="model">payment.provider</field>
<field name="inherit_id" ref="payment.payment_provider_form"/>
<field name="arch" type="xml">
<group name="payment_form" position="inside">
<field name="so_reference_type" attrs="{'invisible': [('code', '!=', 'custom')]}"/>
</group>
</field>
</record>
<record id="transaction_form_inherit_sale" model="ir.ui.view">
<field name="name">payment.transaction.form.inherit.sale.payment</field>
<field name="model">payment.transaction</field>
<field name="inherit_id" ref="payment.payment_transaction_form"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
<button name="action_view_sales_orders" type="object"
class="oe_stat_button" icon="fa-money"
attrs="{'invisible': [('sale_order_ids_nbr', '=', 0)]}">
<field name="sale_order_ids_nbr" widget="statinfo" string="Sales Order(s)"/>
</button>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="product_packaging_form_view_sale" model="ir.ui.view">
<field name="name">product.packaging.form.view.sale</field>
<field name="model">product.packaging</field>
<field name="inherit_id" ref="product.product_packaging_form_view"/>
<field name="arch" type="xml">
<group name="group_product" position="inside">
<field name="sales"/>
</group>
</field>
</record>
<record id="product_packaging_tree_view_sale" model="ir.ui.view">
<field name="name">product.packaging.tree.view.sale</field>
<field name="model">product.packaging</field>
<field name="inherit_id" ref="product.product_packaging_tree_view"/>
<field name="arch" type="xml">
<field name="product_uom_id" position="after">
<field name="sales" optional="show"/>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="product_template_form_view" model="ir.ui.view">
<field name="name">product.template.form.view.inherit.sale</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<page name="sales" position="attributes">
<attribute name="invisible">0</attribute>
</page>
<field name="product_variant_count" position="after">
<field name="service_type" widget="radio" invisible="True"/>
<field name="visible_expense_policy" invisible="1"/>
</field>
<field name="detailed_type" position="after">
<field name="invoice_policy" required="1"/>
<field name="expense_policy" widget="radio" attrs="{'invisible': [('visible_expense_policy', '=', False)]}"/>
</field>
<field name="product_tooltip" position="after">
<label for="product_tooltip" string=""
attrs="{'invisible': ['|', ('type', 'not in', ('product', 'consu')), ('invoice_policy', '!=', 'order')]}"/>
<div attrs="{'invisible': ['|', ('type', 'not in', ('product', 'consu')), ('invoice_policy', '!=', 'order')]}"
class="fst-italic text-muted">
You can invoice them before they are delivered.
</div>
<label for="product_tooltip" string=""
attrs="{'invisible': ['|', ('type', 'not in', ('product', 'consu')), ('invoice_policy', '!=', 'delivery')]}"/>
<div attrs="{'invisible': ['|', ('type', 'not in', ('product', 'consu')), ('invoice_policy', '!=', 'delivery')]}"
class="fst-italic text-muted">
Invoice after delivery, based on quantities delivered, not ordered.
</div>
</field>
</field>
</record>
<!-- TODO VFE inherit product_template_form_view and factorize both views -->
<record id="product_form_view_sale_order_button" model="ir.ui.view">
<field name="name">product.product.sale.order</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button"
name="action_view_sales"
type="object"
icon="fa-signal"
help="Sold in the last 365 days"
groups="sales_team.group_sale_salesman"
attrs="{'invisible': [('sale_ok', '=', False)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="sales_count" widget="statinfo" nolabel="1" class="mr4"/>
<field name="uom_name"/>
</span>
<span class="o_stat_text">Sold</span>
</div>
</button>
</div>
<group name="description" position="after">
<t groups="sales_team.group_sale_salesman">
<group string="Warning when Selling this Product" groups="sale.group_warning_sale">
<field name="sale_line_warn" nolabel="1" colspan="2"/>
<field name="sale_line_warn_msg" colspan="2" nolabel="1" placeholder="Type a message..."
attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')]}"/>
</group>
</t>
</group>
</field>
</record>
<record id="product_template_form_view_sale_order_button" model="ir.ui.view">
<field name="name">product.template.sale.order.button</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button"
name="action_view_sales"
type="object" icon="fa-signal"
help="Sold in the last 365 days"
groups="sales_team.group_sale_salesman"
attrs="{'invisible': [('sale_ok', '=', False)]}">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="sales_count" widget="statinfo" nolabel="1" class="mr4"/>
<field name="uom_name"/>
</span>
<span class="o_stat_text">Sold</span>
</div>
</button>
</div>
<group name="description" position="after">
<t groups="sales_team.group_sale_salesman">
<group string="Warning when Selling this Product" groups="sale.group_warning_sale">
<field name="sale_line_warn" string="Warning"/>
<field name="sale_line_warn_msg" string="Message" placeholder="Type a message..."
attrs="{'required':[('sale_line_warn','!=','no-message')],'readonly':[('sale_line_warn','=','no-message')], 'invisible':[('sale_line_warn','=','no-message')]}"/>
</group>
</t>
</group>
</field>
</record>
<record id="product_template_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.template</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="view_id" ref="product.product_template_kanban_view"/>
<field name="search_view_id" ref="product.product_template_search_view"/>
<field name="context">{"search_default_filter_to_sell":1, "sale_multi_pricelist_product_template": 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product
</p><p>
You must define a product for everything you sell or purchase,
whether it's a storable product, a consumable or a service.
</p>
</field>
</record>
</odoo>

View file

@ -0,0 +1,444 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.sale</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="10"/>
<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 o_not_app"
string="Sales"
data-string="Sales"
data-key="sale_management"
groups="sales_team.group_sale_manager">
<h2>Product Catalog</h2>
<div class="row mt16 o_settings_container" name="catalog_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">
Sell 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">
<div class="o_setting_left_pane">
<field name="module_sale_product_matrix"/>
</div>
<div class="o_setting_right_pane">
<label for="module_sale_product_matrix" string="Variant Grid Entry"/>
<div class="text-muted">
Add several variants to an order from a grid
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="uom_settings">
<div class="o_setting_left_pane">
<field name="group_uom"/>
</div>
<div class="o_setting_right_pane">
<label for="group_uom"/>
<div class="text-muted">
Sell and purchase products in different units of measure
</div>
<div class="content-group" attrs="{'invisible': [('group_uom','=',False)]}">
<div class="mt8">
<button name="%(uom.product_uom_categ_form_action)d" icon="fa-arrow-right" type="action" string="Units of Measure" class="btn-link"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box"
id="email_template"
title="Sending an email is useful if you need to share specific information or content about a product (instructions, rules, links, media, etc.). Create and set the email template from the product detail form (in Sales tab).">
<div class="o_setting_left_pane">
<field name="module_product_email_template"/>
</div>
<div class="o_setting_right_pane">
<label for="module_product_email_template" string="Deliver Content by Email"/>
<div class="text-muted">
Send a product-specific email once the invoice is validated
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box"
id="stock_packaging"
title="Ability to select a package type in sales 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">
Sell products by multiple of unit # per package
</div>
</div>
</div>
</div>
<h2>Pricing</h2>
<div class="row mt16 o_settings_container" id="pricing_setting_container">
<div class="col-12 col-lg-6 o_setting_box"
id="discount_sale_order_lines"
title="Apply manual discounts on sales order lines or display discounts computed from pricelists (option to activate in the pricelist configuration).">
<div class="o_setting_left_pane">
<field name="group_discount_per_so_line"/>
</div>
<div class="o_setting_right_pane">
<label for="group_discount_per_so_line"/>
<div class="text-muted">
Grant discounts on sales order lines
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box"
id="coupon_settings"
title="Boost your sales with multiple kinds of programs: Coupons, Promotions, Gift Card, Loyalty. Specific conditions can be set (products, customers, minimum purchase amount, period). Rewards can be discounts (% or amount) or free products.">
<div class="o_setting_left_pane">
<field name="module_loyalty"/>
</div>
<div class="o_setting_right_pane">
<label for="module_loyalty" string="Discounts, Loyalty &amp; Gift Card"/>
<div class="text-muted" id="sale_coupon">
Manage Promotions, coupons, loyalty cards, Gift cards &amp; eWallet
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="pricelist_configuration">
<div class="o_setting_left_pane">
<field name="group_product_pricelist"/>
</div>
<div class="o_setting_right_pane">
<label for="group_product_pricelist"/>
<a href="https://www.odoo.com/documentation/16.0/applications/sales/sales/products_prices/prices/pricing.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Set multiple prices per product, automated discounts, etc.
</div>
<div class="content-group" attrs="{'invisible': [('group_product_pricelist' ,'=', False)]}">
<div class="mt16">
<field name="group_sale_pricelist" invisible="1"/>
<field name="product_pricelist_setting" widget="radio" class="o_light_label"/>
</div>
<div class="mt8">
<button name="%(product.product_pricelist_action2)d" icon="fa-arrow-right" type="action" string="Pricelists" groups="product.group_product_pricelist" class="btn-link"/>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box"
id="auth_signup_documents"
title=" To send invitations in B2B mode, open a contact or select several ones in list view and click on 'Portal Access Management' option in the dropdown menu *Action*.">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<label for="auth_signup_uninvited"/>
<div class="text-muted">
Let your customers log in to see their documents
</div>
<div class="mt8">
<field name="auth_signup_uninvited" class="o_light_label" widget="radio" options="{'horizontal': true}" required="True"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box"
id="show_margins"
title="The margin is computed as the sum of product sales prices minus the cost set in their detail form.">
<div class="o_setting_left_pane">
<field name="module_sale_margin"/>
</div>
<div class="o_setting_right_pane">
<label for="module_sale_margin"/>
<div class="text-muted">
Show margins on orders
</div>
</div>
</div>
</div>
<h2>Quotations &amp; Orders</h2>
<div class="row mt16 o_settings_container" name="quotation_order_setting_container">
<div class="col-12 col-lg-6 o_setting_box" id="sale_config_online_confirmation_sign">
<div class="o_setting_left_pane">
<field name="portal_confirmation_sign"/>
</div>
<div class="o_setting_right_pane">
<label for="portal_confirmation_sign"/>
<a href="https://www.odoo.com/documentation/16.0/applications/sales/sales/send_quotations/get_signature_to_validate.html" title="Documentation" class="me-2 o_doc_link" target="_blank"></a>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
<div class="text-muted">
Request an online signature to confirm orders
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="sale_config_online_confirmation_pay">
<div class="o_setting_left_pane">
<field name="portal_confirmation_pay"/>
</div>
<div class="o_setting_right_pane">
<label for="portal_confirmation_pay"/>
<a href="https://www.odoo.com/documentation/16.0/applications/sales/sales/send_quotations/get_paid_to_validate.html" title="Documentation" class="me-2 o_doc_link" target="_blank"></a>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." groups="base.group_multi_company"/>
<div class="text-muted">
Request an online payment to confirm orders
</div>
<div class="mt8" attrs="{'invisible': [('portal_confirmation_pay', '=', False)]}">
<button name='%(payment.action_payment_provider)d' icon="fa-arrow-right" type="action" string="Payment Providers" class="btn-link"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="quotation_validity_days">
<div class="o_setting_left_pane">
<field name="use_quotation_validity_days"/>
</div>
<div class="o_setting_right_pane">
<label for="use_quotation_validity_days"/>
<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">
Set a default validity on your quotations
</div>
<div class="content-group" attrs="{'invisible': [('use_quotation_validity_days','=',False)]}">
<div class="mt16">
<span class="col-lg-3">Default Limit: <field name="quotation_validity_days" attrs="{'required': [('use_quotation_validity_days', '=', True)]}"/> days</span>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="order_warnings">
<div class="o_setting_left_pane">
<field name="group_warning_sale"/>
</div>
<div class="o_setting_right_pane">
<label for="group_warning_sale" string="Sale Warnings"/>
<div class="text-muted">
Get warnings in orders for products or customers
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="no_edit_order">
<div class="o_setting_left_pane">
<field name="group_auto_done_setting"/>
</div>
<div class="o_setting_right_pane">
<label for="group_auto_done_setting"/>
<div class="text-muted">
No longer edit orders once confirmed
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="proforma_configuration">
<div class="o_setting_left_pane">
<field name="group_proforma_sales"/>
</div>
<div class="o_setting_right_pane">
<label for="group_proforma_sales"/>
<div class="text-muted">
Allows you to send Pro-Forma Invoice to your customers
</div>
</div>
</div>
</div>
<h2 class="mt32">Shipping</h2>
<div class="row mt16 o_settings_container" name="shipping_setting_container">
<div class="col-12 col-lg-6 o_setting_box" id="delivery">
<div class="o_setting_left_pane">
<field name="module_delivery"/>
</div>
<div class="o_setting_right_pane">
<label for="module_delivery"/>
<div class="text-muted" id="delivery_carrier">
Compute shipping costs on orders
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="ups">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<div class="o_form_label">UPS Connector</div>
<div class="text-muted">
Compute shipping costs and ship with UPS<br/>
<strong>(please go to Home>Apps to install)</strong>
</div>
<div class="content-group">
<div id="sale_delivery_ups"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_dhl">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<div class="o_form_label">DHL Connector</div>
<div class="text-muted">
Compute shipping costs and ship with DHL<br/>
<strong>(please go to Home>Apps to install)</strong>
</div>
<div class="content-group">
<div id="sale_delivery_dhl"></div>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_fedex">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<div class="o_form_label">FedEx Connector</div>
<div class="text-muted">
Compute shipping costs and ship with FedEx<br/>
<strong>(please go to Home>Apps to install)</strong>
</div>
<div class="content-group">
<div id="sale_delivery_fedex"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_usps">
<div class="o_setting_left_pane">
</div>
<div class="o_setting_right_pane">
<div class="o_form_label">USPS Connector</div>
<div class="text-muted">
Compute shipping costs and ship with USPS<br/>
<strong>(please go to Home>Apps to install)</strong>
</div>
<div class="content-group">
<div id="sale_delivery_usps"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_bpost">
<div class="o_setting_left_pane">
<field name="module_delivery_bpost" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_delivery_bpost"/>
<div class="text-muted">
Compute shipping costs and ship with bpost
</div>
<div class="content-group">
<div id="sale_delivery_bpost"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_easypost">
<div class="o_setting_left_pane">
<field name="module_delivery_easypost" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_delivery_easypost"/>
<div class="text-muted">
Compute shipping costs and ship with Easypost
</div>
<div class="content-group">
<div id="sale_delivery_easypost"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="shipping_costs_sendcloud">
<div class="o_setting_left_pane">
<field name="module_delivery_sendcloud" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_delivery_sendcloud"/>
<div class="text-muted">
Compute shipping costs and ship with Sendcloud
</div>
<div class="content-group">
<div id="sale_delivery_sendcloud"/>
</div>
</div>
</div>
</div>
<h2>Invoicing</h2>
<div class="row mt16 o_settings_container" name="invoicing_setting_container">
<div id="sales_settings_invoicing_policy"
class="col-12 col-lg-6 o_setting_box"
title="This default value is applied to any new product created. This can be changed in the product detail form.">
<div class="o_setting_right_pane">
<label for="default_invoice_policy"/>
<a href="https://www.odoo.com/documentation/16.0/applications/sales/sales/invoicing/invoicing_policy.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Quantities to invoice from sales orders
</div>
<div class="content-group">
<div class="mt16">
<field name="default_invoice_policy" class="o_light_label" widget="radio"/>
</div>
</div>
</div>
</div>
<div class="col-xs-12 col-md-6 o_setting_box"
id="automatic_invoicing"
attrs="{'invisible': ['|', ('default_invoice_policy', '!=', 'order'), ('portal_confirmation_pay', '=', False)]}">
<div class="o_setting_left_pane">
<field name="automatic_invoice"/>
</div>
<div class="o_setting_right_pane">
<label for="automatic_invoice"/>
<div class="text-muted">
Generate the invoice automatically when the online payment is confirmed
</div>
<div attrs="{'invisible': [('automatic_invoice','=',False)]}" groups="base.group_no_one">
<label for="invoice_mail_template_id" class="o_light_label me-2"/>
<field name="invoice_mail_template_id" class="oe_inline" options="{'no_create': True}"/>
</div>
</div>
</div>
<div class="col-12 col-lg-6 o_setting_box" id="down_payments">
<div class="o_setting_left_pane"/>
<div class="o_setting_right_pane">
<span class="o_form_label">Down Payments</span>
<a href="https://www.odoo.com/documentation/16.0/applications/sales/sales/invoicing/down_payment.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Product used for down payments
</div>
<div class="text-muted">
<field name="deposit_default_product_id" context="{'default_detailed_type': 'service'}"/>
</div>
</div>
</div>
</div>
<h2 class="mt32">Connectors</h2>
<div class="row mt16 o_settings_container" id="connectors_setting_container">
<div class="col-12 col-lg-6 o_setting_box" id="amazon_connector">
<div class="o_setting_left_pane">
<field name="module_sale_amazon" widget="upgrade_boolean"/>
</div>
<div class="o_setting_right_pane">
<label for="module_sale_amazon"/>
<a href="https://www.odoo.com/documentation/16.0/applications/sales/sales/amazon_connector/setup.html" title="Documentation" class="o_doc_link" target="_blank"></a>
<div class="text-muted">
Import Amazon orders and sync deliveries
</div>
<div class="content-group"
name="amazon_connector"
attrs="{'invisible': [('module_sale_amazon', '=', False)]}"/>
</div>
</div>
</div>
<div id="sale_ebay"/>
</div>
</xpath>
</field>
</record>
<record id="action_sale_config_settings" 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_id" ref="res_config_settings_view_form"/>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'sale_management', 'bin_size': False}</field>
</record>
</odoo>

View file

@ -0,0 +1,95 @@
<?xml version="1.0"?>
<odoo>
<record id="act_res_partner_2_sale_order" model="ir.actions.act_window">
<field name="name">Quotations and Sales</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,kanban,form,graph</field>
<field name="context">{'default_partner_id': active_id}</field>
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="crm_lead_partner_kanban_view" model="ir.ui.view">
<field name="name">res.partner.kanban.saleorder.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
<field name="priority" eval="20"/>
<field name="arch" type="xml">
<field name="mobile" position="after">
<field name="sale_order_count" groups="sales_team.group_sale_salesman"/>
</field>
<xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
<a t-if="record.sale_order_count.value>0" data-type="object" data-name="action_view_sale_order"
groups="sales_team.group_sale_salesman"
href="#" class="oe_kanban_action oe_kanban_action_a me-1">
<span class="badge rounded-pill">
<i class="fa fa-fw fa-usd" role="img" aria-label="Sale orders" title="Sales orders"/>
<t t-out="record.sale_order_count.value"/>
</span>
</a>
</xpath>
</field>
</record>
<record id="res_partner_view_buttons" model="ir.ui.view">
<field name="name">res.partner.view.buttons</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="priority" eval="3"/>
<field name="arch" type="xml">
<div name="button_box" position="inside">
<button class="oe_stat_button" type="object" name="action_view_sale_order"
groups="sales_team.group_sale_salesman"
icon="fa-usd">
<field string="Sales" name="sale_order_count" widget="statinfo"/>
</button>
</div>
<xpath expr="//page[@name='internal_notes']//field[@name='comment']" position="after">
<group groups="sales_team.group_sale_salesman">
<group groups="sale.group_warning_sale" col="2">
<separator string="Warning on the Sales Order" colspan="2"/>
<field name="sale_warn" nolabel="1" colspan="2" required="1"/>
<field name="sale_warn_msg" nolabel="1" string="Message" placeholder="Type a message..." colspan="2"
attrs="{'required':[('sale_warn','!=', False), ('sale_warn','!=','no-message')], 'invisible':[('sale_warn','in',(False,'no-message'))]}"/>
</group>
</group>
</xpath>
</field>
</record>
<record id="res_partner_view_form_payment_defaultcreditcard" model="ir.ui.view">
<field name="name">res.partner.view.form.payment.defaultcreditcard</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="payment.view_partners_form_payment_defaultcreditcard"/>
<field name="arch" type="xml">
<button name="%(payment.action_payment_token)d" position="attributes">
<attribute name="groups">sales_team.group_sale_salesman</attribute>
</button>
</field>
</record>
<record id="res_partner_view_form_property_inherit" model="ir.ui.view">
<field name="name">res.partner.view.form.property.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form"/>
<field name="arch" type="xml">
<group name="fiscal_information" position="attributes">
<attribute name="groups">account.group_account_invoice, sales_team.group_sale_salesman</attribute>
</group>
<field name="property_payment_term_id" position="attributes">
<attribute name="groups">account.group_account_invoice, sales_team.group_sale_salesman</attribute>
</field>
<field name="property_supplier_payment_term_id" position="attributes">
<attribute name="groups">account.group_account_invoice, sales_team.group_sale_salesman</attribute>
</field>
</field>
</record>
</odoo>

View file

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<menuitem id="sale_menu_root"
name="Sales"
web_icon="sale_management,static/description/icon.svg"
active="False"
sequence="30">
<menuitem id="sale_order_menu"
name="Orders"
sequence="10">
<menuitem id="menu_sale_quotations"
action="action_quotations_with_onboarding"
groups="sales_team.group_sale_salesman"
sequence="10"/>
<menuitem id="menu_sale_order"
name="Orders"
action="action_orders"
groups="sales_team.group_sale_salesman"
sequence="20"/>
<menuitem id="report_sales_team"
name="Sales Teams"
action="sales_team.crm_team_action_sales"
groups="sales_team.group_sale_manager"
sequence="30"/>
<menuitem id="res_partner_menu"
action="account.res_partner_action_customer"
groups="sales_team.group_sale_salesman"
sequence="40"/>
</menuitem>
<menuitem id="menu_sale_invoicing"
name="To Invoice"
groups="sales_team.group_sale_salesman"
sequence="20">
<menuitem id="menu_sale_order_invoice"
action="action_orders_to_invoice"
sequence="10"/>
<menuitem id="menu_sale_order_upselling"
action="action_orders_upselling"
sequence="20"/>
</menuitem>
<menuitem id="product_menu_catalog"
name="Products"
groups="sales_team.group_sale_salesman"
sequence="30">
<menuitem id="menu_product_template_action"
action="product_template_action"
sequence="10"/>
<menuitem id="menu_products"
action="product.product_normal_action_sell"
groups="product.group_product_variant"
sequence="20"/>
<menuitem id="menu_product_pricelist_main"
name="Pricelists"
action="product.product_pricelist_action2"
groups="product.group_product_pricelist"
sequence="30"/>
</menuitem>
<menuitem id="menu_sale_report"
name="Reporting"
action="action_order_report_all"
groups="sales_team.group_sale_manager"
sequence="40"/>
<menuitem id="menu_sale_config"
name="Configuration"
groups="sales_team.group_sale_manager"
sequence="50">
<menuitem id="menu_sale_general_settings"
name="Settings"
sequence="10"
action="action_sale_config_settings"
groups="base.group_system"/>
<menuitem id="sales_team_config"
name="Sales Teams"
action="sales_team.crm_team_action_config"
sequence="20"/>
<menuitem id="menu_sales_config"
sequence="30"
name="Sales Orders">
<menuitem id="menu_tag_config"
name="Tags"
action="sales_team.sales_team_crm_tag_action"
sequence="10"/>
</menuitem>
<menuitem id="prod_config_main"
name="Products"
sequence="40">
<menuitem id="menu_product_attribute_action"
action="product.attribute_action"
groups="product.group_product_variant"
sequence="10"/>
</menuitem>
<menuitem id="next_id_16"
name="Units of Measure"
groups="uom.group_uom"
sequence="50">
<menuitem id="menu_product_uom_form_action"
action="uom.product_uom_form_action"
groups="base.group_no_one"
sequence="10"/>
<menuitem id="menu_product_uom_categ_form_action"
action="uom.product_uom_categ_form_action"
sequence="20"/>
</menuitem>
<menuitem id="sale_menu_config_activity_type"
action="mail_activity_type_action_config_sale"
groups="base.group_no_one"
sequence="60"
/>
</menuitem>
</menuitem>
</odoo>

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ONBOARDING STEPS -->
<template id="onboarding_quotation_layout_step">
<t t-call="base.onboarding_step">
<t t-set="title">Quotation Layout</t>
<t t-set="description">Customize the look of your quotations.</t>
<t t-set="done_icon" t-value="'fa-star'" />
<t t-set="done_text">Looks great!</t>
<t t-set="btn_text">Customize</t>
<t t-set="model" t-value="'base.document.layout'" />
<t t-set="method" t-value="'action_open_base_document_layout'" />
<t t-set="state" t-value="state.get('account_onboarding_invoice_layout_state')" />
</t>
</template>
<template id="sale_onboarding_order_confirmation_step">
<t t-call="base.onboarding_step">
<t t-set="title">Order Confirmation</t>
<t t-set="description">Choose between electronic signatures or online payments.</t>
<t t-set="btn_text">Set payments</t>
<t t-set="method" t-value="'action_open_sale_onboarding_payment_provider'" />
<t t-set="model" t-value="'res.company'" />
<t t-set="state" t-value="state.get('sale_onboarding_order_confirmation_state')" />
</t>
</template>
<template id="sale_onboarding_sample_quotation_step">
<t t-call="base.onboarding_step">
<t t-set="title">Sample Quotation</t>
<t t-set="description">Send a quotation to test the customer portal.</t>
<t t-set="btn_text">Send sample</t>
<t t-set="method" t-value="'action_open_sale_onboarding_sample_quotation'" />
<t t-set="model" t-value="'res.company'" />
<t t-set="state" t-value="state.get('sale_onboarding_sample_quotation_state')" />
</t>
</template>
<!-- ONBOARDING PANEL-->
<template id="sale_quotation_onboarding_panel" name="sale.quotation.onboarding.panel">
<t t-call="base.onboarding_container">
<t t-set="classes" t-value="'o_onboarding_violet'" />
<t t-set="bg_image" t-value="'/sale/static/src/img/sale_quotation_onboarding_bg.jpg'"/>
<t t-set="close_method" t-value="'action_close_sale_quotation_onboarding'" />
<t t-set="close_model" t-value="'res.company'" />
<t t-call="base.onboarding_company_step" name="company_step" />
<t t-call="sale.onboarding_quotation_layout_step" name="quotation_layout_step" />
<t t-call="sale.sale_onboarding_order_confirmation_step" name="payment_provider_step" />
<t t-call="sale.sale_onboarding_sample_quotation_step" name="sample_quotation_step" />
</t>
</template>
<!-- ORDER CONFIRMATION -->
<record id="action_open_sale_payment_provider_onboarding_wizard" model="ir.actions.act_window">
<field name="name">Choose how to confirm quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.payment.provider.onboarding.wizard</field>
<field name="view_mode">form</field>
<field name="view_id" ref="payment.payment_provider_onboarding_wizard_form" />
<field name="target">new</field>
</record>
</odoo>

View file

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_order_line_tree" model="ir.ui.view">
<field name="name">sale.order.line.tree</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<tree string="Sales Order Lines" create="false">
<field name="order_id"/>
<field name="order_partner_id"/>
<field name="name"/>
<field name="salesman_id"/>
<field name="product_uom_qty" string="Qty"/>
<field name="qty_delivered"/>
<field name="qty_invoiced"/>
<field name="qty_to_invoice"/>
<field name="product_uom" string="Unit of Measure" groups="uom.group_uom"/>
<field name="price_subtotal" sum="Total" widget="monetary"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
<record id="sale_order_line_view_form_readonly" model="ir.ui.view">
<field name="name">sale.order.line.form.readonly</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<form string="Sales Order Item">
<sheet>
<div class="oe_title">
<h1>
<field name="display_name" readonly="1"/>
</h1>
</div>
<group>
<group>
<field name="order_id" readonly="1"/>
<field name="product_id" readonly="1"/>
<field name="name" readonly="1"/>
<field name="product_uom_qty" readonly="1"/>
<field name="qty_delivered" readonly="1"/>
<field name="qty_invoiced"/>
<field name="product_uom" readonly="1"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<field name="order_partner_id" invisible="1"/>
<field name="display_type" invisible="1"/>
<field name="product_updatable" invisible="1"/>
</group>
<group>
<field name="price_unit" readonly="1"/>
<field name="discount" groups="product.group_discount_per_so_line" readonly="1"/>
<field name="price_subtotal" widget="monetary"/>
<field name="tax_id" widget="many2many_tags" readonly="1"/>
<field name="price_tax" widget="monetary"/>
<field name="price_total" widget="monetary"/>
<field name="currency_id" invisible="1"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_sales_order_line_filter" model="ir.ui.view">
<field name="name">sale.order.line.select</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<search string="Search Sales Order">
<filter string="To Invoice"
name="to_invoice"
domain="[('qty_to_invoice', '!=', 0)]"
help="Sales Order Lines ready to be invoiced"/>
<separator/>
<filter string="My Sales Order Lines"
name="my_sales_order_lines"
domain="[('salesman_id','=',uid)]"
help="Sales Order Lines related to a Sales Order of mine"/>
<field name="order_id"/>
<field name="order_partner_id" operator="child_of"/>
<field name="product_id"/>
<field name="salesman_id"/>
<group expand="0" string="Group By">
<filter string="Product" name="product" domain="[]" context="{'group_by':'product_id'}"/>
<filter string="Order" name="order" domain="[]" context="{'group_by':'order_id'}"/>
<filter string="Salesperson" name="salesperson" domain="[]" context="{'group_by':'salesman_id'}"/>
</group>
</search>
</field>
</record>
<record id="sale_order_line_view_kanban" model="ir.ui.view">
<field name="name">sale.order.line.kanban</field>
<field name="model">sale.order.line</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_content oe_kanban_global_click">
<div class="row">
<div class="col-12">
<field name="display_name"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
</odoo>

View file

@ -0,0 +1,950 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- VIEWS -->
<record id="sale_order_view_activity" model="ir.ui.view">
<field name="name">sale.order.activity</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<activity string="Sales Orders">
<templates>
<div t-name="activity-box">
<div>
<field name="name" display="full"/>
<field name="partner_id" muted="1" display="full"/>
</div>
</div>
</templates>
</activity>
</field>
</record>
<record id="view_sale_order_calendar" model="ir.ui.view">
<field name="name">sale.order.calendar</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<calendar string="Sales Orders" date_start="date_order" color="state" hide_time="true" event_limit="5" quick_add="False">
<field name="currency_id" invisible="1"/>
<field name="partner_id" avatar_field="avatar_128"/>
<field name="amount_total" widget="monetary"/>
<field name="payment_term_id"/>
<field name="state" filters="1" invisible="1"/>
</calendar>
</field>
</record>
<record id="view_sale_order_graph" model="ir.ui.view">
<field name="name">sale.order.graph</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<graph string="Sales Orders" sample="1">
<field name="partner_id"/>
<field name="amount_total" type="measure"/>
</graph>
</field>
</record>
<record id="view_sale_order_pivot" model="ir.ui.view">
<field name="name">sale.order.pivot</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<pivot string="Sales Orders" sample="1">
<field name="date_order" type="row"/>
<field name="amount_total" type="measure"/>
</pivot>
</field>
</record>
<record id="view_sale_order_kanban" model="ir.ui.view">
<field name="name">sale.order.kanban</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1" quick_create="false">
<field name="name"/>
<field name="partner_id"/>
<field name="amount_total"/>
<field name="date_order"/>
<field name="state"/>
<field name="currency_id"/>
<field name="activity_state"/>
<progressbar field="activity_state"
colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div class="o_kanban_record_top mb16">
<div class="o_kanban_record_headings mt4">
<strong class="o_kanban_record_title">
<span t-out="record.partner_id.value"/>
</strong>
</div>
<strong>
<field name="amount_total" widget="monetary"/>
</strong>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left text-muted">
<span>
<t t-out="record.name.value"/> <t t-out="record.date_order.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', 'cancel': 'default', 'done': 'success'}}"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- TODO VFE factorize core fields between quotation & SO views -->
<record id="view_order_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="priority">2</field>
<field name="arch" type="xml">
<tree string="Sales Orders" sample="1"
decoration-info="invoice_status == 'to invoice'"
decoration-muted="state == 'cancel'">
<field name="message_needaction" invisible="1"/>
<field name="name" string="Number" readonly="1" decoration-bf="1"/>
<field name="date_order" string="Order Date" widget="date" optional="show"/>
<field name="commitment_date" optional="hide"/>
<field name="expected_date" optional="hide"/>
<field name="partner_id" readonly="1"/>
<field name="user_id" optional="show" widget="many2one_avatar_user"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="team_id" optional="hide"/>
<field name="company_id" groups="base.group_multi_company" optional="show" readonly="1"/>
<field name="amount_untaxed" sum="Total Tax Excluded" widget="monetary" optional="hide"/>
<field name="amount_tax" sum="Tax Total" widget="monetary" optional="hide"/>
<field name="amount_total" sum="Total Tax Included" widget="monetary" decoration-bf="1" optional="show"/>
<field name="currency_id" invisible="1"/>
<field name="invoice_status"
decoration-success="invoice_status == 'invoiced'"
decoration-info="invoice_status == 'to invoice'"
decoration-warning="invoice_status == 'upselling'"
widget="badge" optional="show"/>
<field name="tag_ids" optional="hide" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="state" invisible="1"/>
</tree>
</field>
</record>
<record id="view_quotation_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="priority">4</field>
<field name="arch" type="xml">
<tree string="Quotation" class="o_sale_order" sample="1"
decoration-info="state in ['draft', 'sent']"
decoration-muted="state == 'cancel'">
<field name="name" string="Number" readonly="1" decoration-bf="1"/>
<field name="create_date" string="Creation Date" widget="date" optional="show"/>
<field name="commitment_date" widget="date" optional="hide"/>
<field name="expected_date" widget="date" optional="hide"/>
<field name="partner_id" readonly="1"/>
<field name="user_id" widget="many2one_avatar_user" optional="show"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="team_id" optional="hide"/>
<field name="tag_ids" optional="hide" widget="many2many_tags" options="{'color_field': 'color'}"/>
<field name="company_id" groups="base.group_multi_company" optional="show" readonly="1"/>
<field name="company_id" groups="!base.group_multi_company" invisible="1"/>
<field name="amount_untaxed" sum="Total Tax Excluded" widget="monetary" optional="hide"/>
<field name="amount_tax" sum="Tax Total" widget="monetary" optional="hide"/>
<field name="amount_total" sum="Total Tax Included" widget="monetary" decoration-bf="1" optional="show"/>
<field name="state"
decoration-success="state == 'sale' or state == 'done'"
decoration-info="state == 'draft' or state == 'sent'"
widget="badge" optional="show"/>
<field name="invoice_status" optional="hide"/>
<field name="message_needaction" invisible="1"/>
<field name="currency_id" invisible="1"/>
</tree>
</field>
</record>
<record id="view_quotation_tree_with_onboarding" model="ir.ui.view">
<field name="name">sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="view_quotation_tree"/>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="banner_route">/sales/sale_quotation_onboarding_panel</attribute>
</xpath>
</field>
</record>
<record id="view_order_form" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<form string="Sales Order" class="o_sale_order">
<header>
<field name="authorized_transaction_ids" invisible="1"/>
<button name="payment_action_capture" type="object" data-hotkey="shift+g"
string="Capture Transaction" class="oe_highlight"
attrs="{'invisible': [('authorized_transaction_ids', '=', [])]}"/>
<button name="payment_action_void" type="object"
string="Void Transaction" data-hotkey="shift+v"
confirm="Are you sure you want to void the authorized transaction? This action can't be undone."
attrs="{'invisible': [('authorized_transaction_ids', '=', [])]}"/>
<button id="create_invoice" name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" class="btn-primary" data-hotkey="q"
attrs="{'invisible': [('invoice_status', '!=', 'to invoice')]}"/>
<button id="create_invoice_percentage" name="%(sale.action_view_sale_advance_payment_inv)d" string="Create Invoice"
type="action" context="{'default_advance_payment_method': 'percentage'}" data-hotkey="q"
attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="btn-primary" data-hotkey="g" context="{'validate_analytic': True}"/>
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice"
groups="sale.group_proforma_sales" class="btn-primary"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('invoice_count','&gt;=',1)]}" context="{'proforma': True, 'validate_analytic': True}"/>
<button name="action_confirm" id="action_confirm" data-hotkey="v"
string="Confirm" class="btn-primary" type="object" context="{'validate_analytic': True}"
attrs="{'invisible': [('state', 'not in', ['sent'])]}"/>
<button name="action_confirm" data-hotkey="v"
string="Confirm" type="object" context="{'validate_analytic': True}"
attrs="{'invisible': [('state', 'not in', ['draft'])]}"/>
<button name="action_quotation_send" type="object" string="Send PRO-FORMA Invoice" groups="sale.group_proforma_sales" attrs="{'invisible': ['|', ('state', '=', 'draft'), ('invoice_count','&gt;=',1)]}" context="{'proforma': True, 'validate_analytic': True}"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale" data-hotkey="g" context="{'validate_analytic': True}"/>
<button name="action_cancel" type="object" string="Cancel" attrs="{'invisible': ['|', ('state', 'not in', ['draft', 'sent','sale']), ('id', '=', False)]}" data-hotkey="z"/>
<button name="action_draft" states="cancel" type="object" string="Set to Quotation" data-hotkey="w"/>
<field name="state" widget="statusbar" statusbar_visible="draft,sent,sale"/>
</header>
<div
class="alert alert-warning mb-0" role="alert"
attrs="{'invisible': [('partner_credit_warning', '=', '')]}">
<field name="partner_credit_warning"/>
</div>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_view_invoice"
type="object"
class="oe_stat_button"
icon="fa-pencil-square-o"
attrs="{'invisible': [('invoice_count', '=', 0)]}">
<field name="invoice_count" widget="statinfo" string="Invoices"/>
</button>
<button name="action_preview_sale_order"
type="object"
class="oe_stat_button"
icon="fa-globe icon">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Customer</span>
<span class="o_stat_text">Preview</span>
</div>
</button>
</div>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
</h1>
</div>
<group name="sale_header">
<group name="partner_details">
<field name="partner_id" widget="res_partner_many2one" context="{'res_partner_search_mode': 'customer', 'show_address': 1, 'show_vat': True}" options='{"always_reload": True}'/>
<field name="partner_invoice_id" groups="account.group_delivery_invoice_address" context="{'default_type':'invoice'}" options='{"always_reload": True}'/>
<field name="partner_shipping_id" groups="account.group_delivery_invoice_address" context="{'default_type':'delivery'}" options='{"always_reload": True}'/>
</group>
<group name="order_details">
<field name="validity_date" attrs="{'invisible': [('state', 'in', ['sale', 'done'])]}"/>
<div class="o_td_label" groups="base.group_no_one" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}">
<label for="date_order" string="Quotation Date"/>
</div>
<field name="date_order" nolabel="1" groups="base.group_no_one" attrs="{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}"/>
<div class="o_td_label" attrs="{'invisible': [('state', 'in', ['draft', 'sent'])]}">
<label for="date_order" string="Order Date"/>
</div>
<field name="date_order" attrs="{'invisible': [('state', 'in', ['draft', 'sent'])]}" nolabel="1"/>
<field name="show_update_pricelist" invisible="1"/>
<label for="pricelist_id" groups="product.group_product_pricelist"/>
<div groups="product.group_product_pricelist" class="o_row">
<field name="pricelist_id" options="{'no_open':True,'no_create': True}"/>
<button name="action_update_prices" type="object"
string=" Update Prices"
help="Recompute all prices based on this pricelist"
class="btn-link mb-1 px-0" icon="fa-refresh"
confirm="This will update all unit prices based on the currently set pricelist."
attrs="{'invisible': ['|', ('show_update_pricelist', '=', False), ('state', 'in', ['sale', 'done', 'cancel'])]}"/>
</div>
<field name="company_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="pricelist_id" invisible="1" groups="!product.group_product_pricelist"/>
<field name="tax_country_id" invisible="1"/>
<field name="payment_term_id" options="{'no_open':True,'no_create': True}"/>
</group>
</group>
<notebook>
<page string="Order Lines" name="order_lines">
<field
name="order_line"
widget="section_and_note_one2many"
mode="tree,kanban"
attrs="{'readonly': [('state', 'in', ('done','cancel'))]}"
>
<form>
<field name="display_type" invisible="1"/>
<!--
We need the sequence field to be here for new lines to be added at the correct position.
TODO: at some point we want to fix this in the framework so that an invisible field is not required.
-->
<field name="sequence" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<group>
<group attrs="{'invisible': [('display_type', '!=', False)]}">
<field name="product_updatable" invisible="1"/>
<field name="product_id"
domain="[('sale_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'company_id': parent.company_id}"
attrs="{
'readonly': [('product_updatable', '=', False)],
'required': [('display_type', '=', False)],
}"
force_save="1"
widget="many2one_barcode"
/>
<field name="product_type" invisible="1"/>
<field name="invoice_status" invisible="1"/>
<field name="qty_to_invoice" invisible="1"/>
<field name="qty_delivered_method" invisible="1"/>
<field name="price_total" invisible="1"/>
<field name="price_tax" invisible="1"/>
<field name="price_subtotal" invisible="1"/>
<field name="product_uom_readonly" invisible="1"/>
<label for="product_uom_qty"/>
<div class="o_row" name="ordered_qty">
<field
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':product_uom, 'uom_qty_change':True, 'company_id': parent.company_id}"
name="product_uom_qty"/>
<field name="product_uom" invisible="1" groups="!uom.group_uom"/>
<field
name="product_uom"
force_save="1"
groups="uom.group_uom"
class="oe_no_button"
attrs="{
'readonly': [('product_uom_readonly', '=', True)],
'required': [('display_type', '=', False)],
}"
/>
</div>
<label for="qty_delivered" string="Delivered" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
<div name="delivered_qty" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}">
<field name="qty_delivered" attrs="{'readonly': [('qty_delivered_method', '!=', 'manual')]}"/>
</div>
<label for="qty_invoiced" string="Invoiced" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
<div name="invoiced_qty" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}">
<field name="qty_invoiced" attrs="{'invisible': [('parent.state', 'not in', ['sale', 'done'])]}"/>
</div>
<field name="product_packaging_qty" attrs="{'invisible': ['|', ('product_id', '=', False), ('product_packaging_id', '=', False)]}" groups="product.group_stock_packaging"/>
<field name="product_packaging_id" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" groups="product.group_stock_packaging" />
<field name="price_unit"/>
<field name="tax_id" widget="many2many_tags" options="{'no_create': True}" context="{'search_view_ref': 'account.account_tax_view_search'}" domain="[('type_tax_use','=','sale'), ('company_id','=',parent.company_id), ('country_id', '=', parent.tax_country_id)]"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"/>
<label for="discount" groups="product.group_discount_per_so_line"/>
<div name="discount" groups="product.group_discount_per_so_line">
<field name="discount" class="oe_inline"/> %
</div>
<!--
We need the sequence field to be here
because we want to be able to overwrite the default sequence value in the JS
in order for new lines to be added at the correct position.
NOTE: at some point we want to fix this in the framework so that an invisible field is not required.
-->
<field name="sequence" invisible="1"/>
</group>
<group attrs="{'invisible': [('display_type', '!=', False)]}">
<label for="customer_lead"/>
<div name="lead">
<field name="customer_lead" class="oe_inline"/> days
</div>
<field name="analytic_distribution" widget="analytic_distribution"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'sale_order'}"/>
</group>
</group>
<label for="name" string="Description" attrs="{'invisible': [('display_type', '!=', False)]}"/>
<label for="name" string="Section Name (eg. Products, Services)" attrs="{'invisible': [('display_type', '!=', 'line_section')]}"/>
<label for="name" string="Note" attrs="{'invisible': [('display_type', '!=', 'line_note')]}"/>
<field name="name"/>
<div name="invoice_lines" groups="base.group_no_one" attrs="{'invisible': [('display_type', '!=', False)]}">
<label for="invoice_lines"/>
<field name="invoice_lines"/>
</div>
<field name="state" invisible="1"/>
<field name="company_id" invisible="1"/>
</form>
<tree
string="Sales Order Lines"
editable="bottom"
>
<control>
<create name="add_product_control" string="Add a product"/>
<create name="add_section_control" string="Add a section" context="{'default_display_type': 'line_section'}"/>
<create name="add_note_control" string="Add a note" context="{'default_display_type': 'line_note'}"/>
</control>
<field name="sequence" widget="handle" />
<!-- We do not display the type because we don't want the user to be bothered with that information if he has no section or note. -->
<field name="display_type" invisible="1"/>
<field name="product_uom_category_id" invisible="1"/>
<field name="product_type" invisible="1"/>
<field name="product_updatable" invisible="1"/>
<field
name="product_id"
attrs="{
'readonly': [('product_updatable', '=', False)],
'required': [('display_type', '=', False)],
}"
force_save="1"
context="{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom':product_uom,
'company_id': parent.company_id,
'default_lst_price': price_unit,
'default_description_sale': name
}"
options="{
'no_open': True,
}"
domain="[('sale_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
widget="sol_product_many2one"
/>
<field name="product_template_id"
string="Product"
invisible="1"
attrs="{
'readonly': [('product_updatable', '=', False)],
'required': [('display_type', '=', False)],
}"
context="{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom':product_uom,
'company_id': parent.company_id,
'default_list_price': price_unit,
'default_description_sale': name
}"
options="{
'no_open': True,
}"
domain="[('sale_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"
widget="sol_product_many2one"/>
<field name="name" widget="section_and_note_text" optional="show"/>
<field name="analytic_distribution" widget="analytic_distribution"
optional="hide"
groups="analytic.group_analytic_accounting"
options="{'product_field': 'product_id', 'business_domain': 'sale_order'}"/>
<field
name="product_uom_qty"
decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"
context="{
'partner_id': parent.partner_id,
'quantity': product_uom_qty,
'pricelist': parent.pricelist_id,
'uom': product_uom,
'company_id': parent.company_id
}"
/>
<field
name="qty_delivered"
decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"
string="Delivered"
attrs="{
'column_invisible': [('parent.state', 'not in', ['sale', 'done'])],
'readonly': [('qty_delivered_method', '!=', 'manual')]
}"
optional="show"
/>
<field name="qty_delivered_method" invisible="1"/>
<field
name="qty_invoiced"
decoration-info="(not display_type and invoice_status == 'to invoice')" decoration-bf="(not display_type and invoice_status == 'to invoice')"
string="Invoiced"
attrs="{'column_invisible': [('parent.state', 'not in', ['sale', 'done'])]}"
optional="show"
/>
<field name="qty_to_invoice" invisible="1"/>
<field name="product_uom_readonly" invisible="1"/>
<field name="product_uom" invisible="1" groups="!uom.group_uom"/>
<field
name="product_uom"
force_save="1"
string="UoM"
attrs="{
'readonly': [('product_uom_readonly', '=', True)],
'required': [('display_type', '=', False)],
}"
context="{'company_id': parent.company_id}"
groups="uom.group_uom"
options='{"no_open": True}'
optional="show"
/>
<field
name="customer_lead"
optional="hide"
attrs="{'readonly': [('parent.state', 'not in', ['draft', 'sent', 'sale'])]}"
/>
<field name="product_packaging_qty" attrs="{'invisible': ['|', ('product_id', '=', False), ('product_packaging_id', '=', False)]}" groups="product.group_stock_packaging" optional="show"/>
<field name="product_packaging_id" attrs="{'invisible': [('product_id', '=', False)]}" context="{'default_product_id': product_id, 'tree_view_ref':'product.product_packaging_tree_view', 'form_view_ref':'product.product_packaging_form_view'}" groups="product.group_stock_packaging" optional="show"/>
<field
name="price_unit"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"
/>
<field
name="tax_id"
widget="many2many_tags"
options="{'no_create': True}"
domain="[('type_tax_use','=','sale'),('company_id','=',parent.company_id), ('country_id', '=', parent.tax_country_id)]"
context="{'active_test': True}"
attrs="{'readonly': [('qty_invoiced', '&gt;', 0)]}"
optional="show"
/>
<field name="discount" string="Disc.%" groups="product.group_discount_per_so_line" optional="show" widget="sol_discount"/>
<field name="is_downpayment" invisible="1"/>
<field name="price_subtotal" widget="monetary" groups="account.group_show_line_subtotals_tax_excluded" attrs="{'invisible': [('is_downpayment', '=', True)]}"/>
<field name="price_total" widget="monetary" groups="account.group_show_line_subtotals_tax_included" attrs="{'invisible': [('is_downpayment', '=', True)]}"/>
<field name="state" invisible="1"/>
<field name="invoice_status" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="price_tax" invisible="1"/>
<field name="company_id" invisible="1"/>
</tree>
<kanban class="o_kanban_mobile">
<field name="name"/>
<field name="product_id"/>
<field name="product_uom_qty"/>
<field name="product_uom"/>
<field name="price_subtotal"/>
<field name="price_total"/>
<field name="price_tax" invisible="1"/>
<field name="price_total" invisible="1"/>
<field name="price_unit"/>
<field name="display_type"/>
<field name="tax_id" invisible="1"/>
<field name="company_id" invisible="1"/>
<field name="product_updatable" invisible="1"/>
<field name="qty_invoiced" invisible="1"/>
<field name="product_uom_readonly" invisible="1"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click ps-0 pe-0 {{ record.display_type.raw_value ? 'o_is_' + record.display_type.raw_value : '' }}">
<t t-if="!record.display_type.raw_value">
<div class="row g-0">
<div class="col-2 pe-3">
<img t-att-src="kanban_image('product.product', 'image_128', record.product_id.raw_value)" t-att-title="record.product_id.value" t-att-alt="record.product_id.value" style="max-width: 100%;"/>
</div>
<div class="col-10">
<div class="row">
<div class="col">
<strong t-out="record.product_id.value" />
</div>
<div class="col-auto">
<t t-set="line_price" t-value="record.price_subtotal.value" groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="line_price" t-value="record.price_total.value" groups="account.group_show_line_subtotals_tax_included"/>
<strong class="float-end text-end" t-out="line_price" />
</div>
</div>
<div class="row">
<div class="col-12 text-muted">
Quantity:
<t t-out="record.product_uom_qty.value"/> <t t-out="record.product_uom.value"/>
</div>
</div>
<div class="row">
<div class="col-12 text-muted">
Unit Price:
<t t-out="record.price_unit.value"/>
</div>
</div>
</div>
</div>
</t>
<t t-if="record.display_type.raw_value === 'line_section' || record.display_type.raw_value === 'line_note'">
<div class="row">
<div class="col-12">
<t t-out="record.name.value"/>
</div>
</div>
</t>
</div>
</t>
</templates>
</kanban>
</field>
<group name="note_group" col="6" class="mt-2 mt-md-0">
<group colspan="4">
<field colspan="2" name="note" nolabel="1" placeholder="Terms and conditions..."/>
</group>
<group class="oe_subtotal_footer oe_right" colspan="2" name="sale_total">
<field name="tax_totals" widget="account-tax-totals-field" nolabel="1" colspan="2" readonly="1"/>
</group>
<div class="clearfix"/>
</group>
</page>
<page string="Other Info" name="other_information">
<group>
<group name="sales_person" string="Sales">
<field name="user_id" widget="many2one_avatar_user"/>
<field name="team_id" kanban_view_ref="%(sales_team.crm_team_view_kanban)s" options="{'no_create': True}"/>
<field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/>
<label for="require_signature" string="Online confirmation"/>
<div>
<field name="require_signature" class="oe_inline"/>
<span>Signature</span>
<field name="require_payment" class="oe_inline ms-3"/>
<span>Payment</span>
</div>
<field name="reference" readonly="1" attrs="{'invisible': [('reference', '=', False)]}"/>
<field name="client_order_ref"/>
<field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"/>
</group>
<group name="sale_info" string="Invoicing and Payments">
<field name="show_update_fpos" invisible="1"/>
<label for="fiscal_position_id"/>
<div class="o_row">
<field name="fiscal_position_id" options="{'no_create': True}"/>
<button name="action_update_taxes" type="object"
string=" Update Taxes"
help="Recompute all taxes based on this fiscal position"
class="btn-link mb-1 px-0" icon="fa-refresh"
confirm="This will update all taxes based on the currently selected fiscal position."
attrs="{'invisible': ['|', ('show_update_fpos', '=', False), ('state', 'in', ['sale', 'done','cancel'])]}"/>
</div>
<field name="partner_invoice_id" groups="!account.group_delivery_invoice_address" invisible="1"/>
<field name="analytic_account_id" context="{'default_partner_id':partner_invoice_id, 'default_name':name}" attrs="{'readonly': [('invoice_count','!=',0),('state','=','sale')]}" groups="analytic.group_analytic_accounting" force_save="1"/>
<field name="invoice_status" states="sale,done" groups="base.group_no_one"/>
<!-- test_event_configurator -->
<field name="invoice_status" invisible="1" groups="!base.group_no_one"/>
</group>
</group>
<group>
<group name="sale_shipping">
<label for="commitment_date" string="Delivery Date"/>
<div name="commitment_date_div" class="o_row">
<field name="commitment_date"/>
<span name="expected_date_span" class="text-muted">Expected: <field name="expected_date" class="oe_inline" widget="date"/></span>
</div>
</group>
<group string="Tracking" name="sale_reporting">
<group name="technical" colspan="2" class="mb-0">
<field name="origin"/>
</group>
<group name="utm_link" colspan="2" class="mt-0">
<field name="campaign_id" options="{'create_name_field': 'title', 'always_reload': True}"/>
<field name="medium_id"/>
<field name="source_id"/>
</group>
</group>
</group>
</page>
<page groups="base.group_no_one" string="Customer Signature" name="customer_signature" attrs="{'invisible': [('require_signature', '=', False), ('signed_by', '=', False), ('signature', '=', False), ('signed_on', '=', False)]}">
<group>
<field name="signed_by"/>
<field name="signed_on"/>
<field name="signature" widget="image"/>
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="view_sales_order_auto_done_setting" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<button name="action_draft" position="after">
<t groups="sale.group_auto_done_setting">
<button name="action_done" type="object" string="Lock"
states="sale"
help="If the sale is locked, you can not modify it anymore. However, you will still be able to invoice or deliver." groups="sales_team.group_sale_manager"/>
<button name="action_unlock" type="object" string="Unlock"
states="done"
groups="sales_team.group_sale_manager"/>
</t>
</button>
</field>
</record>
<record id="view_sales_order_filter" model="ir.ui.view">
<field name="name">sale.order.list.select</field>
<field name="model">sale.order</field>
<field name="priority" eval="15"/>
<field name="arch" type="xml">
<search string="Search Sales Order">
<field name="name" string="Order"
filter_domain="['|', '|', ('name', 'ilike', self), ('client_order_ref', 'ilike', self), ('partner_id', 'child_of', self)]"/>
<field name="partner_id" operator="child_of"/>
<field name="user_id"/>
<field name="team_id" string="Sales Team"/>
<field name="order_line" string="Product" filter_domain="[('order_line.product_id', 'ilike', self)]"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
<!-- We only allow to search on the following sale order line fields (product, name) because the other fields, such as price, quantity, ...
will not be searched as often, and if they need to be searched it's usually in the context of products
and then they can be searched from the page listing the sale order lines related to a product (from the product itself).
-->
<filter string="My Orders" domain="[('user_id', '=', uid)]" name="my_sale_orders_filter"/>
<filter invisible="1" string="Late Activities" name="activities_overdue"
domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
help="Show all records which has next action date is before today"/>
<filter invisible="1" string="Today Activities" name="activities_today"
domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
<filter invisible="1" string="Future Activities" name="activities_upcoming_all"
domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
<group expand="0" string="Group By">
<filter string="Salesperson" name="salesperson" domain="[]" context="{'group_by': 'user_id'}"/>
<filter name="customer" string="Customer" domain="[]" context="{'group_by': 'partner_id'}"/>
<filter string="Order Date" name="order_month" domain="[]" context="{'group_by': 'date_order'}"/>
</group>
</search>
</field>
</record>
<record id="sale_order_view_search_inherit_quotation" model="ir.ui.view">
<field name="name">sale.order.search.inherit.quotation</field>
<field name="model">sale.order</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<filter name="my_sale_orders_filter" position="replace">
<field name="campaign_id"/>
<separator/>
<filter string="My Quotations" name="my_quotation" domain="[('user_id', '=', uid)]"/>
<separator/>
<filter string="Quotations" name="draft" domain="[('state','in',('draft', 'sent'))]"/>
<filter string="Sales Orders" name="sales" domain="[('state','in',('sale','done'))]"/>
<separator/>
<filter string="Create Date" name="filter_create_date" date="create_date"/>
</filter>
</field>
</record>
<record id="sale_order_view_search_inherit_sale" model="ir.ui.view">
<field name="name">sale.order.search.inherit.sale</field>
<field name="model">sale.order</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<filter name="my_sale_orders_filter" position="after">
<separator/>
<filter string="To Invoice" name="to_invoice" domain="[('invoice_status','=','to invoice')]" />
<filter string="To Upsell" name="upselling" domain="[('invoice_status','=','upselling')]" />
<separator/>
<filter string="Order Date" name="order_date" date="date_order"/>
</filter>
</field>
</record>
<!-- ACTIONS (WINDOW) -->
<record id="action_orders" model="ir.actions.act_window">
<field name="name">Sales Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field name="search_view_id" ref="sale_order_view_search_inherit_sale"/>
<field name="context">{}</field>
<field name="domain">[('state', 'not in', ('draft', 'sent', 'cancel'))]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="sale_order_action_view_order_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="sale.view_order_tree"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_kanban" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">kanban</field>
<field name="view_id" ref="sale.view_sale_order_kanban"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_form" model="ir.actions.act_window.view">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
<field name="view_id" ref="sale.view_order_form"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_calendar" model="ir.actions.act_window.view">
<field name="sequence" eval="4"/>
<field name="view_mode">calendar</field>
<field name="view_id" ref="sale.view_sale_order_calendar"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_pivot" model="ir.actions.act_window.view">
<field name="sequence" eval="5"/>
<field name="view_mode">pivot</field>
<field name="view_id" ref="sale.view_sale_order_pivot"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="sale_order_action_view_order_graph" model="ir.actions.act_window.view">
<field name="sequence" eval="6"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="sale.view_sale_order_graph"/>
<field name="act_window_id" ref="action_orders"/>
</record>
<record id="action_quotations_with_onboarding" model="ir.actions.act_window">
<field name="name">Quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_id" ref="view_quotation_tree_with_onboarding"/>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field name="search_view_id" ref="sale_order_view_search_inherit_quotation"/>
<field name="context">{'search_default_my_quotation': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="action_quotations" model="ir.actions.act_window">
<field name="name">Quotations</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,kanban,form,calendar,pivot,graph,activity</field>
<field name="search_view_id" ref="sale_order_view_search_inherit_quotation"/>
<field name="context">{'search_default_my_quotation': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new quotation, the first step of a new sale!
</p><p>
Once the quotation is confirmed by the customer, it becomes a sales order.<br/> You will be able to create an invoice and collect the payment.
</p>
</field>
</record>
<record id="sale_order_action_view_quotation_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="sale.view_quotation_tree"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_kanban" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">kanban</field>
<field name="view_id" ref="sale.view_sale_order_kanban"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_form" model="ir.actions.act_window.view">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
<field name="view_id" ref="sale.view_order_form"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_calendar" model="ir.actions.act_window.view">
<field name="sequence" eval="4"/>
<field name="view_mode">calendar</field>
<field name="view_id" ref="sale.view_sale_order_calendar"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_pivot" model="ir.actions.act_window.view">
<field name="sequence" eval="5"/>
<field name="view_mode">pivot</field>
<field name="view_id" ref="sale.view_sale_order_pivot"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="sale_order_action_view_quotation_graph" model="ir.actions.act_window.view">
<field name="sequence" eval="6"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="sale.view_sale_order_graph"/>
<field name="act_window_id" ref="action_quotations"/>
</record>
<record id="action_orders_to_invoice" model="ir.actions.act_window">
<field name="name">Orders to Invoice</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form,calendar,graph,pivot,kanban,activity</field>
<field name="context">{'create': False}</field>
<field name="domain">[('invoice_status','=','to invoice')]</field>
<field name="search_view_id" ref="view_sales_order_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No orders to invoice found
</p><p>
You can select all orders and invoice them in batch,<br/>
or check every order and invoice them one by one.
</p>
</field>
</record>
<record id="action_orders_upselling" model="ir.actions.act_window">
<field name="name">Orders to Upsell</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.order</field>
<field name="view_mode">tree,form,calendar,graph,pivot,kanban,activity</field>
<field name="domain">[('invoice_status','=','upselling')]</field>
<field name="context">{'create': False}</field>
<field name="search_view_id" ref="view_sales_order_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No orders to upsell found.
</p><p>
An order is to upsell when delivered quantities are above initially
ordered quantities, and the invoicing policy is based on ordered quantities.
</p><p>
As an example, if you sell pre-paid hours of services, Odoo recommends you
to sell extra hours when all ordered hours have been consumed.
</p>
</field>
</record>
<!-- ACTIONS (SERVER) -->
<record id="model_sale_order_action_quotation_sent" model="ir.actions.server">
<field name="name">Mark Quotation as Sent</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="binding_model_id" ref="sale.model_sale_order"/>
<field name="binding_view_types">form,list</field>
<field name="state">code</field>
<field name="code">action = records.action_quotation_sent()</field>
</record>
<record id="model_sale_order_action_share" model="ir.actions.server">
<field name="name">Share</field>
<field name="model_id" ref="sale.model_sale_order"/>
<field name="binding_model_id" ref="sale.model_sale_order"/>
<field name="binding_view_types">form</field>
<field name="state">code</field>
<field name="code">action = records.action_share()</field>
</record>
</odoo>

View file

@ -0,0 +1,603 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="portal_my_home_menu_sale" name="Portal layout : sales menu entries" inherit_id="portal.portal_breadcrumbs" priority="20">
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li t-if="page_name == 'quote' or sale_order and sale_order.state in ('sent', 'cancel')" t-attf-class="breadcrumb-item #{'active ' if not sale_order else ''}">
<a t-if="sale_order" t-attf-href="/my/quotes?{{ keep_query() }}">Quotations</a>
<t t-else="">Quotations</t>
</li>
<li t-if="page_name == 'order' or sale_order and sale_order.state not in ('sent', 'cancel')" t-attf-class="breadcrumb-item #{'active ' if not sale_order else ''}">
<a t-if="sale_order" t-attf-href="/my/orders?{{ keep_query() }}">Sales Orders</a>
<t t-else="">Sales Orders</t>
</li>
<li t-if="sale_order" class="breadcrumb-item active">
<span t-field="sale_order.type_name"/>
<t t-out="sale_order.name"/>
</li>
</xpath>
</template>
<template id="portal_my_home_sale" name="Show Quotations / Sales Orders" customize_show="True" inherit_id="portal.portal_my_home" priority="20">
<xpath expr="//div[hasclass('o_portal_docs')]" position="inside">
<t t-call="portal.portal_docs_entry">
<t t-set="title">Quotations</t>
<t t-set="url" t-value="'/my/quotes'"/>
<t t-set="placeholder_count" t-value="'quotation_count'"/>
</t>
<t t-call="portal.portal_docs_entry">
<t t-set="title">Sales Orders</t>
<t t-set="url" t-value="'/my/orders'"/>
<t t-set="placeholder_count" t-value="'order_count'"/>
</t>
</xpath>
</template>
<template id="portal_my_quotations" name="My Quotations">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title">Quotations</t>
</t>
<t t-if="quotations" t-call="portal.portal_table">
<thead>
<tr class="active">
<th>Quotation #</th>
<th class="text-end">Quotation Date</th>
<th class="text-end">Valid Until</th>
<th class="text-center"/>
<th class="text-end">Total</th>
</tr>
</thead>
<t t-foreach="quotations" t-as="quotation">
<tr>
<td><a t-att-href="quotation.get_portal_url()"><t t-out="quotation.name"/></a></td>
<td class="text-end"><span t-field="quotation.date_order"/></td>
<td class="text-end"><span t-field="quotation.validity_date"/></td>
<td class="text-center">
<span t-if="quotation.state == 'cancel'" class="badge rounded-pill text-bg-secondary">
<i class="fa fa-fw fa-remove"/> Cancelled</span>
<span t-if="quotation.is_expired" class="badge rounded-pill text-bg-secondary">
<i class="fa fa-fw fa-clock-o"/> Expired</span>
</td>
<td class="text-end">
<span t-field="quotation.amount_total"/>
</td>
</tr>
</t>
</t>
<p t-else="">There are currently no quotations for your account.</p>
</t>
</template>
<template id="portal_my_orders" name="My Sales Orders">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title">Sales Orders</t>
</t>
<t t-if="orders" t-call="portal.portal_table">
<thead>
<tr class="active">
<th>
<span class='d-none d-md-inline'>Sales Order #</span>
<span class='d-block d-md-none'>Ref.</span>
</th>
<th class="text-end">Order Date</th>
<th class="text-center"/>
<th class="text-end">Total</th>
</tr>
</thead>
<t t-foreach="orders" t-as="order">
<tr>
<td><a t-att-href="order.get_portal_url()"><t t-out="order.name"/></a></td>
<td class="text-end">
<span t-field="order.date_order" t-options="{'widget': 'date'}"/>&amp;nbsp;
<span class='d-none d-md-inline' t-field="order.date_order" t-options="{'time_only': True}"/>
</td>
<td class="text-center">
<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"/>Done
</span>
</td>
<td class="text-end"><span t-field="order.amount_total"/></td>
</tr>
</t>
</t>
<p t-else="">There are currently no orders for your account.</p>
</t>
</template>
<!-- Complete page of the sale_order -->
<template id="sale_order_portal_template" name="Sales Order Portal Template" inherit_id="portal.portal_sidebar" primary="True">
<xpath expr="//div[hasclass('o_portal_sidebar')]" position="inside">
<t t-set="o_portal_fullwidth_alert" groups="sales_team.group_sale_salesman">
<!-- Uses backend_url provided in rendering values -->
<t t-call="portal.portal_back_in_edit_mode"/>
</t>
<div class="row mt16 o_portal_sale_sidebar">
<!-- Sidebar -->
<t t-call="portal.portal_record_sidebar">
<t t-set="classes" t-value="'col-lg-auto d-print-none'"/>
<t t-set="title">
<h2 class="mb-0"><b t-field="sale_order.amount_total" data-id="total_amount"/> </h2>
</t>
<t t-set="entries">
<ul class="list-group list-group-flush flex-wrap flex-row flex-lg-column">
<li class="list-group-item d-grid align-content-start">
<a t-if="sale_order._has_to_be_signed(True)" role="button" class="btn btn-primary mb8" data-bs-toggle="modal" data-bs-target="#modalaccept" href="#">
<i class="fa fa-check"/><t t-if="sale_order._has_to_be_paid(True)"> Sign &amp; Pay</t><t t-else=""> Accept &amp; Sign</t>
</a>
<a t-elif="sale_order._has_to_be_paid(True)" role="button" id="o_sale_portal_paynow" data-bs-toggle="modal" data-bs-target="#modalaccept" href="#" t-att-class="'mb8 %s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')" >
<i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept &amp; Pay</t><t t-else="">Pay Now</t>
</a>
<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 o_download_btn" t-att-href="sale_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 o_print_btn o_portal_invoice_print" t-att-href="sale_order.get_portal_url(report_type='pdf')" id="print_invoice_report" title="Print" target="_blank"><i class="fa fa-print"/> Print</a>
</div>
</div>
</li>
<li class="navspy list-group-item ps-0 flex-grow-1" t-ignore="true" role="complementary">
<ul class="nav flex-column bs-sidenav"></ul>
</li>
<t t-if="not sale_order.is_expired and sale_order.state in ['draft', 'sent']">
<li t-if="sale_order.validity_date" class="list-group-item">
<small><b class="text-muted">This offer expires on</b></small>
<div t-field="sale_order.validity_date"></div>
</li>
<li t-if="sale_order.amount_undiscounted - sale_order.amount_untaxed &gt; 0.01" class="list-group-item flex-grow-1">
<small><b class="text-muted">Your advantage</b></small>
<small>
<b t-field="sale_order.amount_undiscounted"
t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'
style="text-decoration: line-through"
class="d-block mt-1"
data-id="amount_undiscounted" />
</small>
<t t-if="sale_order.amount_untaxed == sale_order.amount_total">
<h4 t-field="sale_order.amount_total" class="text-success" data-id="total_amount"/>
</t>
<t t-else="">
<h4 t-field="sale_order.amount_untaxed" class="text-success mb-0" data-id="total_untaxed"/>
<small>(<span t-field="sale_order.amount_total" data-id="total_amount"/> Incl. tax)</small>
</t>
</li>
</t>
<li t-if="sale_order.user_id" class="list-group-item flex-grow-1">
<div class="small mb-1">
<strong class="text-muted">Salesperson</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(sale_order.user_id.avatar_128)"
alt="Contact"/>
</div>
<div class="col ps-0" style="min-width: 150px">
<span t-field="sale_order.user_id"
t-options='{"widget": "contact", "fields": ["name", "phone"], "no_marker": True}'/>
<a href="#discussion" class="small">
<i class="fa fa-comment"></i> Send message
</a>
</div>
</div>
</li>
</ul>
</t>
</t>
<!-- Page content -->
<div id="quote_content" class="col-12 col-lg justify-content-end">
<!-- modal relative to the actions sign and pay -->
<div role="dialog" class="modal fade" id="modalaccept">
<div class="modal-dialog" t-if="sale_order._has_to_be_signed(True)">
<form id="accept" method="POST" t-att-data-order-id="sale_order.id" t-att-data-token="sale_order.access_token" class="js_accept_json modal-content js_website_submit_form">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<header class="modal-header">
<h4 class="modal-title">Validate Order</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</header>
<main class="modal-body" id="sign-dialog">
<p>
<span>By signing this proposal, I agree to the following terms:</span>
<ul>
<li>
<span>Accepted on the behalf of:</span> <b t-field="sale_order.partner_id.commercial_partner_id"/>
</li>
<li>
<span>For an amount of:</span> <b data-id="total_amount" t-field="sale_order.amount_total"/>
</li>
<li t-if="sale_order.payment_term_id">
<span>With payment terms:</span> <b t-field="sale_order.payment_term_id.note"/>
</li>
</ul>
</p>
<t t-call="portal.signature_form">
<t t-set="call_url" t-value="sale_order.get_portal_url(suffix='/accept')"/>
<t t-set="default_name" t-value="sale_order.partner_id.name"/>
</t>
</main>
</form>
</div>
<div class="modal-dialog" t-if="not sale_order._has_to_be_signed(True) and sale_order._has_to_be_paid(True)">
<div class="modal-content">
<header class="modal-header">
<h4 class="modal-title">Validate Order</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</header>
<main class="modal-body" id="sign-dialog">
<p>
<span>By paying this proposal, I agree to the following terms:</span>
<ul>
<li>
<span>Accepted on the behalf of:</span> <b t-field="sale_order.partner_id.commercial_partner_id"/>
</li>
<li>
<span>For an amount of:</span> <b data-id="total_amount" t-field="sale_order.amount_total"/>
</li>
<li t-if="sale_order.payment_term_id">
<span>With payment terms:</span> <b t-field="sale_order.payment_term_id.note"/>
</li>
</ul>
</p>
<div t-if="providers or tokens" id="payment_method" class="text-start">
<h3 class="mb24">Pay with</h3>
<t t-call="payment.checkout"/>
</div>
<div t-else="" class="alert alert-warning">
<strong>No suitable payment option could be found.</strong><br/>
If you believe that it is an error, please contact the website administrator.
</div>
</main>
</div>
</div>
</div>
<!-- modal relative to the action reject -->
<div role="dialog" class="modal fade" id="modaldecline">
<div class="modal-dialog">
<form id="decline" method="POST" t-attf-action="/my/orders/#{sale_order.id}/decline?access_token=#{sale_order.access_token}" class="modal-content">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
<header class="modal-header">
<h4 class="modal-title">Reject This Quotation</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</header>
<main class="modal-body">
<p>
Tell us why you are refusing this quotation, this will help us improve our services.
</p>
<textarea rows="4" name="decline_message" required="" placeholder="Your feedback..." class="form-control" />
</main>
<footer class="modal-footer">
<button type="submit" t-att-id="sale_order.id" class="btn btn-danger">
<i class="fa fa-times"></i> Reject
</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">
Cancel
</button>
</footer>
</form>
</div>
</div>
<!-- status messages -->
<div t-if="message == 'sign_ok'" class="alert alert-success alert-dismissible d-print-none" role="status">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
<strong>Thank You!</strong><br/>
<t t-if="message == 'sign_ok' and sale_order.state in ['sale', 'done']">
Your order has been confirmed.
</t>
<t t-elif="message == 'sign_ok' and sale_order._has_to_be_paid()">
Your order has been signed but still needs to be paid to be confirmed.
</t>
<t t-else="">Your order has been signed.</t>
</div>
<div t-if="message == 'cant_reject'" class="alert alert-danger alert-dismissible d-print-none" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
Your order is not in a state to be rejected.
</div>
<t t-if="sale_order.transaction_ids">
<t t-call="payment.transaction_status">
<t t-set="tx" t-value="sale_order.get_portal_last_transaction()"/>
</t>
</t>
<div t-if="sale_order.state == 'cancel'" class="alert alert-danger alert-dismissible d-print-none" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="close"></button>
<strong>This quotation has been canceled.</strong> <a role="button" href="#discussion"><i class="fa fa-comment"/> Contact us to get a new quotation.</a>
</div>
<div t-if="sale_order.is_expired" class="alert alert-warning alert-dismissible d-print-none" role="alert">
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="close"></button>
<strong>This offer expired!</strong> <a role="button" href="#discussion"><i class="fa fa-comment"/> Contact us to get a new quotation.</a>
</div>
<!-- main content -->
<div t-attf-class="card #{'pb-5' if report_type == 'html' else ''}" id="portal_sale_content">
<div t-call="sale.sale_order_portal_content"/>
</div>
<!-- bottom actions -->
<div t-if="sale_order._has_to_be_signed(True) or sale_order._has_to_be_paid(True)" class="row justify-content-center text-center d-print-none pt-1 pb-4">
<t t-if="sale_order._has_to_be_signed(True)">
<div class="col-sm-auto mt8">
<a role="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalaccept" href="#"><i class="fa fa-check"/><t t-if="sale_order._has_to_be_paid(True)"> Sign &amp; Pay</t><t t-else=""> Accept &amp; Sign</t></a>
</div>
<div class="col-sm-auto mt8">
<a role="button" class="btn btn-secondary" href="#discussion"><i class="fa fa-comment"/> Feedback</a>
</div>
<div class="col-sm-auto mt8">
<a role="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#modaldecline" href="#"> <i class="fa fa-times"/> Reject</a>
</div>
</t>
<div t-elif="sale_order._has_to_be_paid(True)" class="col-sm-auto mt8">
<a role="button" data-bs-toggle="modal" data-bs-target="#modalaccept" href="#" t-att-class="'%s' % ('btn btn-light' if sale_order.transaction_ids else 'btn btn-primary')">
<i class="fa fa-check"/> <t t-if="not sale_order.signature">Accept &amp; Pay</t><t t-else="">Pay Now</t>
</a>
</div>
</div>
<!-- chatter -->
<div id="sale_order_communication" class="mt-4">
<h2>History</h2>
<t t-call="portal.message_thread"/>
</div>
</div><!-- // #quote_content -->
</div>
</xpath>
</template>
<!--
Sales Order content : intro, informations, order lines, remarks, descriptions ....
This template should contains all the printable element of the SO. This is the
template rendered in PDF with the report engine.
-->
<template id="sale_order_portal_content" name="Sales Order Portal Content">
<!-- Intro -->
<div id="introduction" t-attf-class="pb-2 pt-3 #{'card-header bg-white' if report_type == 'html' else ''}">
<h2 class="my-0">
<t t-out="sale_order.type_name"/>
<em t-out="sale_order.name"/>
</h2>
</div>
<div t-attf-class="#{'card-body' if report_type == 'html' else ''}">
<!-- Informations -->
<div id="informations">
<div t-if="sale_order.transaction_ids and not invoices and sale_order.state in ('sent', 'sale') and portal_confirmation == 'pay' and not success and not error" t-att-data-order-id="sale_order.id">
<t t-if="sale_order.transaction_ids">
<t t-call="payment.transaction_status">
<t t-set="tx" t-value="sale_order.get_portal_last_transaction()"/>
</t>
</t>
</div>
<div class="row" id="so_date">
<div class="mb-3 col-6">
<t t-if="sale_order.state in ['sale', 'done', 'cancel']">
<strong>Order Date:</strong>
</t>
<t t-else="">
<strong>Quotation Date:</strong>
</t>
<span t-field="sale_order.date_order" t-options='{"widget": "date"}'/>
</div>
<div class="mb-3 col-6" t-if="sale_order.validity_date and sale_order.state in ['draft', 'sent']">
<strong>Expiration Date:</strong> <span t-field="sale_order.validity_date" t-options='{"widget": "date"}'/>
</div>
</div>
<div class="row" id="invoicing_shipping_address">
<div class="col-lg-6">
<strong class="d-block mb-1">
<t t-if="sale_order.partner_shipping_id == sale_order.partner_invoice_id">
Invoicing and Shipping Address:
</t>
<t t-else="">
Invoicing Address:
</t>
</strong>
<address t-field="sale_order.partner_invoice_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
</div>
<div t-if="sale_order.partner_shipping_id != sale_order.partner_invoice_id"
id="shipping_address"
class="col-lg-6">
<strong class="d-block mb-1">
Shipping Address:
</strong>
<address t-field="sale_order.partner_shipping_id"
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
</div>
</div>
<t t-set="invoices" t-value="sale_order.invoice_ids.filtered(lambda i: i.state not in ['draft', 'cancel'])"/>
<div t-if="invoices" class="row">
<div class="col">
<strong class="d-block mb-1">Invoices</strong>
<ul class="list-group mb-4">
<t t-foreach="invoices" t-as="i">
<t t-set="report_url" t-value="i.get_portal_url(report_type='pdf', download=True)"/>
<t t-set="authorized_tx_ids" t-value="i.transaction_ids.filtered(lambda tx: tx.state == 'authorized')"/>
<div class="d-flex flex-wrap align-items-center justify-content-between">
<div>
<a t-att-href="report_url">
<span t-out="i.name"/>
</a>
<div class="small d-lg-inline-block">Date: <span class="text-muted" t-field="i.invoice_date"/></div>
</div>
<span t-if="i.payment_state in ('paid', 'in_payment')" class="small badge text-bg-success orders_label_text_align">
<i class="fa fa-fw fa-check"/> <b>Paid</b>
</span>
<span t-elif="i.payment_state == 'reversed'" class="small badge text-bg-success orders_label_text_align">
<i class="fa fa-fw fa-check"/> <b>Reversed</b>
</span>
<span t-elif="authorized_tx_ids" class="small badge text-bg-success orders_label_text_align">
<i class="fa fa-fw fa-check"/> <b>Authorized</b>
</span>
<span t-else="" class="small badge text-bg-info orders_label_text_align">
<i class="fa fa-fw fa-clock-o"/> <b>Waiting Payment</b>
</span>
</div>
</t>
</ul>
</div>
</div>
</div>
<section id="details" style="page-break-inside: auto;" class="mt32">
<h3 id="details">Pricing</h3>
<t t-set="display_discount" t-value="True in [line.discount > 0 for line in sale_order.order_line]"/>
<div class="table-responsive">
<table t-att-data-order-id="sale_order.id" t-att-data-token="sale_order.access_token" class="table table-sm" id="sales_order_table">
<thead class="bg-100">
<tr>
<th class="text-start" id="product_name_header">Products</th>
<th class="text-end">Quantity</th>
<th t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
Unit Price
</th>
<th t-if="display_discount" t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<span>Disc.%</span>
</th>
<th t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span>Taxes</span>
</th>
<th class="text-end" >
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span>
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span>
</th>
</tr>
</thead>
<tbody class="sale_tbody">
<t t-set="current_subtotal" t-value="0"/>
<t t-set="lines_to_report" t-value="sale_order._get_order_lines_to_report()"/>
<t t-foreach="lines_to_report" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
<tr t-att-class="'bg-200 fw-bold o_line_section' if line.display_type == 'line_section' else 'fst-italic o_line_note' if line.display_type == 'line_note' else ''">
<t t-if="not line.display_type">
<td id="product_name">
<span t-field="line.name"/>
</td>
<td class="text-end">
<div id="quote_qty">
<span t-field="line.product_uom_qty"/>
<span t-field="line.product_uom"/>
</div>
</td>
<td t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<div
t-if="line.discount &gt;= 0"
t-field="line.price_unit"
t-att-style="line.discount and 'text-decoration: line-through' or None"
t-att-class="(line.discount and 'text-danger' or '') + ' text-end'"
/>
<div t-if="line.discount">
<t t-out="(1-line.discount / 100.0) * line.price_unit" t-options='{"widget": "float", "decimal_precision": "Product Price"}'/>
</div>
</td>
<td t-if="display_discount" t-attf-class="text-end {{ 'd-none d-sm-table-cell' if report_type == 'html' else '' }}">
<strong t-if="line.discount &gt; 0" class="text-info">
<t t-out="((line.discount % 1) and '%s' or '%d') % line.discount"/>%
</strong>
</td>
<td t-attf-class="text-end {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))"/>
</td>
<td t-if="not line.is_downpayment" class="text-end">
<span class="oe_order_line_price_subtotal" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<span class="oe_order_line_price_total" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
</td>
</t>
<t t-if="line.display_type == 'line_section'">
<td colspan="99">
<span t-field="line.name"/>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
</t>
<t t-if="line.display_type == 'line_note'">
<td colspan="99">
<span t-field="line.name"/>
</td>
</t>
</tr>
<tr t-if="current_section and (line_last or lines_to_report[line_index+1].display_type == 'line_section') and not line.is_downpayment"
class="is-subtotal text-end">
<td colspan="99">
<strong class="mr16">Subtotal</strong>
<span t-out="current_subtotal"
t-options='{"widget": "monetary", "display_currency": sale_order.pricelist_id.currency_id}'
/>
</td>
</tr>
</t>
</tbody>
</table>
</div>
<div id="total" class="row" name="total" style="page-break-inside: avoid;">
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ms-auto">
<t t-call="sale.sale_order_portal_content_totals_table"/>
</div>
</div>
</section>
<section t-if="sale_order.signature" id="signature" name="Signature">
<div class="row mt-4" name="signature">
<div t-attf-class="#{'col-3' if report_type != 'html' else 'col-sm-7 col-md-4'} ms-auto text-center">
<h5>Signature</h5>
<img t-att-src="image_data_uri(sale_order.signature)" style="max-height: 6rem; max-width: 100%;"/>
<p t-field="sale_order.signed_by"/>
</div>
</div>
</section>
<section t-if="not is_html_empty(sale_order.note)" id="terms" class="mt-5">
<h3 class="">Terms &amp; Conditions</h3>
<hr class="mt-0 mb-1"/>
<t t-if="sale_order.terms_type == 'html'">
<!-- Note is plain text. This ensures a clickable link -->
<t t-set="tc_url" t-value="'%s/terms' % (sale_order.get_base_url())"/>
<em>Terms &amp; Conditions: <a href="/terms"><t t-out="tc_url"/></a></em>
</t>
<t t-else="">
<em t-field="sale_order.note"/>
</t>
</section>
<section t-if="sale_order.payment_term_id" class="mt-5">
<h3 class="">Payment terms</h3>
<hr class="mt-0 mb-1"/>
<span t-field="sale_order.payment_term_id.note"/>
</section>
</div>
</template>
<template id="sale_order_portal_content_totals_table">
<table class="table table-sm">
<t t-set="tax_totals" t-value="sale_order.tax_totals"/>
<t t-call="account.document_tax_totals"/>
</table>
</template>
</odoo>

View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="utm_campaign_view_kanban" model="ir.ui.view">
<field name="name">utm.campaign.view.kanban</field>
<field name="model">utm.campaign</field>
<field name="inherit_id" ref="utm.utm_campaign_view_kanban"/>
<field name="arch" type="xml">
<xpath expr="//div[@id='utm_statistics']" position="inside">
<div class="me-3" title="Revenues" groups="sales_team.group_sale_salesman">
<field name="currency_id" invisible="True"/>
<small class="fw-bold">
<field name="invoiced_amount" widget="monetary" options="{'currency_field': 'currency_id'}"/>
</small>
</div>
<div class="me-3" title="Quotations" groups="sales_team.group_sale_salesman">
<i class="fa fa-money text-muted"></i> <small class="fw-bold"><field name="quotation_count"/></small>
</div>
</xpath>
</field>
</record>
<record id="utm_campaign_view_form" model="ir.ui.view">
<field name="name">utm.campaign.view.form</field>
<field name="model">utm.campaign</field>
<field name="inherit_id" ref="utm.utm_campaign_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('oe_button_box')]" position="inside">
<button name="action_redirect_to_invoiced"
type="object" class="oe_stat_button order-1" icon="fa-usd" groups="sales_team.group_sale_salesman">
<field name="invoiced_amount" widget="statinfo" string="Revenues"/>
</button>
<button name="action_redirect_to_quotations"
type="object" class="oe_stat_button order-2" icon="fa-money" groups="sales_team.group_sale_salesman">
<field name="quotation_count" widget="statinfo" string="Quotations"/>
</button>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="variants">
<t t-set="attribute_exclusions" t-value="product._get_attribute_exclusions(parent_combination, parent_name)"/>
<ul t-attf-class="list-unstyled js_add_cart_variants mb-0 #{ul_class}" t-att-data-attribute_exclusions="json.dumps(attribute_exclusions)">
<t t-foreach="product.valid_product_template_attribute_line_ids" t-as="ptal">
<!-- Attributes selection is hidden if there is only one value available and it's not a custom value -->
<li t-att-data-attribute_id="ptal.attribute_id.id"
t-att-data-attribute_name="ptal.attribute_id.name"
t-att-data-attribute_display_type="ptal.attribute_id.display_type"
t-attf-class="variant_attribute #{'d-none' if len(ptal.product_template_value_ids._only_active()) == 1 and not ptal.product_template_value_ids._only_active()[0].is_custom else ''}">
<!-- Used to customize layout if the only available attribute value is custom -->
<t t-set="single" t-value="len(ptal.product_template_value_ids._only_active()) == 1"/>
<t t-set="single_and_custom" t-value="single and ptal.product_template_value_ids._only_active()[0].is_custom" />
<strong t-field="ptal.attribute_id.name" class="attribute_name"/>
<t t-if="ptal.attribute_id.display_type == 'select'">
<select
t-att-data-attribute_id="ptal.attribute_id.id"
t-attf-class="form-select css_attribute_select o_wsale_product_attribute js_variant_change #{ptal.attribute_id.create_variant} #{'d-none' if single_and_custom else ''}"
t-att-name="'ptal-%s' % ptal.id">
<t t-foreach="ptal.product_template_value_ids._only_active()" t-as="ptav">
<option t-att-value="ptav.id"
t-att-data-value_id="ptav.id"
t-att-data-value_name="ptav.name"
t-att-data-attribute_name="ptav.attribute_id.name"
t-att-data-is_custom="ptav.is_custom"
t-att-selected="ptav in combination"
t-att-data-is_single="single"
t-att-data-is_single_and_custom="single_and_custom">
<span t-field="ptav.name"/>
<t t-call="sale.badge_extra_price"/>
</option>
</t>
</select>
</t>
<t t-if="ptal.attribute_id.display_type == 'radio'">
<ul t-att-data-attribute_id="ptal.attribute_id.id" t-attf-class="list-inline list-unstyled o_wsale_product_attribute #{'d-none' if single_and_custom else ''}">
<t t-foreach="ptal.product_template_value_ids._only_active()" t-as="ptav">
<li class="list-inline-item mb-3 js_attribute_value" style="margin: 0;">
<label class="col-form-label">
<div class="form-check">
<input type="radio"
t-attf-class="form-check-input js_variant_change #{ptal.attribute_id.create_variant}"
t-att-checked="ptav in combination"
t-att-name="'ptal-%s' % ptal.id"
t-att-value="ptav.id"
t-att-data-value_id="ptav.id"
t-att-data-value_name="ptav.name"
t-att-data-attribute_name="ptav.attribute_id.name"
t-att-data-is_custom="ptav.is_custom"
t-att-data-is_single="single"
t-att-data-is_single_and_custom="single_and_custom" />
<div class="radio_input_value form-check-label">
<span t-field="ptav.name"/>
<t t-call="sale.badge_extra_price"/>
</div>
</div>
</label>
</li>
</t>
</ul>
</t>
<t t-if="ptal.attribute_id.display_type == 'pills'">
<ul t-att-data-attribute_id="ptal.attribute_id.id"
t-attf-class="btn-group-toggle list-inline list-unstyled o_wsale_product_attribute #{'d-none' if single_and_custom else ''}"
data-bs-toggle="buttons">
<t t-foreach="ptal.product_template_value_ids._only_active()" t-as="ptav">
<li t-attf-class="o_variant_pills btn btn-primary mb-1 list-inline-item js_attribute_value #{'active' if ptav in combination else ''}">
<input type="radio"
t-attf-class="js_variant_change #{ptal.attribute_id.create_variant}"
t-att-checked="ptav in combination"
t-att-name="'ptal-%s' % ptal.id"
t-att-value="ptav.id"
t-att-data-value_id="ptav.id"
t-att-id="ptav.id"
t-att-data-value_name="ptav.name"
t-att-data-attribute_name="ptav.attribute_id.name"
t-att-data-is_custom="ptav.is_custom"
t-att-data-is_single_and_custom="single_and_custom"
t-att-autocomplete="off"/>
<label class="radio_input_value o_variant_pills_input_value"
t-att-for="ptav.id">
<span t-field="ptav.name"/>
<t t-call="sale.badge_extra_price"/>
</label>
</li>
</t>
</ul>
</t>
<t t-if="ptal.attribute_id.display_type == 'color'">
<ul t-att-data-attribute_id="ptal.attribute_id.id" t-attf-class="list-inline o_wsale_product_attribute #{'d-none' if single_and_custom else ''}">
<li t-foreach="ptal.product_template_value_ids._only_active()" t-as="ptav" class="list-inline-item me-1">
<label t-attf-style="background-color:#{ptav.html_color or ptav.product_attribute_value_id.name if not ptav.is_custom else ''}"
t-attf-class="css_attribute_color #{'active' if ptav in combination else ''} #{'custom_value' if ptav.is_custom else ''} #{'transparent' if (not ptav.is_custom and not ptav.html_color) else ''}">
<input type="radio"
t-attf-class="js_variant_change #{ptal.attribute_id.create_variant}"
t-att-checked="ptav in combination"
t-att-name="'ptal-%s' % ptal.id"
t-att-value="ptav.id"
t-att-title="ptav.name"
t-att-data-value_id="ptav.id"
t-att-data-value_name="ptav.name"
t-att-data-attribute_name="ptav.attribute_id.name"
t-att-data-is_custom="ptav.is_custom"
t-att-data-is_single="single"
t-att-data-is_single_and_custom="single_and_custom"/>
</label>
</li>
</ul>
</t>
</li>
</t>
</ul>
</template>
<template id="badge_extra_price" name="Badge Extra Price">
<t t-set="combination_info_variant" t-value="product._get_combination_info(ptav, pricelist=pricelist)"/>
<span class="badge rounded-pill text-bg-light border" t-if="combination_info_variant['price_extra']">
<!--
price_extra is displayed as catalog price instead of
price after pricelist because it is impossible to
compute. Indeed, the pricelist rule might depend on the
selected variant, so the price_extra will be different
depending on the selected combination. The price of an
attribute is therefore variable and it's not very
accurate to display it.
To cover some generic cases, the price_extra also
covers the price-included taxes in e-commerce flows.
(See the override of `_get_combination_info`)
-->
<span class="sign_badge_price_extra" t-out="combination_info_variant['price_extra'] > 0 and '+' or '-'"/>
<span t-out="abs(combination_info_variant['price_extra'])" class="variant_price_extra text-muted fst-italic" style="white-space: nowrap;"
t-options='{
"widget": "monetary",
"display_currency": (pricelist or product).currency_id
}'/>
</span>
</template>
</odoo>