[IMP] various: improves usage of partners
SPECIFICATION Various change for the partner view: - Moved the activity widget to the bottom right of the kanban - Moved the informations badge to the bottom right next to the activity widget and made them clickable - Change the address options order and add a small help below - Change the 'Remove' button function from delete to remove from the company and add a delete button to the right end. - Correct some typo - Add an 'Archived' ribbon to the kanban card - Change various small things LINKS Task-2821356 closes odoo/odoo#89249 Related: odoo/enterprise#26442 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -56,6 +56,6 @@ class ResPartner(models.Model):
|
||||
if partners_not_geo_localized:
|
||||
self.env['bus.bus']._sendone(self.env.user.partner_id, 'simple_notification', {
|
||||
'title': _("Warning"),
|
||||
'message': _('No address found for %(partner_names)s.', partner_names=', '.join(partners_not_geo_localized.mapped('name')))
|
||||
'message': _('No match found for %(partner_names)s address(es).', partner_names=', '.join(partners_not_geo_localized.mapped('name')))
|
||||
})
|
||||
return True
|
||||
|
||||
@@ -11,21 +11,20 @@
|
||||
<group string="Geolocation">
|
||||
<label for="date_localization" string="Geo Location"/>
|
||||
<div>
|
||||
<span>Lat : </span>
|
||||
<field name="partner_latitude" nolabel="1" class="oe_inline"/>
|
||||
<span>Lat : <field name="partner_latitude" nolabel="1" class="oe_inline"/></span>
|
||||
<br/>
|
||||
<span>Long: </span>
|
||||
<field name="partner_longitude" nolabel="1" class="oe_inline"/>
|
||||
<span>Long: <field name="partner_longitude" nolabel="1" class="oe_inline"/></span>
|
||||
<br/>
|
||||
<span attrs="{'invisible': [('date_localization', '=', False)]}">Updated on: </span>
|
||||
<field name="date_localization" nolabel="1" class="oe_inline"/>
|
||||
<span class="oe_inline">
|
||||
<button
|
||||
string="(refresh)"
|
||||
name="geo_localize"
|
||||
class="btn btn-link"
|
||||
type="object"/>
|
||||
<span attrs="{'invisible': [('date_localization', '=', False)]}">Updated on:
|
||||
<field name="date_localization" nolabel="1" readonly="1" class="oe_inline"/>
|
||||
<br/>
|
||||
</span>
|
||||
<button attrs="{'invisible': ['|', ('partner_latitude', '!=', 0), ('partner_longitude', '!=', 0)]}"
|
||||
icon="fa-gear" string="Compute based on address" title="Compute Localization"
|
||||
name="geo_localize" type="object" class="btn btn-link p-0"/>
|
||||
<button attrs="{'invisible': [('partner_latitude', '=', 0), ('partner_longitude', '=', 0)]}"
|
||||
icon="fa-refresh" string="Refresh" title="Refresh Localization"
|
||||
name="geo_localize" type="object" class="btn btn-link p-0"/>
|
||||
</div>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -11,11 +11,14 @@
|
||||
<field name="mobile" position="after">
|
||||
<field name="meeting_count"/>
|
||||
</field>
|
||||
<xpath expr="//span[hasclass('oe_kanban_partner_links')]" position="inside">
|
||||
<span class="badge badge-pill" t-if="record.meeting_count.value>0">
|
||||
<i class="fa fa-fw fa-calendar" aria-label="Meetings" role="img" title="Meetings"/>
|
||||
<t t-esc="record.meeting_count.value"/>
|
||||
</span>
|
||||
<xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
|
||||
<a t-if="record.meeting_count.value>0" data-type="object" data-name="schedule_meeting"
|
||||
href="#" class="oe_kanban_action oe_kanban_action_a mr-1">
|
||||
<span class="badge badge-pill">
|
||||
<i class="fa fa-fw fa-calendar" aria-label="Meetings" role="img" title="Meetings"/>
|
||||
<t t-out="record.meeting_count.value"/>
|
||||
</span>
|
||||
</a>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -12,10 +12,16 @@
|
||||
<field name="mobile" position="after">
|
||||
<field name="opportunity_count"/>
|
||||
</field>
|
||||
<xpath expr="//span[hasclass('oe_kanban_partner_links')]" position="inside">
|
||||
<span class="badge badge-pill" t-if="record.opportunity_count.value>0">
|
||||
<i class="fa fa-fw fa-star" aria-label="Opportunities" role="img" title="Opportunities"/><t t-esc="record.opportunity_count.value"/>
|
||||
</span>
|
||||
<xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
|
||||
<a t-if="record.opportunity_count.value>0" href="#"
|
||||
data-type="object" data-name="action_view_opportunity"
|
||||
class="oe_kanban_action oe_kanban_action_a mr-1">
|
||||
<span class="badge badge-pill">
|
||||
<i class="fa fa-fw fa-star" aria-label="Opportunities"
|
||||
role="img" title="Opportunities"/>
|
||||
<t t-out="record.opportunity_count.value"/>
|
||||
</span>
|
||||
</a>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<field name="type" position="after">
|
||||
<field name="activity_state"/>
|
||||
</field>
|
||||
<xpath expr="//span[hasclass('oe_kanban_partner_links')]" position="after">
|
||||
<xpath expr="//div[hasclass('oe_kanban_bottom_right')]" position="inside">
|
||||
<field name="activity_ids" widget="kanban_activity"/>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Members">
|
||||
<field name="name"/>
|
||||
<field name="membership_state"/>
|
||||
<field name="membership_state" widget="badge" decoration-info="membership_state =='waiting'"
|
||||
decoration-success="membership_state in ['invoiced', 'free', 'paid']"/>
|
||||
<field name="associate_member"/>
|
||||
<field name="membership_start"/>
|
||||
<field name="membership_stop"/>
|
||||
@@ -92,7 +93,8 @@
|
||||
<field name="inherit_id" ref="base.view_partner_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="category_id" position="after">
|
||||
<field name="membership_state" optional="hide"/>
|
||||
<field name="membership_state" optional="hide" decoration-info="membership_state =='waiting'"
|
||||
decoration-success="membership_state in ['invoiced', 'free', 'paid']" widget="badge"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -32,8 +32,14 @@
|
||||
<field name="state_id" position="before">
|
||||
<field name="pos_order_count"/>
|
||||
</field>
|
||||
<xpath expr="//span[hasclass('oe_kanban_partner_links')]" position="inside">
|
||||
<span t-if="record.pos_order_count.value>0" class="badge badge-pill"><i class="fa fa-fw fa-shopping-bag" role="img" aria-label="Shopping cart" title="Shopping cart"/><t t-esc="record.pos_order_count.value"/></span>
|
||||
<xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
|
||||
<a t-if="record.pos_order_count.value>0" data-type="object" data-name="action_view_pos_order"
|
||||
href="#" class="oe_kanban_action oe_kanban_action_a mr-1">
|
||||
<span class="badge badge-pill">
|
||||
<i class="fa fa-fw fa-shopping-bag" role="img" aria-label="Shopping cart" title="Shopping cart"/>
|
||||
<t t-out="record.pos_order_count.value"/>
|
||||
</span>
|
||||
</a>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -511,6 +511,18 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="purchase_order_view_kanban_without_dashboard" model="ir.ui.view">
|
||||
<field name="name">purchase.order.view.kanban.without.dashboard</field>
|
||||
<field name="model">purchase.order</field>
|
||||
<field name="inherit_id" ref="purchase.view_purchase_order_kanban"/>
|
||||
<field name="priority">20</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//kanban" position="attributes">
|
||||
<attribute name="js_class"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="purchase_order_tree" model="ir.ui.view">
|
||||
<field name="name">purchase.order.tree</field>
|
||||
<field name="model">purchase.order</field>
|
||||
|
||||
@@ -24,7 +24,11 @@
|
||||
<record id="act_res_partner_2_purchase_order" model="ir.actions.act_window">
|
||||
<field name="name">RFQs and Purchases</field>
|
||||
<field name="res_model">purchase.order</field>
|
||||
<field name="view_mode">tree,form,graph</field>
|
||||
<field name="view_mode">tree,kanban,form,graph</field>
|
||||
<field name="view_ids" eval="[(5, 0, 0),
|
||||
(0, 0, {'view_mode': 'tree', 'view_id': ref('purchase.purchase_order_tree')}),
|
||||
(0, 0, {'view_mode': 'kanban', 'view_id': ref('purchase.purchase_order_view_kanban_without_dashboard')}),
|
||||
]"/>
|
||||
<field name="context">{'search_default_partner_id': active_id, 'default_partner_id': active_id}</field>
|
||||
<field name="groups_id" eval="[(4, ref('purchase.group_purchase_user'))]"/>
|
||||
<field name="help" type="html">
|
||||
@@ -48,8 +52,14 @@
|
||||
<field name="mobile" position="after">
|
||||
<field name="purchase_order_count"/>
|
||||
</field>
|
||||
<xpath expr="//span[hasclass('oe_kanban_partner_links')]" position="inside">
|
||||
<span t-if="record.purchase_order_count.value>0" class="badge badge-pill"><i class="fa fa-fw fa-credit-card" role="img" aria-label="Purchases" title="Purchases"/><t t-esc="record.purchase_order_count.value"/></span>
|
||||
<xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside">
|
||||
<a t-if="record.purchase_order_count.value>0" data-type="action" data-name="%(purchase.act_res_partner_2_purchase_order)d"
|
||||
href="#" class="oe_kanban_action oe_kanban_action_a mr-1">
|
||||
<span class="badge badge-pill">
|
||||
<i class="fa fa-fw fa-credit-card" role="img" aria-label="Purchases" title="Purchases"/>
|
||||
<t t-out="record.purchase_order_count.value"/>
|
||||
</span>
|
||||
</a>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<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,form,graph</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">
|
||||
@@ -26,11 +26,14 @@
|
||||
<field name="mobile" position="after">
|
||||
<field name="sale_order_count"/>
|
||||
</field>
|
||||
<xpath expr="//span[hasclass('oe_kanban_partner_links')]" position="inside">
|
||||
<span t-if="record.sale_order_count.value>0" class="badge badge-pill">
|
||||
<i class="fa fa-fw fa-usd" role="img" aria-label="Sale orders" title="Sales orders"/>
|
||||
<t t-esc="record.sale_order_count.value"/>
|
||||
</span>
|
||||
<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"
|
||||
href="#" class="oe_kanban_action oe_kanban_action_a mr-1">
|
||||
<span class="badge badge-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>
|
||||
|
||||
@@ -139,6 +139,7 @@ This module provides the core of the Odoo Web Client.
|
||||
'web/static/src/legacy/scss/form_view_extra.scss',
|
||||
'web/static/src/legacy/scss/list_view_extra.scss',
|
||||
'web/static/src/legacy/scss/profiling_qweb_view.scss',
|
||||
'base/static/src/scss/res_partner.scss',
|
||||
|
||||
'web/static/src/legacy/action_adapters.js',
|
||||
'web/static/src/legacy/debug_manager.js',
|
||||
|
||||
@@ -185,11 +185,15 @@ class Partner(models.Model):
|
||||
[('contact', 'Contact'),
|
||||
('invoice', 'Invoice Address'),
|
||||
('delivery', 'Delivery Address'),
|
||||
('private', 'Private Address'),
|
||||
('other', 'Other Address'),
|
||||
("private", "Private Address"),
|
||||
], string='Address Type',
|
||||
default='contact',
|
||||
help="Invoice & Delivery addresses are used in sales orders. Private addresses are only visible by authorized users.")
|
||||
help="- Contact: Use this to organize the contact details of employees of a given company (e.g. CEO, CFO, ...).\n"
|
||||
"- Invoice Address : Preferred address for all invoices. Selected by default when you invoice an order that belongs to this company.\n"
|
||||
"- Delivery Address : Preferred address for all deliveries. Selected by default when you deliver an order that belongs to this company.\n"
|
||||
"- Private: Private addresses are only visible by authorized users and contain sensitive data (employee home addresses, ...).\n"
|
||||
"- Other: Other address for the company (e.g. subsidiary, ...)")
|
||||
# address fields
|
||||
street = fields.Char()
|
||||
street2 = fields.Char()
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
.o_kanban_view.o_res_partner_kanban {
|
||||
|
||||
.ribbon {
|
||||
&::before, &::after {
|
||||
display: none;
|
||||
}
|
||||
|
||||
span {
|
||||
padding: 5px;
|
||||
font-size: x-small;
|
||||
z-index: unset;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
.ribbon-top-right {
|
||||
margin-top: -$o-kanban-dashboard-vpadding;
|
||||
|
||||
span {
|
||||
top: 15px;
|
||||
left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.oe_kanban_action_a:hover > .badge-pill {
|
||||
background-color: $o-brand-primary;
|
||||
color: white;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -218,7 +218,8 @@
|
||||
attrs="{'invisible': [('is_company', '=', True)]}"/>
|
||||
<field name="active_lang_count" invisible="1"/>
|
||||
<field name="lang" attrs="{'invisible': [('active_lang_count', '<=', 1)]}"/>
|
||||
<field name="category_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}" placeholder="Tags..."/>
|
||||
<field name="category_id" widget="many2many_tags" options="{'color_field': 'color', 'no_create_edit': True}"
|
||||
placeholder='e.g. "B2B", "VIP", "Consulting", ...'/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -279,6 +280,23 @@
|
||||
<sheet>
|
||||
<field name="type" required="1" widget="radio" options="{'horizontal': true}"/>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
<div class="text-muted oe_edit_only">
|
||||
<p class="mb-0" attrs="{'invisible': [('type', '!=', 'contact')]}">
|
||||
<span>Use this to organize the contact details of employees of a given company (e.g. CEO, CFO, ...).</span>
|
||||
</p>
|
||||
<p class="mb-0" attrs="{'invisible': [('type', '!=', 'invoice')]}">
|
||||
<span>Preferred address for all invoices. Selected by default when you invoice an order that belongs to this company.</span>
|
||||
</p>
|
||||
<p class="mb-0" attrs="{'invisible': [('type', '!=', 'delivery')]}">
|
||||
<span>Preferred address for all deliveries. Selected by default when you deliver an order that belongs to this company.</span>
|
||||
</p>
|
||||
<p class="mb-0" attrs="{'invisible': [('type', '!=', 'private')]}">
|
||||
<span>Private addresses are only visible by authorized users and contain sensitive data (employee home addresses, ...).</span>
|
||||
</p>
|
||||
<p class="mb-0" attrs="{'invisible': [('type', '!=', 'other')]}">
|
||||
<span>Other address for the company (e.g. subsidiary, ...)</span>
|
||||
</p>
|
||||
</div>
|
||||
<hr/>
|
||||
<group>
|
||||
<group>
|
||||
@@ -307,7 +325,7 @@
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<field name="comment" placeholder="Internal notes..."/>
|
||||
<field name="comment" placeholder="Internal notes..." nolabel="1"/>
|
||||
</group>
|
||||
<field name="lang" invisible="True"/>
|
||||
<field name="user_id" invisible="True"/>
|
||||
@@ -318,7 +336,7 @@
|
||||
<page name='sales_purchases' string="Sales & Purchase">
|
||||
<group name="container_row_2">
|
||||
<group string="Sales" name="sale" priority="1">
|
||||
<field name="user_id" domain="[('share', '=', False)]"/>
|
||||
<field name="user_id" widget="many2one_avatar_user" domain="[('share', '=', False)]"/>
|
||||
</group>
|
||||
<group string="Purchase" name="purchase" priority="2">
|
||||
</group>
|
||||
@@ -330,7 +348,7 @@
|
||||
</group>
|
||||
</page>
|
||||
<page name='internal_notes' string="Internal Notes">
|
||||
<field name="comment" placeholder="Internal note..."/>
|
||||
<field name="comment" placeholder="Internal notes..."/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
@@ -437,6 +455,7 @@
|
||||
<field name="category_id"/>
|
||||
<field name="avatar_128"/>
|
||||
<field name="type"/>
|
||||
<field name="active"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban">
|
||||
@@ -452,21 +471,27 @@
|
||||
<t t-else="">
|
||||
<div class="o_kanban_image_fill_left o_kanban_image_full" t-attf-style="background-image: url(#{kanban_image('res.partner', 'avatar_128', record.id.raw_value)})" role="img"/>
|
||||
</t>
|
||||
<div class="oe_kanban_details d-flex flex-column">
|
||||
<strong class="o_kanban_record_title oe_partner_heading"><field name="display_name"/></strong>
|
||||
<div class="o_kanban_tags_section oe_kanban_partner_categories"/>
|
||||
<ul>
|
||||
<li t-if="record.parent_id.raw_value and !record.function.raw_value"><field name="parent_id"/></li>
|
||||
<li t-if="!record.parent_id.raw_value and record.function.raw_value"><field name="function"/></li>
|
||||
<li t-if="record.parent_id.raw_value and record.function.raw_value"><field name="function"/> at <field name="parent_id"/></li>
|
||||
<li t-if="record.city.raw_value or record.country_id.raw_value">
|
||||
<t t-if="record.city.raw_value"><field name="city"/><t t-if="record.country_id.raw_value">, </t></t>
|
||||
<t t-if="record.country_id.raw_value"><field name="country_id"/></t>
|
||||
</li>
|
||||
<li t-if="record.email.raw_value" class="o_text_overflow"><field name="email"/></li>
|
||||
</ul>
|
||||
<div class="o_row">
|
||||
<span class="oe_kanban_partner_links"/>
|
||||
<div class="ribbon ribbon-top-right" attrs="{'invisible': [('active', '=', True)]}">
|
||||
<span class="bg-danger">Archived</span>
|
||||
</div>
|
||||
<div class="oe_kanban_details d-flex flex-column justify-content-between">
|
||||
<div>
|
||||
<strong class="o_kanban_record_title oe_partner_heading"><field name="display_name"/></strong>
|
||||
<div class="o_kanban_tags_section oe_kanban_partner_categories"/>
|
||||
<ul>
|
||||
<li t-if="record.parent_id.raw_value and !record.function.raw_value"><field name="parent_id"/></li>
|
||||
<li t-elif="!record.parent_id.raw_value and record.function.raw_value"><field name="function"/></li>
|
||||
<li t-elif="record.parent_id.raw_value and record.function.raw_value"><field name="function"/> at <field name="parent_id"/></li>
|
||||
<li t-if="record.city.raw_value or record.country_id.raw_value">
|
||||
<t t-if="record.city.raw_value"><field name="city"/><t t-if="record.country_id.raw_value">, </t></t>
|
||||
<t t-if="record.country_id.raw_value"><field name="country_id"/></t>
|
||||
</li>
|
||||
<li t-if="record.email.raw_value" class="o_text_overflow"><field name="email"/></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="o_kanban_record_bottom">
|
||||
<div class="oe_kanban_bottom_left"/>
|
||||
<div class="oe_kanban_bottom_right"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user