[IMP] res_partner: form view cleaning + new function field website_private, inverse of website_published, more user-friendly to use on partner form view
This commit is contained in:
committed by
Thibault Delavallée
parent
8609306e88
commit
edd0ad1a64
@@ -8,9 +8,9 @@
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook[last()]" position="inside">
|
||||
<page string="Geo Localization" name="geo_localization">
|
||||
<page string="Geo Location" name="geo_location">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Geo Localization" colspan="2"/>
|
||||
<separator string="Geo Location" colspan="2"/>
|
||||
<button
|
||||
string="Geo Localize"
|
||||
name="geo_localize"
|
||||
|
||||
@@ -56,8 +56,6 @@ class res_partner(osv.osv):
|
||||
_columns = {
|
||||
'partner_weight': fields.integer('Grade Weight',
|
||||
help="Gives the probability to assign a lead to this partner. (0 means no assignation.)"),
|
||||
'opportunity_assigned_ids': fields.one2many('crm.lead', 'partner_assigned_id',\
|
||||
'Assigned Opportunities'),
|
||||
'grade_id': fields.many2one('res.partner.grade', 'Grade'),
|
||||
'activation' : fields.many2one('res.partner.activation', 'Activation', select=1),
|
||||
'date_partnership' : fields.date('Partnership Date'),
|
||||
|
||||
@@ -103,60 +103,25 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base_geolocalize.view_crm_partner_geo_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='geo_localization']" position="replace">
|
||||
<!-- <xpath expr="//notebook[last()]" position="inside"> -->
|
||||
<page string="Geo Localization" name="geo_localization">
|
||||
<xpath expr="//page[@name='geo_location']" position="inside">
|
||||
<group>
|
||||
<group>
|
||||
<group>
|
||||
<separator string="Partner Activation" colspan="2"/>
|
||||
<field name="grade_id" widget="selection"/>
|
||||
<field name="activation" widget="selection"/>
|
||||
<field name="partner_weight"/>
|
||||
</group>
|
||||
<group>
|
||||
<separator string="Partner Review" colspan="2"/>
|
||||
<field name="date_review"/>
|
||||
<field name="date_review_next"/>
|
||||
<field name="date_partnership"/>
|
||||
</group>
|
||||
<separator string="Partner Activation" colspan="2"/>
|
||||
<field name="grade_id" widget="selection"/>
|
||||
<field name="activation" widget="selection"/>
|
||||
<field name="partner_weight"/>
|
||||
<field name="assigned_partner_id"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Geo Localization" colspan="2"/>
|
||||
<button
|
||||
string="Geo Localize"
|
||||
name="geo_localize"
|
||||
colspan="2"
|
||||
icon="gtk-apply"
|
||||
type="object"/>
|
||||
<field name="partner_latitude"/>
|
||||
<field name="partner_longitude"/>
|
||||
<field name="date_localization"/>
|
||||
<group>
|
||||
<separator string="Partner Review" colspan="2"/>
|
||||
<field name="date_review"/>
|
||||
<field name="date_review_next"/>
|
||||
<field name="date_partnership"/>
|
||||
</group>
|
||||
<newline/>
|
||||
|
||||
<field name="opportunity_assigned_ids" colspan="4" nolabel="1">
|
||||
<tree string="Assigned Opportunities">
|
||||
<field name="create_date"/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="probability" invisible="1"/>
|
||||
<field name="stage_id"/>
|
||||
<field name="section_id"
|
||||
invisible="context.get('invisible_section', True)"
|
||||
groups="base.group_multi_salesteams"/>
|
||||
<field name="user_id" />
|
||||
<button string="Convert to Opportunity"
|
||||
name="convert_opportunity"
|
||||
type="object"
|
||||
icon="gtk-convert"
|
||||
attrs="{'invisible':[('type','=','opportunity')]}" />
|
||||
<button name="case_escalate" string="Escalate"
|
||||
type="object"
|
||||
icon="gtk-go-up"
|
||||
attrs="{'invisible':[('probability', '=', 100)]}" />
|
||||
</tree>
|
||||
</field>
|
||||
</page>
|
||||
<group>
|
||||
<button name="%(crm.relate_partner_opportunities)d" string="Assigned Opportunities" type="action" />
|
||||
</group>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -7,14 +7,12 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<notebook position="inside">
|
||||
<page string="Point of Sale">
|
||||
<group>
|
||||
<field name="ean13" />
|
||||
<button name="edit_ean" type="object" string="Edit" />
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
<group name="point_of_sale" position="replace">
|
||||
<group string="Point of Sale">
|
||||
<field name="ean13" />
|
||||
<button name="edit_ean" type="object" string="Edit" />
|
||||
</group>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Sales & Purchases" position="inside">
|
||||
<group>
|
||||
<page name="sales_purchases" position="inside">
|
||||
<group name="property_invoice_type" position="after">
|
||||
<group name="pricelists" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}">
|
||||
<field name="property_product_pricelist" groups="product.group_sale_pricelist"/>
|
||||
</group>
|
||||
|
||||
@@ -90,12 +90,13 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<page string="Sales & Purchases" position="inside">
|
||||
<group colspan="2" col="2" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}">
|
||||
<separator string="Invoicing" colspan="2"/>
|
||||
<field name="property_invoice_type"/>
|
||||
<group name="invoicing" position="replace">
|
||||
<group string="Invoicing">
|
||||
<group cols="2" colspan="2" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}">
|
||||
<field name="property_invoice_type"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="product.view_partner_property_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="pricelists" position="after">
|
||||
<group groups="stock.group_locations">
|
||||
<xpath expr="//group[@name='mailing']" position="after">
|
||||
<group groups="stock.group_locations" string="Warehouse">
|
||||
<field name="property_stock_customer" domain="[('usage','=','customer')]"/>
|
||||
<field name="property_stock_supplier" domain="[('usage','=','supplier')]"/>
|
||||
</group>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -6,3 +6,6 @@ class res_partner_grade(osv.osv):
|
||||
_columns = {
|
||||
'website_published': fields.boolean('Published On Website', copy=False),
|
||||
}
|
||||
_defaults = {
|
||||
'website_published': True,
|
||||
}
|
||||
|
||||
@@ -18,19 +18,5 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Update user prefrence form!-->
|
||||
<record id="view_users_form_simple_modif_forum" model="ir.ui.view">
|
||||
<field name="name">res.users.preferences.form</field>
|
||||
<field name="model">res.users</field>
|
||||
<field name="inherit_id" ref="base.view_users_form_simple_modif"/>
|
||||
<field name="arch" type="xml">
|
||||
<group name="preferences" position="before">
|
||||
<div style="margin-top: 19px;">
|
||||
<field name="website_published" class="pull-right" widget="website_button"/>
|
||||
</div>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -10,9 +10,21 @@ class WebsiteResPartner(osv.Model):
|
||||
def _get_ids(self, cr, uid, ids, flds, args, context=None):
|
||||
return {i: i for i in ids}
|
||||
|
||||
def _set_private(self, cr, uid, ids, field_name, value, arg, context=None):
|
||||
return self.write(cr, uid, ids, {'website_published': not value}, context=context)
|
||||
|
||||
def _get_private(self, cr, uid, ids, field_name, arg, context=None):
|
||||
return dict((rec.id, not rec.website_published) for rec in self.browse(cr, uid, ids, context=context))
|
||||
|
||||
def _search_private(self, cr, uid, obj, name, args, context=None):
|
||||
return [('website_published', '=', not args[0][2])]
|
||||
|
||||
_columns = {
|
||||
'website_published': fields.boolean(
|
||||
'Publish', help="Publish on the website", copy=False),
|
||||
'website_private': fields.function(
|
||||
_get_private, fnct_inv=_set_private, fnct_search=_search_private,
|
||||
type='boolean', string='Private Profile'),
|
||||
'website_description': fields.html(
|
||||
'Website Partner Full Description'
|
||||
),
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<field name="active" position="after">
|
||||
<field name="website_published"/>
|
||||
<field name="website_private"/>
|
||||
</field>
|
||||
</data>
|
||||
</field>
|
||||
|
||||
@@ -234,7 +234,7 @@ class res_partner(osv.Model, format_address):
|
||||
'title': fields.many2one('res.partner.title', 'Title'),
|
||||
'parent_id': fields.many2one('res.partner', 'Related Company', select=True),
|
||||
'child_ids': fields.one2many('res.partner', 'parent_id', 'Contacts', domain=[('active','=',True)]), # force "active_test" domain to bypass _search() override
|
||||
'ref': fields.char('Contact Reference', select=1),
|
||||
'ref': fields.char('Internal Reference', select=1),
|
||||
'lang': fields.selection(_lang_get, 'Language',
|
||||
help="If the selected language is loaded in the system, all documents related to this contact will be printed in this language. If not, it will be English."),
|
||||
'tz': fields.selection(_tz_get, 'Timezone', size=64,
|
||||
|
||||
@@ -311,12 +311,17 @@
|
||||
<group>
|
||||
<field name="ref"/>
|
||||
<field name="lang"/>
|
||||
<field name="date"/>
|
||||
</group>
|
||||
<group>
|
||||
</group>
|
||||
<group>
|
||||
<group string="Mailing" name="mailing">
|
||||
<field name="active"/>
|
||||
</group>
|
||||
</group>
|
||||
<group>
|
||||
<group name="invoicing"/>
|
||||
<group name="point_of_sale"/>
|
||||
</group>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
|
||||
Reference in New Issue
Block a user