[MIG] website_crm : migration to new api

This commit is contained in:
Jérome Maes
2016-07-12 11:43:47 +02:00
parent 68b5cf0721
commit 53b65a51d2
8 changed files with 39 additions and 23 deletions
+3
View File
@@ -1,2 +1,5 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import controllers
import models
+9 -10
View File
@@ -1,15 +1,14 @@
# -*- coding: utf-8 -*-
from openerp import http
from openerp.http import request
from dateutil.relativedelta import relativedelta
from datetime import datetime, date, timedelta
from math import floor
import time
import operator
import babel
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.addons.website.controllers.backend import WebsiteBackend
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT
import babel
from datetime import datetime, timedelta
from odoo import http
from odoo.http import request
from odoo.addons.website.controllers.backend import WebsiteBackend
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT, DEFAULT_SERVER_DATE_FORMAT
class WebsiteCrmBackend(WebsiteBackend):
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<odoo>
<data>
<record id="crm.model_crm_lead" model="ir.model">
<record id="crm.model_crm_lead" model="ir.model">
<field name="website_form_default_field_id" ref="crm.field_crm_lead_description" />
<field name="website_form_access">True</field>
<field name="website_form_label">Create a lead</field>
@@ -36,4 +36,4 @@
<field name="use_opportunities" eval="False"/>
</record>
</data>
</openerp>
</odoo>
+3
View File
@@ -1 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import crm_lead
+5 -1
View File
@@ -1,4 +1,8 @@
from openerp import models, SUPERUSER_ID
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class Lead(models.Model):
_inherit = 'crm.lead'
+3
View File
@@ -1 +1,4 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import test_website_crm
+11 -5
View File
@@ -1,8 +1,14 @@
from openerp.api import Environment
import openerp.tests
@openerp.tests.common.at_install(False)
@openerp.tests.common.post_install(True)
class TestWebsiteCrm(openerp.tests.HttpCase):
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.api import Environment
import odoo.tests
@odoo.tests.common.at_install(False)
@odoo.tests.common.post_install(True)
class TestWebsiteCrm(odoo.tests.HttpCase):
def test_tour(self):
self.phantom_js("/", "odoo.__DEBUG__.services['web.Tour'].run('website_crm_tour', 'test')", "odoo.__DEBUG__.services['web.Tour'].tours.website_crm_tour")
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<template id="contactus_form" name="Contact Form" inherit_id="website.contactus" customize_show="True">
<xpath expr="//div[@name='mail_button']" position="replace">
<div>
@@ -97,5 +96,4 @@
</xpath>
</template>
</data>
</openerp>
</odoo>