Added Upstream Patch for crm
This commit is contained in:
parent
b1faf35d76
commit
5e19179427
@ -5,3 +5,11 @@ from . import controllers
|
|||||||
from . import models
|
from . import models
|
||||||
from . import report
|
from . import report
|
||||||
from . import wizard
|
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})
|
||||||
|
@ -58,4 +58,5 @@
|
|||||||
'installable': True,
|
'installable': True,
|
||||||
'application': True,
|
'application': True,
|
||||||
'auto_install': False,
|
'auto_install': False,
|
||||||
|
'uninstall_hook': 'uninstall_hook',
|
||||||
}
|
}
|
||||||
|
@ -542,7 +542,8 @@ class Lead(models.Model):
|
|||||||
for field in fields:
|
for field in fields:
|
||||||
value = getattr(self, field.name, False)
|
value = getattr(self, field.name, False)
|
||||||
if field.ttype == 'selection':
|
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':
|
elif field.ttype == 'many2one':
|
||||||
if value:
|
if value:
|
||||||
value = value.sudo().name_get()[0][1]
|
value = value.sudo().name_get()[0][1]
|
||||||
|
Loading…
Reference in New Issue
Block a user