diff --git a/addons/account/models/product.py b/addons/account/models/product.py index b2b0026eea8..b72bc31d7bd 100644 --- a/addons/account/models/product.py +++ b/addons/account/models/product.py @@ -35,22 +35,6 @@ class ProductTemplate(models.Model): domain=[('deprecated', '=', False)], help="The expense is accounted for when a vendor bill is validated, except in anglo-saxon accounting with perpetual inventory valuation in which case the expense (Cost of Goods Sold account) is recognized at the customer invoice validation. If the field is empty, it uses the one defined in the product category.") - @api.multi - def write(self, vals): - #TODO: really? i don't see the reason we'd need that constraint.. - check = self.ids and 'uom_po_id' in vals - if check: - self._cr.execute("SELECT id, uom_po_id FROM product_template WHERE id IN %s", [tuple(self.ids)]) - uoms = dict(self._cr.fetchall()) - res = super(ProductTemplate, self).write(vals) - if check: - self._cr.execute("SELECT id, uom_po_id FROM product_template WHERE id IN %s", [tuple(self.ids)]) - if dict(self._cr.fetchall()) != uoms: - products = self.env['product.product'].search([('product_tmpl_id', 'in', self.ids)]) - if self.env['account.move.line'].search_count([('product_id', 'in', products.ids)]): - raise UserError(_('You can not change the unit of measure of a product that has been already used in an account journal item. If you need to change the unit of measure, you may deactivate this product.')) - return res - @api.multi def _get_product_accounts(self): return { diff --git a/addons/auth_signup/models/res_users.py b/addons/auth_signup/models/res_users.py index c91cf78a3fc..90b161662cc 100644 --- a/addons/auth_signup/models/res_users.py +++ b/addons/auth_signup/models/res_users.py @@ -155,5 +155,5 @@ class ResUsers(models.Model): sup = super(ResUsers, self) if not default or not default.get('email'): # avoid sending email to the user we are duplicating - sup = super(ResUsers, self.with_context(reset_password=False)) + sup = super(ResUsers, self.with_context(no_reset_password=True)) return sup.copy(default=default) diff --git a/addons/crm/__init__.py b/addons/crm/__init__.py index 4e9b019bd7a..3398a4b470d 100644 --- a/addons/crm/__init__.py +++ b/addons/crm/__init__.py @@ -5,3 +5,11 @@ from . import controllers from . import models from . import report from . import wizard + +from odoo 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}) diff --git a/addons/crm/__manifest__.py b/addons/crm/__manifest__.py index 8e1a36c89ea..7ac544a6c75 100644 --- a/addons/crm/__manifest__.py +++ b/addons/crm/__manifest__.py @@ -53,4 +53,5 @@ 'installable': True, 'application': True, 'auto_install': False, + 'uninstall_hook': 'uninstall_hook', } diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 53c1094f997..653a1a4e4ed 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -442,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'} } # ---------------------------------------- diff --git a/addons/crm/wizard/crm_lead_to_opportunity_views.xml b/addons/crm/wizard/crm_lead_to_opportunity_views.xml index 201f2957636..5b29d25b934 100644 --- a/addons/crm/wizard/crm_lead_to_opportunity_views.xml +++ b/addons/crm/wizard/crm_lead_to_opportunity_views.xml @@ -56,8 +56,7 @@ - - +