diff --git a/addons/l10n_fr/migrations/9.0.1.1/post-migrate_tags_on_taxes.py b/addons/l10n_fr/migrations/9.0.1.1/post-migrate_tags_on_taxes.py new file mode 100644 index 00000000000..6f933404f1d --- /dev/null +++ b/addons/l10n_fr/migrations/9.0.1.1/post-migrate_tags_on_taxes.py @@ -0,0 +1,7 @@ +from openerp.modules.registry import RegistryManager + +def migrate(cr, version): + registry = RegistryManager.get(cr.dbname) + from openerp.addons.account.models.chart_template import migrate_tags_on_taxes + migrate_tags_on_taxes(cr, registry) + diff --git a/addons/l10n_fr/migrations/9.0.1.1/pre-set_tags_and_taxes_updatable.py b/addons/l10n_fr/migrations/9.0.1.1/pre-set_tags_and_taxes_updatable.py new file mode 100644 index 00000000000..586ae984b8c --- /dev/null +++ b/addons/l10n_fr/migrations/9.0.1.1/pre-set_tags_and_taxes_updatable.py @@ -0,0 +1,7 @@ +from openerp.modules.registry import RegistryManager + +def migrate(cr, version): + registry = RegistryManager.get(cr.dbname) + from openerp.addons.account.models.chart_template import migrate_set_tags_and_taxes_updatable + migrate_set_tags_and_taxes_updatable(cr, registry, 'l10n_fr') + diff --git a/addons/website_crm/models/crm_lead.py b/addons/website_crm/models/crm_lead.py index 54cfd76f361..03738cfb2b1 100644 --- a/addons/website_crm/models/crm_lead.py +++ b/addons/website_crm/models/crm_lead.py @@ -8,9 +8,21 @@ class Lead(models.Model): _inherit = 'crm.lead' def website_form_input_filter(self, request, values): + defaults = self.default_get(['medium_id', 'team_id']) values['medium_id'] = ( values.get('medium_id') or - self.default_get(['medium_id']).get('medium_id') or + defaults.get('medium_id') or self.sudo().env['ir.model.data'].xmlid_to_res_id('utm.utm_medium_website') ) + + values['team_id'] = values.get('team_id') or defaults.get('team_id') + + if not values['team_id']: + team_model = self.env['ir.model'].search([('model', '=', 'crm.team')]) + lead_model = self.env['ir.model'].search([('model', '=', 'crm.lead')]) + + values['team_id'] = self.env['mail.alias'].search([('alias_model_id', '=', lead_model.id), + ('alias_parent_model_id', '=', team_model.id), + ('alias_name', 'ilike', '%\web%')], limit=1).alias_parent_thread_id + return values