[ADD]: Added Upstream Patch for crm.

This commit is contained in:
Kunjal 2018-07-06 16:43:48 +05:30
parent 1e1d7f9f6d
commit 804235226e
6 changed files with 18 additions and 6 deletions

View File

@ -5,3 +5,11 @@ from . import controllers
from . import models
from . import report
from . import wizard
from flectra import api, SUPERUSER_ID
def uninstall_hook(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
teams = env['crm.team'].search([('dashboard_graph_model', '=', 'crm.opportunity.report')])
teams.update({'dashboard_graph_model': None})

View File

@ -58,4 +58,5 @@
'installable': True,
'application': True,
'auto_install': False,
'uninstall_hook': 'uninstall_hook',
}

View File

@ -236,6 +236,8 @@ class Lead(models.Model):
@api.model
def _onchange_user_values(self, user_id):
""" returns new values when user_id has changed """
if not user_id:
return {}
if user_id and self._context.get('team_id'):
team = self.env['crm.team'].browse(self._context['team_id'])
if user_id in team.member_ids.ids:
@ -440,7 +442,8 @@ class Lead(models.Model):
'res_id': self.id,
'views': [(form_view.id, 'form'),],
'type': 'ir.actions.act_window',
'target': 'inline'
'target': 'inline',
'context': {'default_type': 'opportunity'}
}
# ----------------------------------------

View File

@ -58,7 +58,7 @@ tour.register('crm_tour', {
}, {
trigger: ".o_opportunity_form .o_chatter_button_new_message",
content: _t('<p><b>Send messages</b> to your prospect and get replies automatically attached to this opportunity.</p><p class="mb0">Type <i>\'@\'</i> to mention people - it\'s like cc-ing on emails.</p>'),
position: "top"
position: "bottom"
}, {
trigger: ".breadcrumb li:not(.active):last",
extra_trigger: '.o_opportunity_form',

View File

@ -223,7 +223,7 @@ class MergePartnerAutomatic(models.TransientModel):
"""
_logger.debug('_update_values for dst_partner: %s for src_partners: %r', dst_partner.id, src_partners.ids)
model_fields = dst_partner._fields
model_fields = dst_partner.fields_get().keys()
def write_serializer(item):
if isinstance(item, models.BaseModel):
@ -232,7 +232,8 @@ class MergePartnerAutomatic(models.TransientModel):
return item
# get all fields that are not computed or x2many
values = dict()
for column, field in model_fields.items():
for column in model_fields:
field = dst_partner._fields[column]
if field.type not in ('many2many', 'one2many') and field.compute is None:
for item in itertools.chain(src_partners, [dst_partner]):
if item[column]:

View File

@ -56,8 +56,7 @@
<group string="Assign these opportunities to">
<field name="team_id"/>
<field name="user_ids" widget="many2many_tags" domain="[('share', '=', False)]"/>
<!-- Uncomment me in trunk -->
<!-- <field name="force_assignation" /> -->
<field name="force_assignation"/>
</group>
<label for="opportunity_ids" string="Leads with existing duplicates (for information)" help="Leads that you selected that have duplicates. If the list is empty, it means that no duplicates were found" attrs="{'invisible': [('deduplicate', '=', False)]}"/>
<group attrs="{'invisible': [('deduplicate', '=', False)]}">