[IMP] res_partner: form view cleaning
Better display of contacts, simplified contact creation, use default image for shipping and delivery, and various fixes and improvements in the form view. Main impacted addons : - account: add a bank_account_count field and stat button that replaces the 2many field - base_vat: remove the button to check vat, as there is already a constraint and removed and unused import - payment: add a payment_method_count field and stat button that replaces the 2many field
This commit is contained in:
committed by
Thibault Delavallée
parent
43839a8433
commit
6b55539dc7
@@ -6,8 +6,6 @@ from openerp.exceptions import UserError
|
||||
|
||||
from openerp import api, fields, models, _
|
||||
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
|
||||
from datetime import datetime, timedelta
|
||||
from openerp.tools.misc import formatLang
|
||||
|
||||
|
||||
class AccountFiscalPosition(models.Model):
|
||||
@@ -306,7 +304,7 @@ class ResPartner(models.Model):
|
||||
issued_total = 0
|
||||
for aml in self.env['account.move.line'].search(domain):
|
||||
issued_total += aml.amount_residual
|
||||
partner.issued_total = formatLang(self.env, issued_total, currency_obj=self.env.user.company_id.currency_id)
|
||||
partner.issued_total = issued_total
|
||||
|
||||
@api.one
|
||||
def _compute_has_unreconciled_entries(self):
|
||||
@@ -367,7 +365,7 @@ class ResPartner(models.Model):
|
||||
|
||||
contracts_count = fields.Integer(compute='_journal_item_count', string="Contracts", type='integer')
|
||||
journal_item_count = fields.Integer(compute='_journal_item_count', string="Journal Items", type="integer")
|
||||
issued_total = fields.Char(compute='_compute_issued_total', string="Journal Items")
|
||||
issued_total = fields.Monetary(compute='_compute_issued_total', string="Journal Items")
|
||||
property_account_payable_id = fields.Many2one('account.account', company_dependent=True,
|
||||
string="Account Payable", oldname="property_account_payable",
|
||||
domain="[('internal_type', '=', 'payable'), ('deprecated', '=', False)]",
|
||||
@@ -398,6 +396,14 @@ class ResPartner(models.Model):
|
||||
'or if you click the "Done" button.')
|
||||
invoice_ids = fields.One2many('account.invoice', 'partner_id', string='Invoices', readonly=True, copy=False)
|
||||
contract_ids = fields.One2many('account.analytic.account', 'partner_id', string='Contracts', readonly=True)
|
||||
bank_account_count = fields.Integer(compute='_compute_bank_count', string="Bank")
|
||||
|
||||
@api.multi
|
||||
def _compute_bank_count(self):
|
||||
bank_data = self.env['res.partner.bank'].read_group([('partner_id', 'in', self.ids)], ['partner_id'], ['partner_id'])
|
||||
mapped_data = dict([(bank['partner_id'][0], bank['partner_id_count']) for bank in bank_data])
|
||||
for partner in self:
|
||||
partner.bank_account_count = mapped_data.get(partner.id, 0)
|
||||
|
||||
def _find_accounting_partner(self, partner):
|
||||
''' Find the partner for which the accounting entries will be created '''
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
<field name="view_id" ref="analytic.view_account_analytic_account_tree"/>
|
||||
<field name="search_view_id" ref="analytic.view_account_analytic_account_search"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.ui.view" id="partner_view_buttons">
|
||||
<field name="name">partner.view.buttons</field>
|
||||
<field name="model">res.partner</field>
|
||||
@@ -93,6 +94,12 @@
|
||||
<span class="o_stat_value"><field name="total_invoiced"/></span>
|
||||
<span class="o_stat_text">Invoiced</span>
|
||||
</div>
|
||||
</button>
|
||||
<button class="oe_stat_button" type="action"
|
||||
name="%(base.action_res_partner_bank_account_form)d"
|
||||
icon="fa-university"
|
||||
context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}">
|
||||
<field string="Bank Accounts" name="bank_account_count" widget="statinfo"/>
|
||||
</button>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</div>
|
||||
@@ -143,33 +150,21 @@
|
||||
<group>
|
||||
<group string="Sale" name="acc_sale">
|
||||
<field name="property_payment_term_id" widget="selection"/>
|
||||
<field name="credit"/>
|
||||
<field name="credit_limit"/>
|
||||
<field name="credit" groups="base.group_no_one"/>
|
||||
</group>
|
||||
<group string="Purchase" name="acc_purchase">
|
||||
<field name="property_supplier_payment_term_id" widget="selection"/>
|
||||
<field name="debit"/>
|
||||
<field name="debit" groups="base.group_no_one"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
<group string="Fiscal Information" name="fiscal_information">
|
||||
<field name="property_account_position_id" widget="selection"/>
|
||||
</group>
|
||||
<group string="Accounting Entries" name="accounting_entries">
|
||||
<field name="property_account_receivable_id" groups="account.group_account_invoice" />
|
||||
<field name="property_account_payable_id" groups="account.group_account_invoice"/>
|
||||
<group string="Accounting Entries" name="accounting_entries" groups="account.group_account_manager">
|
||||
<field name="property_account_receivable_id"/>
|
||||
<field name="property_account_payable_id"/>
|
||||
</group>
|
||||
</group>
|
||||
<group string="Bank Accounts" name="bank_accounts">
|
||||
<field name="bank_ids" context="{'default_partner_id': active_id, 'form_view_ref': 'base.view_partner_bank_form'}" nolabel="1">
|
||||
<tree string="Bank Details">
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="sequence" invisible="1"/>
|
||||
<field name="acc_number"/>
|
||||
<field name="bank_name"/>
|
||||
<field name="owner_name"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Accounting" name="accounting_disabled" attrs="{'invisible': ['|',('is_company','=',True),('parent_id','=',False)]}">
|
||||
<div>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook[last()]" position="inside">
|
||||
<page string="Partner Assignation" name="geo_location">
|
||||
<!-- something to do here -->
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Geo Location" colspan="2"/>
|
||||
<button
|
||||
|
||||
@@ -14,10 +14,9 @@ except ImportError:
|
||||
"Install it to support more countries, for example with `easy_install vatnumber`.")
|
||||
vatnumber = None
|
||||
|
||||
from openerp.osv import fields, osv
|
||||
from openerp.osv import osv
|
||||
from openerp.tools.misc import ustr
|
||||
from openerp.tools.translate import _
|
||||
from openerp.exceptions import UserError
|
||||
|
||||
_ref_vat = {
|
||||
'at': 'ATU12345675',
|
||||
@@ -96,12 +95,6 @@ class res_partner(osv.osv):
|
||||
# country code or empty VAT number), so we fall back to the simple check.
|
||||
return self.simple_vat_check(cr, uid, country_code, vat_number, context=context)
|
||||
|
||||
def button_check_vat(self, cr, uid, ids, context=None):
|
||||
if not self.check_vat(cr, uid, ids, context=context):
|
||||
msg = self._construct_constraint_msg(cr, uid, ids, context=context)
|
||||
raise UserError(msg)
|
||||
return True
|
||||
|
||||
def check_vat(self, cr, uid, ids, context=None):
|
||||
user_company = self.pool.get('res.users').browse(cr, uid, uid).company_id
|
||||
if user_company.vat_check_vies:
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<label for="vat"/>
|
||||
<div name="vat_info" class="o_row">
|
||||
<field name="vat" placeholder="e.g. BE0477472701"/>
|
||||
<button name="button_check_vat" string="Check Validity" class="oe_link" type="object" icon="fa-cog"/>
|
||||
</div>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -82,9 +82,9 @@
|
||||
<field eval="18" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<field name="user_id" position="after">
|
||||
<field name="team_id" completion="1"/>
|
||||
</field>
|
||||
<!-- <field name="user_id" position="after">
|
||||
<field name="team_id" completion="1" invisible="1"/>
|
||||
</field> -->
|
||||
<div name="button_box" position="inside">
|
||||
<button class="oe_stat_button o_res_partner_tip_opp" type="action"
|
||||
attrs="{'invisible': [('customer', '=', False)]}"
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
</group>
|
||||
</xpath>
|
||||
<xpath expr="//group[@name='sale']" position="inside">
|
||||
<field name="assigned_partner_id"/>
|
||||
<field name="assigned_partner_id" groups="base.group_no_one"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<record id="view_partner_property_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.carrier.property.form.inherit</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="stock.view_partner_stock_form" />
|
||||
<field name="inherit_id" ref="mail.view_emails_partner_info_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_stock_supplier" position="after">
|
||||
<field name="opt_out" position="after">
|
||||
<field name="property_delivery_carrier"/>
|
||||
</field>
|
||||
</field>
|
||||
|
||||
@@ -14,7 +14,7 @@ class Partner(models.Model):
|
||||
notify_email = fields.Selection([
|
||||
('none', 'Never'),
|
||||
('always', 'All Messages')],
|
||||
'Receive Inbox Notifications by Email', required=True,
|
||||
'Email Messages and Notifications', required=True,
|
||||
oldname='notification_email_send', default='always',
|
||||
help="Policy to receive emails for new messages pushed to your personal Inbox:\n"
|
||||
"- Never: no emails are sent\n"
|
||||
|
||||
@@ -7,13 +7,9 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='container_row_2']" position="after">
|
||||
<group name="container_row_communication">
|
||||
<group string="Mailing" name="mailing">
|
||||
<field name='notify_email' widget="radio"/>
|
||||
<field name="opt_out"/>
|
||||
</group>
|
||||
</group>
|
||||
<xpath expr="//field[@name='user_id']" position="after">
|
||||
<field name='notify_email' widget="radio" groups="base.group_no_one"/>
|
||||
<field name="opt_out" string="Mailing Opt-Out" groups="base.group_no_one"/>
|
||||
</xpath>
|
||||
<xpath expr="//sheet" position="after">
|
||||
<div class="oe_chatter">
|
||||
|
||||
@@ -4,6 +4,17 @@ from openerp.osv import fields, osv
|
||||
class res_partner(osv.osv):
|
||||
_name = 'res.partner'
|
||||
_inherit = 'res.partner'
|
||||
|
||||
def _compute_payment_method_count(self, cr, uid, ids, field_names, arg, context=None):
|
||||
result = {}
|
||||
payment_data = self.pool['payment.method'].read_group(
|
||||
cr, uid, [('partner_id', 'in', ids)], ['partner_id'], ['partner_id'], context=context)
|
||||
mapped_data = dict([(payment['partner_id'][0], payment['partner_id_count']) for payment in payment_data])
|
||||
for partner in self.browse(cr, uid, ids, context=context):
|
||||
result[partner.id] = mapped_data.get(partner.id, 0)
|
||||
return result
|
||||
|
||||
_columns = {
|
||||
'payment_method_ids': fields.one2many('payment.method', 'partner_id', 'Payment Methods'),
|
||||
'payment_method_count': fields.function(_compute_payment_method_count, string='Count Payment Method', type="integer"),
|
||||
}
|
||||
|
||||
@@ -205,8 +205,7 @@
|
||||
sequence='20' />
|
||||
|
||||
<!-- Methods -->
|
||||
|
||||
<record model='ir.ui.view' id='payment_method_tree_view'>
|
||||
<record id='payment_method_view_tree' model='ir.ui.view'>
|
||||
<field name='name'>payment.method.tree</field>
|
||||
<field name='model'>payment.method</field>
|
||||
<field name='arch' type='xml'>
|
||||
@@ -220,7 +219,17 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record model='ir.actions.act_window' id='payment_method_act'>
|
||||
<record id='payment_method_view_search' model='ir.ui.view'>
|
||||
<field name='name'>payment.method.search</field>
|
||||
<field name='model'>payment.method</field>
|
||||
<field name='arch' type='xml'>
|
||||
<search string='Payment Methods'>
|
||||
<field name='partner_id'/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id='payment_method_action' model='ir.actions.act_window'>
|
||||
<field name='name'>Saved Payment Data</field>
|
||||
<field name='res_model'>payment.method</field>
|
||||
<field name='view_type'>form</field>
|
||||
@@ -228,9 +237,9 @@
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
action='payment_method_act'
|
||||
action='payment_method_action'
|
||||
id='payment_method_menu'
|
||||
parent='root_payment_menu' />
|
||||
parent='root_payment_menu'/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -8,16 +8,14 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr='//group[@name="purchase"]' position="after">
|
||||
<group string="Payment Methods" colspan="2">
|
||||
<field name="payment_method_ids" groups="base.group_sale_salesman" nolabel="1">
|
||||
<tree editable="bottom" create="false">
|
||||
<field name="name"/>
|
||||
<field name="acquirer_id" readonly="1"/>
|
||||
<field name="acquirer_ref" readonly="1"/>
|
||||
</tree>
|
||||
</field>
|
||||
</group>
|
||||
<xpath expr='//div[@name="button_box"]' position="inside">
|
||||
<button type="action" class="oe_stat_button"
|
||||
name="%(payment.payment_method_action)d"
|
||||
groups="base.group_sale_salesman"
|
||||
icon="fa-credit-card"
|
||||
context="{'search_default_partner_id': active_id}">
|
||||
<field name="payment_method_count" widget="statinfo" string="Payment Methods"/>
|
||||
</button>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -20,11 +20,14 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="point_of_sale.view_partner_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='point_of_sale']" position="after">
|
||||
<group name="loyalty" string="Loyalty Programs">
|
||||
<field name="loyalty_points" />
|
||||
</group>
|
||||
</xpath>
|
||||
<data>
|
||||
<xpath expr="//group[@name='point_of_sale']" position="attributes">
|
||||
<attribute name="string">Loyalty Program</attribute>
|
||||
</xpath>
|
||||
<field name="barcode" position="before">
|
||||
<field name="loyalty_points"/>
|
||||
</field>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -73,24 +73,14 @@
|
||||
</field>
|
||||
</record>
|
||||
<record id="res_partner_address_type" model="ir.ui.view">
|
||||
<field name="name">res.partner.view.address_type</field>
|
||||
<field name="name">res.partner.view.address_type</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//label[@for='type']" position="attributes">
|
||||
<xpath expr="//group/group/field[@name='type']" position="attributes">
|
||||
<attribute name="groups">sale.group_delivery_invoice_address</attribute>
|
||||
<attribute name="invisible">False</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//div[@name='div_type']" position="attributes">
|
||||
<attribute name="groups">sale.group_delivery_invoice_address</attribute>
|
||||
<attribute name="invisible">False</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='child_ids']//
|
||||
label[@for='type']" position="attributes">
|
||||
<attribute name="groups">sale.group_delivery_invoice_address</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='child_ids']//
|
||||
div[@name='contact_div_type']" position="attributes">
|
||||
<xpath expr="//field[@name='child_ids']//field[@name='type']" position="attributes">
|
||||
<attribute name="groups">sale.group_delivery_invoice_address</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="mail.view_emails_partner_info_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='container_row_communication']" position="after">
|
||||
<group name="container_row_stock">
|
||||
<group groups="stock.group_locations" string="Warehouse" name="warehouse">
|
||||
<xpath expr="//group[@name='container_row_2']" position="after">
|
||||
<group name="container_row_stock" groups="base.group_no_one">
|
||||
<group string="Warehouse" name="warehouse">
|
||||
<field name="property_stock_customer" domain="[('usage','=','customer')]"/>
|
||||
<field name="property_stock_supplier" domain="[('usage','=','supplier')]"/>
|
||||
</group>
|
||||
|
||||
@@ -7,10 +7,8 @@
|
||||
<field name="inherit_id" ref="website_partner.view_partners_form_website" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="//group[@name='mailing']" position="after">
|
||||
<group name="website" string="Website">
|
||||
<field name="tag_ids" widget="many2many_tags"/>
|
||||
</group>
|
||||
<xpath expr="//field[@name='company_id']" position="after">
|
||||
<field name="tag_ids" widget="many2many_tags" string="Website Tags"/>
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
|
||||
@@ -332,7 +332,7 @@ class res_partner(osv.Model, format_address):
|
||||
'company_id': _default_company,
|
||||
'color': 0,
|
||||
'is_company': False,
|
||||
'company': 'person',
|
||||
'company_type': 'person',
|
||||
'type': 'contact',
|
||||
'image': False,
|
||||
}
|
||||
|
||||
@@ -75,10 +75,7 @@
|
||||
<form string="Contact">
|
||||
<field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
<label for="name"/> (
|
||||
<field name="is_company" class="oe_inline"/> <label for="is_company" string="Is a Company?"/>)
|
||||
</div>
|
||||
<field name="company_type" options="{'horizontal': true}" class="oe_edit_only" widget="radio"/>
|
||||
<h1>
|
||||
<field name="name" default_focus="1" placeholder="Name" />
|
||||
</h1>
|
||||
@@ -99,22 +96,61 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Open partner address -->
|
||||
<record id="view_partner_address_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.form.address</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="priority" eval="20"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Partner">
|
||||
<field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium", "size": [90, 90]}' readonly="1"/>
|
||||
<div class="oe_title">
|
||||
<h1>
|
||||
<field name="name" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
<field name="parent_id" invisible="1"/>
|
||||
<group>
|
||||
<group>
|
||||
<label for="type" attrs="{'invisible': [('parent_id','=', False)]}" groups="base.group_no_one"/>
|
||||
<div attrs="{'invisible': [('parent_id','=', False)]}" name="div_type" groups="base.group_no_one">
|
||||
<field name="type" class="oe_inline"/>
|
||||
</div>
|
||||
<label for="street" string="Address"/>
|
||||
<div class="o_address_format">
|
||||
<field name="street" placeholder="Street..." class="o_address_street"/>
|
||||
<field name="street2" placeholder="Street 2..." class="o_address_street"/>
|
||||
<field name="city" placeholder="City" class="o_address_city"/>
|
||||
<field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True}' on_change="onchange_state(state_id)"/>
|
||||
<field name="zip" placeholder="ZIP" class="o_address_zip"/>
|
||||
<field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
|
||||
</div>
|
||||
<field name="website" widget="url" placeholder="e.g. www.odoo.com"/>
|
||||
</group>
|
||||
<group>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_partner_form" model="ir.ui.view">
|
||||
<field name="name">res.partner.form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field eval="1" name="priority"/>
|
||||
<field name="priority" eval="1"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Partners">
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box"/>
|
||||
<field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium", "size": [90, 90]}'/>
|
||||
<div class="oe_title">
|
||||
<div class="oe_edit_only">
|
||||
<label for="name"/>
|
||||
<field name="is_company" class="oe_inline"/><label for="is_company" string="Is a Company?"/>
|
||||
</div>
|
||||
<field name="is_company" invisible="1"/>
|
||||
<field name="company_type" widget="radio"
|
||||
class="oe_edit_only"
|
||||
on_change="on_change_company_type(company_type)"
|
||||
options="{'horizontal': true}"/>
|
||||
<h1>
|
||||
<field name="name" default_focus="1" placeholder="Name" />
|
||||
<field name="name" default_focus="1" placeholder="Name" required="1"/>
|
||||
</h1>
|
||||
<div class="o_row">
|
||||
<field name="parent_id"
|
||||
@@ -128,12 +164,7 @@
|
||||
|
||||
<group>
|
||||
<group>
|
||||
<label for="type" attrs="{'invisible': [('parent_id','=', False)]}" groups="base.group_no_one"/>
|
||||
<div attrs="{'invisible': [('parent_id','=', False)]}" name="div_type" groups="base.group_no_one">
|
||||
<field class="oe_inline"
|
||||
name="type"/>
|
||||
</div>
|
||||
|
||||
<field name="type" attrs="{'invisible': [('parent_id','=', False)]}" groups="base.group_no_one"/>
|
||||
<label for="street" string="Address"/>
|
||||
<div class="o_address_format">
|
||||
<div class="oe_edit_only">
|
||||
@@ -164,7 +195,9 @@
|
||||
<field name="fax"/>
|
||||
<field name="user_ids" invisible="1"/>
|
||||
<field name="email" widget="email" attrs="{'required': [('user_ids','!=', [])]}"/>
|
||||
<field name="title" options='{"no_open": True}'/>
|
||||
<field name="title" options='{"no_open": True}'
|
||||
attrs="{'invisible': [('is_company', '=', True)]}"/>
|
||||
<field name="lang"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
@@ -196,19 +229,27 @@
|
||||
<div t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '')" style="position: relative">
|
||||
<a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>
|
||||
<div class="oe_module_vignette">
|
||||
<a type="open" class="col-md-2">
|
||||
<t t-if="record.image.raw_value">
|
||||
<img t-att-src="'data:image/png;base64,'+record.image.raw_value" class="oe_avatar oe_kanban_avatar_smallbox"/>
|
||||
</t>
|
||||
<t t-if="!record.image.raw_value">
|
||||
<t t-if="record.is_company.raw_value === true">
|
||||
<img t-att-src='_s + "/base/static/src/img/company_image.png"' class="o_kanban_image oe_kanban_avatar_smallbox"/>
|
||||
<a type="open" class="col-md-2">
|
||||
<t t-if="record.image.raw_value">
|
||||
<img t-att-src="'data:image/png;base64,'+record.image.raw_value" class="oe_avatar oe_kanban_avatar_smallbox"/>
|
||||
</t>
|
||||
<t t-if="record.is_company.raw_value === false">
|
||||
<img t-att-src='_s + "/base/static/src/img/avatar.png"' class="o_kanban_image oe_kanban_avatar_smallbox"/>
|
||||
<t t-if="!record.image.raw_value">
|
||||
<t t-if="record.type.raw_value === 'delivery'">
|
||||
<img t-att-src='_s + "/base/static/src/img/truck.png"' class="o_kanban_image oe_kanban_avatar_smallbox"/>
|
||||
</t>
|
||||
<t t-if="record.type.raw_value === 'invoice'">
|
||||
<img t-att-src='_s + "/base/static/src/img/money.png"' class="o_kanban_image oe_kanban_avatar_smallbox"/>
|
||||
</t>
|
||||
<t t-if="record.type.raw_value != 'invoice' && record.type.raw_value != 'delivery'">
|
||||
<t t-if="record.is_company.raw_value === true">
|
||||
<img t-att-src='_s + "/base/static/src/img/company_image.png"' class="o_kanban_image oe_kanban_avatar_smallbox"/>
|
||||
</t>
|
||||
<t t-if="record.is_company.raw_value === false">
|
||||
<img t-att-src='_s + "/base/static/src/img/avatar.png"' class="o_kanban_image oe_kanban_avatar_smallbox"/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</a>
|
||||
</a>
|
||||
<div class="oe_module_desc">
|
||||
<div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_color_border">
|
||||
<h4><a type="open"><field name="name"/></a></h4>
|
||||
@@ -217,6 +258,16 @@
|
||||
<div><a t-if="record.email.raw_value" title="Mail" t-att-href="'mailto:'+record.email.value">
|
||||
<field name="email"/>
|
||||
</a></div>
|
||||
<div t-if="record.type.raw_value != 'contact'">
|
||||
<div>
|
||||
<field name="zip"/>
|
||||
<field name="city"/>
|
||||
</div>
|
||||
<div t-if="record.state_id.raw_value">
|
||||
<field name="state_id"/>
|
||||
</div>
|
||||
<field name="country_id"/>
|
||||
</div>
|
||||
<div t-if="record.phone.raw_value">Phone: <field name="phone"/></div>
|
||||
<div t-if="record.mobile.raw_value">Mobile: <field name="mobile"/></div>
|
||||
<div t-if="record.fax.raw_value">Fax: <field name="fax"/></div>
|
||||
@@ -227,39 +278,35 @@
|
||||
</t>
|
||||
</templates>
|
||||
</kanban>
|
||||
<form string="Contact">
|
||||
<form string="Contact / Address">
|
||||
<sheet>
|
||||
<field name="image" widget='image' class="oe_avatar oe_left" options='{"preview_image": "image_medium"}'/>
|
||||
<div class="oe_title">
|
||||
<label for="name" class="oe_edit_only"/>
|
||||
<h1><field name="name" style="width: 70%%"/></h1>
|
||||
<field name="category_id" widget="many2many_tags" placeholder="Tags..." style="width: 70%%"/>
|
||||
</div>
|
||||
<field name="type" required="1" widget="radio" options="{'horizontal': true}"/>
|
||||
<hr/>
|
||||
<group>
|
||||
<field name="function" placeholder="e.g. Sales Director"/>
|
||||
<field name="email"/>
|
||||
<field name="phone" widget="phone"/>
|
||||
<field name="mobile" widget="phone"/>
|
||||
<field name="title"/>
|
||||
</group>
|
||||
<div>
|
||||
</div>
|
||||
<group>
|
||||
<label for="type" groups="base.group_no_one"/>
|
||||
<div name="contact_div_type" groups="base.group_no_one">
|
||||
<field class="oe_inline" name="type"/>
|
||||
</div>
|
||||
<label for="street" string="Address"
|
||||
attrs="{'invisible': [('type', '=', 'contact'),('parent_id', '!=', False)]}"/>
|
||||
<div class="o_address_format" name="div_address"
|
||||
attrs="{'invisible': [(('type', '=', 'contact'),('parent_id', '!=', False))]}">
|
||||
<field name="street" placeholder="Street..." class="o_address_street"/>
|
||||
<field name="street2" placeholder="Street 2..." class="o_address_street"/>
|
||||
<field name="city" placeholder="City" class="o_address_city"/>
|
||||
<field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True}' on_change="onchange_state(state_id)"/>
|
||||
<field name="zip" placeholder="ZIP" class="o_address_zip"/>
|
||||
<field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
|
||||
</div>
|
||||
<group attrs="{'invisible': [('type','=', 'contact')]}">
|
||||
<label for="street" string="Address"/>
|
||||
<div>
|
||||
<div class="o_address_format" name="div_address">
|
||||
<field name="street" placeholder="Street..." class="o_address_street"/>
|
||||
<field name="street2" placeholder="Street 2..." class="o_address_street"/>
|
||||
<field name="city" placeholder="City" class="o_address_city"/>
|
||||
<field name="state_id" class="o_address_state" placeholder="State" options='{"no_open": True}' on_change="onchange_state(state_id)"/>
|
||||
<field name="zip" placeholder="ZIP" class="o_address_zip"/>
|
||||
<field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/>
|
||||
</div>
|
||||
</div>
|
||||
</group>
|
||||
<group>
|
||||
<field name="name" attrs="{'required': [('type','=', 'contact')]}" string="Contact Name"/>
|
||||
<field name="title" placeholder="e.g. Mr."
|
||||
attrs="{'invisible': [('type','<>', 'contact')]}"/>
|
||||
<field name="function" placeholder="e.g. Sales Director"
|
||||
attrs="{'invisible': [('type','<>', 'contact')]}"/>
|
||||
<field name="email"/>
|
||||
<field name="phone" widget="phone"/>
|
||||
<field name="mobile" widget="phone"/>
|
||||
<field name="comment" placeholder="internal note..."/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="supplier" invisible="True"/>
|
||||
<field name="customer" invisible="True"/>
|
||||
@@ -268,17 +315,16 @@
|
||||
</field>
|
||||
</page>
|
||||
<page name='internal_notes' string="Internal Notes">
|
||||
<field name="comment" placeholder="Put an internal note..."/>
|
||||
<field name="comment" placeholder="Internal note..."/>
|
||||
</page>
|
||||
<page name='sales_purchases' string="Sales & Purchases">
|
||||
<group name="container_row_1">
|
||||
<group>
|
||||
<field name="ref"/>
|
||||
<field name="lang"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
|
||||
<field name="active"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="container_row_2">
|
||||
@@ -291,10 +337,6 @@
|
||||
<field name="supplier"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="container_row_3">
|
||||
<group name="container_left"/>
|
||||
<group name="container_right"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
@@ -314,8 +356,8 @@
|
||||
<filter string="Persons" name="type_person" domain="[('is_company','=',0)]"/>
|
||||
<filter string="Companies" name="type_company" domain="[('is_company','=',1)]"/>
|
||||
<separator/>
|
||||
<filter string="Customers" name="customer" domain="[('customer','=',1)]" help="Customer Partners"/>
|
||||
<filter string="Vendors" name="supplier" domain="[('supplier','=',1)]" help="Supplier Partners"/>
|
||||
<filter string="Customers" name="customer" domain="[('customer','=',1), ('parent_id', '=', False)]"/>
|
||||
<filter string="Vendors" name="supplier" domain="[('supplier','=',1), ('parent_id', '=', False)]"/>
|
||||
<separator/>
|
||||
<field name="category_id" string="Tag" filter_domain="[('category_id','ilike', self)]"/>
|
||||
<field name="user_id"/>
|
||||
@@ -352,6 +394,7 @@
|
||||
<field name="state_id"/>
|
||||
<field name="category_id"/>
|
||||
<field name="image"/>
|
||||
<field name="type"/>
|
||||
<templates>
|
||||
<t t-name="kanban-box">
|
||||
<div class="o_kanban_two_column_tags oe_kanban_global_click o_res_partner_kanban">
|
||||
@@ -361,11 +404,19 @@
|
||||
<img t-att-src="kanban_image('res.partner', 'image_small', record.id.value)"/>
|
||||
</t>
|
||||
<t t-if="!record.image.raw_value">
|
||||
<t t-if="record.is_company.raw_value === true">
|
||||
<img t-att-src='_s + "/base/static/src/img/company_image.png"'/>
|
||||
<t t-if="record.type.raw_value === 'delivery'">
|
||||
<img t-att-src='_s + "/base/static/src/img/truck.png"' class="o_kanban_image oe_kanban_avatar_smallbox"/>
|
||||
</t>
|
||||
<t t-if="record.is_company.raw_value === false">
|
||||
<img t-att-src='_s + "/base/static/src/img/avatar.png"'/>
|
||||
<t t-if="record.type.raw_value === 'invoice'">
|
||||
<img t-att-src='_s + "/base/static/src/img/money.png"' class="o_kanban_image oe_kanban_avatar_smallbox"/>
|
||||
</t>
|
||||
<t t-if="record.type.raw_value != 'invoice' && record.type.raw_value != 'delivery'">
|
||||
<t t-if="record.is_company.raw_value === true">
|
||||
<img t-att-src='_s + "/base/static/src/img/company_image.png"'/>
|
||||
</t>
|
||||
<t t-if="record.is_company.raw_value === false">
|
||||
<img t-att-src='_s + "/base/static/src/img/avatar.png"'/>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Reference in New Issue
Block a user