Added Upstream Patch for crm

This commit is contained in:
az-flectra 2018-07-19 17:01:58 +05:30
parent b1faf35d76
commit 5e19179427
3 changed files with 11 additions and 1 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

@ -542,7 +542,8 @@ class Lead(models.Model):
for field in fields:
value = getattr(self, field.name, False)
if field.ttype == 'selection':
value = dict(field.get_values(self.env)).get(value, value)
selections = self.fields_get()[field.name]['selection']
value = next((v[1] for v in selections if v[0] == value), value)
elif field.ttype == 'many2one':
if value:
value = value.sudo().name_get()[0][1]