├── .gitignore
├── crm_campaign_addons
├── __init__.py
├── security
│ └── ir.model.access.csv
├── __openerp__.py
├── crm.py
└── crm_view.xml
├── crm_campaign_blog
├── __init__.py
├── __openerp__.py
└── blog.py
├── crm_campaign_phase
├── __init__.py
├── security
│ └── ir.model.access.csv
├── __openerp__.py
├── crm_view.xml
└── crm.py
├── README.md
├── crm_campaign_product
├── __init__.py
├── security
│ └── ir.model.access.csv
├── __openerp__.py
├── product_view.xml
└── product.py
├── website_crm_campaign
├── __init__.py
├── __openerp__.py
├── i18n
│ └── sv.po
├── campaign_view.xml
├── campaign.py
└── static
│ └── src
│ └── css
│ └── sale_campaign.css
├── crm_campaign_supplier
├── __init__.py
├── __openerp__.py
└── res_partner.py
├── marketing_paolos
├── __init__.py
├── marketing_campaign_view.xml
├── marketing_campaign.py
└── __openerp__.py
└── crm_campaign_phase_default_variant
├── __init__.py
├── __openerp__.py
└── crm.py
/.gitignore:
--------------------------------------------------------------------------------
1 | **.py[cod]
2 |
--------------------------------------------------------------------------------
/crm_campaign_addons/__init__.py:
--------------------------------------------------------------------------------
1 | import crm
2 |
--------------------------------------------------------------------------------
/crm_campaign_blog/__init__.py:
--------------------------------------------------------------------------------
1 | import blog
2 |
--------------------------------------------------------------------------------
/crm_campaign_phase/__init__.py:
--------------------------------------------------------------------------------
1 | import crm
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # odoo-marketing
2 | Marketing addons
3 |
--------------------------------------------------------------------------------
/crm_campaign_product/__init__.py:
--------------------------------------------------------------------------------
1 | import product
2 |
--------------------------------------------------------------------------------
/website_crm_campaign/__init__.py:
--------------------------------------------------------------------------------
1 | import campaign
2 |
--------------------------------------------------------------------------------
/crm_campaign_supplier/__init__.py:
--------------------------------------------------------------------------------
1 | import res_partner
2 |
--------------------------------------------------------------------------------
/marketing_paolos/__init__.py:
--------------------------------------------------------------------------------
1 | import marketing_campaign
2 |
--------------------------------------------------------------------------------
/crm_campaign_phase_default_variant/__init__.py:
--------------------------------------------------------------------------------
1 | import crm
2 |
--------------------------------------------------------------------------------
/crm_campaign_product/security/ir.model.access.csv:
--------------------------------------------------------------------------------
1 | id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
2 | access_crm_campaign_product,crm.campaign.product,model_crm_campaign_product,,1,1,1,0
3 | access_crm_campaign_product_manager,crm.campaign.product.manager,model_crm_campaign_product,base.group_sale_manager,1,1,1,1
4 |
--------------------------------------------------------------------------------
/crm_campaign_phase/security/ir.model.access.csv:
--------------------------------------------------------------------------------
1 | id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
2 | access_crm_campaign_phase,crm.campaign.phase,model_crm_tracking_phase,,1,1,1,1
3 | access_crm_campaign_phase_type,crm.campaign.phase,model_crm_tracking_phase_type,,1,0,0,0
4 | access_crm_campaign_phase_type_manager,crm.campaign.phase.manager,model_crm_tracking_phase_type,,1,1,1,1
5 |
--------------------------------------------------------------------------------
/crm_campaign_addons/security/ir.model.access.csv:
--------------------------------------------------------------------------------
1 | id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
2 | access_crm_campaign_object,crm.campaign.object,model_crm_campaign_object,,1,1,1,0
3 | access_crm_campaign_object_manager,crm.campaign.object.manager,model_crm_campaign_object,base.group_sale_manager,1,1,1,1
4 | access_crm_tracking_campaign_public,crm_tracking_campaign public,model_crm_tracking_campaign,,1,0,0,0
5 |
--------------------------------------------------------------------------------
/marketing_paolos/marketing_campaign_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | marketing.campaign.form
6 | marketing.campaign
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/crm_campaign_blog/__openerp__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 |
22 | {
23 | 'name': 'CRM Campaign Blog',
24 | 'version': '0.2',
25 | 'category': 'crm',
26 | 'description': """
27 | Extends Crm Campaign with blog
28 |
29 | """,
30 | 'author': 'Vertel AB',
31 | 'license': 'AGPL-3',
32 | 'website': 'http://www.vertel.se',
33 | 'depends': ['crm_campaign_addons','website_blog'],
34 | 'data': [
35 | ],
36 | 'installable': True,
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/marketing_paolos/marketing_campaign.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2004-2016 Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 | from openerp import models, fields, api, _
22 |
23 | import logging
24 | _logger = logging.getLogger(__name__)
25 |
26 |
27 | class marketing_campaign(models.Model):
28 | _inherit = "marketing.campaign"
29 |
30 | cycle_id = fields.Many2one(comodel_name='sale.cycle', string='Sale cycle')
31 |
32 |
33 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
34 |
--------------------------------------------------------------------------------
/crm_campaign_supplier/__openerp__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 |
22 | {
23 | 'name': 'CRM Campaign Supplier',
24 | 'version': '0.2',
25 | 'category': 'crm',
26 | 'description': """
27 | Extends Crm Campaign with supplier
28 | ==================================
29 |
30 | """,
31 | 'author': 'Vertel AB',
32 | 'license': 'AGPL-3',
33 | 'website': 'http://www.vertel.se',
34 | 'depends': ['crm_campaign_product'],
35 | 'data': [
36 | ],
37 | 'installable': True,
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/crm_campaign_addons/__openerp__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 |
22 | {
23 | 'name': 'CRM Campaign',
24 | 'version': '0.2',
25 | 'category': 'crm',
26 | 'description': """
27 | Base class that bind together crm.tracking.campaign with different object
28 |
29 | """,
30 | 'author': 'Vertel AB',
31 | 'license': 'AGPL-3',
32 | 'website': 'http://www.vertel.se',
33 | 'depends': ['crm',],
34 | 'data': [
35 | 'crm_view.xml',
36 | 'security/ir.model.access.csv',
37 | ],
38 | 'installable': True,
39 | }
40 |
41 |
--------------------------------------------------------------------------------
/crm_campaign_product/__openerp__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 |
22 | {
23 | 'name': 'CRM Campaign Product',
24 | 'version': '0.2',
25 | 'category': 'crm',
26 | 'description': """
27 | Extends Crm Campaign with products
28 |
29 | """,
30 | 'author': 'Vertel AB',
31 | 'license': 'AGPL-3',
32 | 'website': 'http://www.vertel.se',
33 | 'depends': ['crm_campaign_addons','stock'],
34 | 'data': [
35 | 'product_view.xml',
36 | 'security/ir.model.access.csv',
37 |
38 | ],
39 | 'installable': True,
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/crm_campaign_phase/__openerp__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 |
22 | {
23 | 'name': 'CRM Campaign Phase',
24 | 'version': '0.1',
25 | 'category': 'crm',
26 | 'description': """
27 | Extends Crm Campaign with phases
28 |
29 | """,
30 | 'author': 'Vertel AB',
31 | 'license': 'AGPL-3',
32 | 'website': 'http://www.vertel.se',
33 | 'depends': ['website_crm_campaign','product_private'],
34 | 'sequence': 50,
35 | 'data': [
36 | 'crm_view.xml',
37 | 'security/ir.model.access.csv',
38 |
39 | ],
40 | 'installable': True,
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/crm_campaign_phase_default_variant/__openerp__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 |
22 | {
23 | 'name': 'CRM Campaign Phase Default Variant',
24 | 'version': '0.1',
25 | 'category': 'crm',
26 | 'description': """
27 | Extends Crm Campaign with phases and new calucalatopn of default variant
28 |
29 | """,
30 | 'author': 'Vertel AB',
31 | 'license': 'AGPL-3',
32 | 'website': 'http://www.vertel.se',
33 | 'depends': ['crm_campaign_phase','website_sale_product_variant'],
34 | 'sequence': 50,
35 | 'data': [
36 | ],
37 | 'installable': True,
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/marketing_paolos/__openerp__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2004-2016 Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 |
22 | {
23 | 'name': 'Marketing Paolos',
24 | 'version': '0.1',
25 | 'category': 'marketing',
26 | 'summary': 'Marketing additions for Paolos',
27 | 'licence': 'AGPL-3',
28 | 'description': """
29 | """,
30 | 'author': 'Vertel AB',
31 | 'website': 'http://www.vertel.se',
32 | 'depends': ['marketing_campaign','sales_cycle'],
33 | 'data': ['marketing_campaign_view.xml'],
34 | 'application': False,
35 | 'installable': True,
36 | 'auto_install': False,
37 | }
38 | # vim:expandtab:smartindent:tabstop=4s:softtabstop=4:shiftwidth=4:
39 |
--------------------------------------------------------------------------------
/crm_campaign_phase_default_variant/crm.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 | from openerp import models, fields, api, _
22 | from datetime import datetime, timedelta
23 | import logging
24 | _logger = logging.getLogger(__name__)
25 |
26 | class product_template(models.Model):
27 | _inherit = "product.template"
28 | @api.multi
29 | def get_default_variant(self):
30 | self.ensure_one()
31 | intersect = self.product_variant_ids & self.get_campaign_variants(for_reseller=self.env.user.partner_id.commercial_partner_id.property_product_pricelist.for_reseller)
32 | if len(intersect)>0:
33 | return intersect[0]
34 | else:
35 | return super(product_template,self).get_default_variant()
36 |
--------------------------------------------------------------------------------
/website_crm_campaign/__openerp__.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 |
22 | {
23 | 'name': 'Sale Campaign',
24 | 'version': '0.1',
25 | 'category': 'crm',
26 | 'description': """
27 | Different pricelists on campaign
28 | ================================
29 | * Hook product.template with crm.tracking.campaign
30 | * Start and stop date on a campaign
31 | * Show current campaign as first page on website
32 |
33 | crm_campaign
34 | crm.tracking.campaign
35 | crm.tracking.campaign.object (title,description,image)
36 | start/stop-date
37 | pricelists
38 | campaign_objects
39 | get_campaign_objs
40 | crm_campaign_product
41 | get_campaign_products
42 | crm_campaign_blog
43 | website_crm_campaign
44 |
45 | """,
46 | 'author': 'Vertel AB',
47 | 'license': 'AGPL-3',
48 | 'website': 'http://www.vertel.se',
49 | 'depends': ['website_sale', 'sale_crm', 'crm_campaign_product'],
50 | 'data': [
51 | 'campaign_view.xml',
52 | ],
53 | 'installable': True,
54 | }
55 |
56 |
--------------------------------------------------------------------------------
/crm_campaign_blog/blog.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 | from openerp import models, fields, api, _
22 | import re
23 | import logging
24 | _logger = logging.getLogger(__name__)
25 |
26 |
27 | class crm_campaign_object(models.Model):
28 | _inherit = 'crm.campaign.object'
29 |
30 | object_id = fields.Reference(selection_add=[('blog.post', 'BLog Post')])
31 | @api.one
32 | @api.onchange('object_id')
33 | def get_object_value(self):
34 | if self.object_id:
35 | if self.object_id._name == 'blog.post':
36 | self.res_id = self.object_id.id
37 | self.name = self.object_id.name
38 | self.description = self.object_id.subtitle
39 | try:
40 | self.image = self.env['ir.attachment'].browse(int(re.search('ir.attachment/(.+?)_', self.object_id.background_image).group(1))).datas
41 | #~ self.image = self.env['ir.attachment'].search([('res_model', '=', self._name), ('res_id', '=', self.id)]).datas
42 | except AttributeError:
43 | self.image = None
44 | return super(crm_campaign_object, self).get_object_value()
45 |
--------------------------------------------------------------------------------
/website_crm_campaign/i18n/sv.po:
--------------------------------------------------------------------------------
1 | # Translation of Odoo Server.
2 | # This file contains the translation of the following modules:
3 | # * website_crm_campaign
4 | #
5 | msgid ""
6 | msgstr ""
7 | "Project-Id-Version: Odoo Server 8.0-20170423\n"
8 | "Report-Msgid-Bugs-To: \n"
9 | "POT-Creation-Date: 2017-04-27 17:46+0000\n"
10 | "PO-Revision-Date: 2017-04-27 19:49+0200\n"
11 | "Last-Translator: <>\n"
12 | "Language-Team: \n"
13 | "MIME-Version: 1.0\n"
14 | "Content-Type: text/plain; charset=UTF-8\n"
15 | "Content-Transfer-Encoding: 8bit\n"
16 | "Plural-Forms: \n"
17 | "Language: sv\n"
18 | "X-Generator: Poedit 2.0.1\n"
19 |
20 | #. module: website_crm_campaign
21 | #: field:crm.tracking.campaign,website_published:0
22 | msgid "Available in the website"
23 | msgstr "Tillgänglig på webbplatsen"
24 |
25 | #. module: website_crm_campaign
26 | #: model:ir.model,name:website_crm_campaign.model_crm_tracking_campaign
27 | msgid "Campaign"
28 | msgstr "Kampanj"
29 |
30 | #. module: website_crm_campaign
31 | #: field:product.public.category,description:0
32 | msgid "Description"
33 | msgstr "Beskrivning"
34 |
35 | #. module: website_crm_campaign
36 | #: view:website:website_sale.products_item
37 | msgid "In stock"
38 | msgstr "I lager"
39 |
40 | #. module: website_crm_campaign
41 | #: field:product.public.category,mobile_icon:0
42 | msgid "Mobile Icon"
43 | msgstr "Mobil ikon"
44 |
45 | #. module: website_crm_campaign
46 | #: view:website:website_sale.products_item
47 | msgid "Not in stock"
48 | msgstr "Ej i lager"
49 |
50 | #. module: website_crm_campaign
51 | #: model:ir.model,name:website_crm_campaign.model_product_public_category
52 | msgid "Public Category"
53 | msgstr "Publik kategori"
54 |
55 | #. module: website_crm_campaign
56 | #: help:product.public.category,mobile_icon:0
57 | msgid "This icon will display on smaller devices"
58 | msgstr "Den här ikonen visas på mindre enheter"
59 |
60 | #. module: website_crm_campaign
61 | #: field:crm.tracking.campaign,website_description:0
62 | msgid "Website Description"
63 | msgstr "Webbplats beskrivning"
64 |
65 | #. module: website_crm_campaign
66 | #: field:crm.tracking.campaign,website_url:0
67 | msgid "Website url"
68 | msgstr "Webbplats url"
69 |
--------------------------------------------------------------------------------
/crm_campaign_phase/crm_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | phase_type_form
6 | crm.tracking.phase.type
7 |
8 |
25 |
26 |
27 |
28 | crm.tracking.campaign.form.inherited.crm_campaign_product
29 | crm.tracking.campaign
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/crm_campaign_supplier/res_partner.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 | from openerp import models, fields, api, _
22 | import logging
23 | _logger = logging.getLogger(__name__)
24 |
25 |
26 | class crm_campaign_object(models.Model):
27 | _inherit = 'crm.campaign.object'
28 |
29 | object_id = fields.Reference(selection_add=[('res.partner', 'Supplier')])
30 | @api.one
31 | @api.onchange('object_id')
32 | def get_object_value(self):
33 | if self.object_id and self.object_id._name == 'res.partner':
34 | self.name = self.object_id.name
35 | self.description = self.object_id.comment
36 | self.image = self.object_id.image
37 | return super(crm_campaign_object, self).get_object_value()
38 |
39 |
40 | @api.one
41 | def create_campaign_product(self,campaign):
42 | if self.object_id._name == 'res.partner':
43 | for product in self.env['product.template'].search([('seller_ids.name', '=', self.object_id.id)]):
44 | self.env['crm.campaign.product'].create({
45 | 'campaign_id': campaign.id,
46 | 'product_id': product.id,
47 | 'sequence': len(campaign.product_ids) + 1,
48 | })
49 | else:
50 | super(crm_campaign_object, self).create_campaign_product(campaign)
51 |
--------------------------------------------------------------------------------
/crm_campaign_product/product_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | product.template.common.form.inherited.crm_campaign_product
7 | product.product
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | crm.tracking.campaign.form.inherited.crm_campaign_product
20 | crm.tracking.campaign
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/website_crm_campaign/campaign_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | crm.tracking.campaign.form.inherited.sale_campaign
6 | crm.tracking.campaign
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | In stock
29 | Not in stock
30 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/website_crm_campaign/campaign.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 | from openerp import models, fields, api, _
22 | from openerp import http
23 | from openerp.http import request
24 | import werkzeug
25 | from openerp.addons.website.controllers.main import Website
26 | import datetime
27 | import logging
28 | _logger = logging.getLogger(__name__)
29 |
30 | class crm_tracking_campaign(models.Model):
31 | _inherit = 'crm.tracking.campaign'
32 |
33 | website_description = fields.Html(string='Website Description')
34 | website_published = fields.Boolean(string='Available in the website', default=False, copy=False)
35 | website_url = fields.Char(string='Website url', compute='_website_url')
36 |
37 | @api.one
38 | def _website_url(self):
39 | self.website_url = '/campaign/%s' %self.id
40 |
41 | @api.multi
42 | def get_campaigns(self):
43 | return super(crm_tracking_campaign, self).get_campaigns().filtered(lambda c: c.website_published)
44 |
45 |
46 | class crm_campaign_object(models.Model):
47 | _inherit = 'crm.campaign.object'
48 |
49 | object_id = fields.Reference(selection_add=[('product.public.category', 'Product Category')])
50 | @api.one
51 | @api.onchange('object_id')
52 | def get_object_value(self):
53 | if self.object_id:
54 | if self.object_id._name == 'product.public.category':
55 | self.res_id = self.object_id.id
56 | self.name = self.object_id.name
57 | self.description = self.object_id.description
58 | self.image = self.object_id.image
59 | return super(crm_campaign_object, self).get_object_value()
60 |
61 | class product_public_category(models.Model):
62 | _inherit = 'product.public.category'
63 |
64 | description = fields.Text(string='Description')
65 | mobile_icon = fields.Char(string='Mobile Icon', help='This icon will display on smaller devices')
66 |
67 | class sale_order(models.Model):
68 | _inherit = 'sale.order'
69 |
70 | @api.model
71 | def create(self, vals):
72 | campaign = self.env['crm.tracking.campaign'].get_campaigns()
73 | if len(campaign):
74 | if not vals.get('campaign_id'):
75 | vals['campaign_id'] = campaign[0].id
76 | return super(sale_order, self).create(vals)
77 |
78 |
--------------------------------------------------------------------------------
/crm_campaign_addons/crm.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 | from openerp import models, fields, api, _
22 | from openerp.http import request
23 | import logging
24 | _logger = logging.getLogger(__name__)
25 |
26 | class crm_tracking_campaign(models.Model):
27 | _name = 'crm.tracking.campaign'
28 | _inherit = ['crm.tracking.campaign','mail.thread']
29 |
30 | color = fields.Integer('Color Index')
31 | date_start = fields.Date(string='Start Date',track_visibility='onchange', )
32 | date_stop = fields.Date(string='Start Stop',track_visibility='onchange', )
33 | image = fields.Binary(string='Image')
34 |
35 | object_ids = fields.One2many(comodel_name='crm.campaign.object', inverse_name='campaign_id', string='Objects')
36 | @api.one
37 | def _object_names(self):
38 | self.object_names = ', '.join(self.object_ids.mapped('name'))
39 | object_names = fields.Char(compute='_object_names')
40 | @api.one
41 | def _object_count(self):
42 | self.object_count = len(self.object_ids)
43 | object_count = fields.Integer(compute='_object_count')
44 |
45 | @api.model
46 | def get_campaigns(self):
47 | return self.env['crm.tracking.campaign'].search([
48 | ('date_start', '<',fields.Date.today()),
49 | ('date_stop', '>', fields.Date.today())])
50 |
51 |
52 | state = fields.Selection([
53 | ('draft','Draft'),
54 | ('open','Open'),
55 | ('closed','Closed'),
56 | ('cancel','Cancelled'),
57 | ], string='Status', index=True, readonly=False, default='draft',
58 | track_visibility='onchange', copy=False,
59 | help=" * The 'Draft' status is used during planning.\n"
60 | " * The 'Open' status is used when the campaing are running.\n"
61 | " * The 'Closed' status is when the campaing is over.\n"
62 | " * The 'Cancelled' status is used when the campaign is stopped.")
63 |
64 | class crm_campaign_object(models.Model):
65 | _name = 'crm.campaign.object'
66 |
67 | _order = 'campaign_id, sequence, name'
68 |
69 | name = fields.Char(string='Name')
70 | description = fields.Text(string='Description', translate=True)
71 | image = fields.Binary(string='Image')
72 | sequence = fields.Integer()
73 | color = fields.Integer('Color Index')
74 | campaign_id = fields.Many2one(comodel_name='crm.tracking.campaign', string='Campaign')
75 | object_id = fields.Reference(selection=[], string='Object')
76 |
77 | @api.onchange('object_id')
78 | def get_object_value(self):
79 | pass
80 |
81 | @api.one
82 | def create_campaign_product(self,campaign):
83 | pass
84 |
85 |
86 | class CampaignOverview(models.TransientModel):
87 | _name = 'campaign.overview'
88 |
89 | date = fields.Date(string='Date', required=True)
90 |
91 | @api.multi
92 | def overview(self):
93 | return {
94 | 'type': 'ir.actions.act_url',
95 | 'url': '/?campaign_date=%s' %self.date,
96 | 'target': 'new',
97 | 'res_id': self.id,
98 | }
99 |
100 |
101 |
--------------------------------------------------------------------------------
/crm_campaign_product/product.py:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | ##############################################################################
3 | #
4 | # OpenERP, Open Source Management Solution, third party addon
5 | # Copyright (C) 2017- Vertel AB ().
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU Affero General Public License as
9 | # published by the Free Software Foundation, either version 3 of the
10 | # License, or (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU Affero General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU Affero General Public License
18 | # along with this program. If not, see .
19 | #
20 | ##############################################################################
21 | from openerp import models, fields, api, _
22 | import logging
23 | _logger = logging.getLogger(__name__)
24 |
25 |
26 | class crm_campaign_product(models.Model):
27 | _name = 'crm.campaign.product'
28 | _order = 'sequence'
29 |
30 | sequence = fields.Integer()
31 | campaign_id = fields.Many2one(comodel_name="crm.tracking.campaign")
32 | product_id = fields.Many2one(comodel_name="product.product")
33 | name = fields.Char(related='product_id.name')
34 | default_code = fields.Char(related='product_id.default_code')
35 | type = fields.Selection(related='product_id.type')
36 | list_price = fields.Float(related='product_id.list_price')
37 | qty_available = fields.Float(related='product_id.qty_available')
38 | virtual_available = fields.Float(related='product_id.virtual_available')
39 |
40 | class crm_tracking_campaign(models.Model):
41 | _inherit = 'crm.tracking.campaign'
42 |
43 | product_ids = fields.Many2many(comodel_name='product.product', relation="crm_campaign_product", column1='campaign_id',column2='product_id', string='Products')
44 | campaign_product_ids = fields.One2many(comodel_name='crm.campaign.product', inverse_name='campaign_id', string='Products')
45 |
46 | @api.one
47 | def update_campaign_product_ids(self):
48 | self.env['crm.campaign.product'].search([('campaign_id', '=', self.id)]).unlink()
49 | for o in self.object_ids.sorted(lambda o: o.sequence):
50 | _logger.error(getattr(o,'create_campaign_product', False))
51 | if getattr(o,'create_campaign_product', False):
52 | o.create_campaign_product(self)
53 |
54 | class product_template(models.Model):
55 | _inherit = 'product.template'
56 | campaign_ids = fields.Many2many(comodel_name='crm.tracking.campaign', relation="crm_campaign_product", column1='product_id', column2='campaign_id',string='Campaigns')
57 |
58 | class product_product(models.Model):
59 | _inherit = 'product.product'
60 | campaign_ids = fields.Many2many(comodel_name='crm.tracking.campaign', relation="crm_campaign_product", column1='product_id', column2='campaign_id',string='Campaigns')
61 |
62 | class crm_campaign_object(models.Model):
63 | _inherit = 'crm.campaign.object'
64 |
65 | object_id = fields.Reference(selection_add=[('product.template', 'Product Template'), ('product.product', 'Product Variant'), ('product.public.category', 'Product Category')])
66 |
67 | @api.one
68 | @api.onchange('object_id')
69 | def get_object_value(self):
70 | if self.object_id:
71 | if self.object_id._name == 'product.template' or self.object_id._name == 'product.product':
72 | self.res_id = self.object_id.id
73 | self.name = self.object_id.name
74 | self.description = self.object_id.description_sale
75 | self.image = self.object_id.image
76 | return super(crm_campaign_object, self).get_object_value()
77 |
78 | def create_campaign_variant(self, campaign, variant):
79 | self.env['crm.campaign.product'].create({
80 | 'campaign_id': campaign.id,
81 | 'product_id': variant.id,
82 | 'sequence': len(campaign.product_ids) + 1,
83 | })
84 |
85 | @api.one
86 | def create_campaign_product(self, campaign):
87 | if self.object_id._name == 'product.product':
88 | self.create_campaign_variant(campaign, self.object_id)
89 |
90 | elif self.object_id._name == 'product.template':
91 | for product in self.object_id.product_variant_ids:
92 | self.create_campaign_variant(campaign, product)
93 |
94 | elif self.object_id._name == 'product.public.category':
95 | for template in self.env['product.template'].search([('public_categ_ids', 'in', self.object_id.id)]):
96 | for product in template.product_variant_ids:
97 | self.create_campaign_variant(campaign, product)
98 | else:
99 | super(crm_campaign_object, self).create_campaign_product(campaign)
100 |
--------------------------------------------------------------------------------
/website_crm_campaign/static/src/css/sale_campaign.css:
--------------------------------------------------------------------------------
1 | /*=============================================================
2 | webshop
3 | ============================================================ */
4 |
5 | .modal.fade:not(.in) .modal-dialog {
6 | -webkit-transform: translate3d(-25%, 0, 0);
7 | transform: translate3d(-25%, 0, 0);
8 | }
9 |
10 | /*
11 | top: translate3d(0, -25%, 0)
12 | bottom: translate3d(0, 25%, 0)
13 | left: translate3d(-25%, 0, 0)
14 | right: translate3d(25%, 0, 0)
15 | */
16 |
17 |
18 | .oe_product_image {
19 | margin-bottom: 10%;
20 | height: 300px;
21 | }
22 |
23 | .product_shop {
24 | display: inline-flex;
25 | margin-top: 8px;
26 | }
27 |
28 | .oe_vertel_product_info {
29 | text-overflow: ellipsis;
30 | }
31 |
32 | .oe_p_qty {
33 | max-width: 45px !important;
34 | margin: 0px 10px;
35 | }
36 |
37 | .oe_product p {
38 | margin: 3px 0px 0px 0px;
39 | }
40 |
41 | .oe_product .product_price {
42 | position: unset;
43 | padding: 0px !important;
44 | }
45 |
46 | /*
47 | .oe_vertel_product_info .p_desc {
48 | height: 3.2em;
49 | overflow: hidden;
50 | position: relative;
51 | margin: 10px 0px 0px 0px;
52 | line-height: 1.1em;
53 | }
54 |
55 | .oe_vertel_product_info .p_desc::after {
56 | content: "";
57 | position: absolute;
58 | bottom: 0;
59 | right: 0;
60 | width: 20%;
61 | height: 1.1em;
62 | background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 50%);
63 | }
64 | */
65 |
66 | .oe_product h5 {
67 | height: 7.7em;
68 | overflow: hidden;
69 | position: relative;
70 | margin: 10px 0px 0px 0px;
71 | line-height: 1.1em;
72 | }
73 |
74 | .oe_product h5::after {
75 | content: "";
76 | position: absolute;
77 | bottom: 0;
78 | right: 0;
79 | width: 20%;
80 | height: 1.1em;
81 | background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 50%);
82 | }
83 |
84 | .oe_product.oe_list.oe_product_cart h5 {
85 | height: 4.4em;
86 | max-width: 660px;
87 | }
88 |
89 | /* ---- Product Sizes ---- */
90 | .col-md-12 .oe-height-1 {
91 | height: 75px;
92 | }
93 | .col-md-12 .oe-height-2 {
94 | height: 600px;
95 | }
96 | .col-md-12 .oe-height-4 {
97 | height: 300px;
98 | }
99 | .col-md-12 .oe-height-6 {
100 | height: 450px;
101 | }
102 | .col-md-12 .oe-height-8 {
103 | height: 600px;
104 | }
105 |
106 | .col-md-9 .oe-height-1 {
107 | height: 70px;
108 | }
109 | .col-md-9 .oe-height-2 {
110 | height: 315px !important;
111 | }
112 | .col-md-9 .oe-height-4 {
113 | height: 280px;
114 | }
115 | .col-md-9 .oe-height-6 {
116 | height: 420px;
117 | }
118 | .col-md-9 .oe-height-8 {
119 | height: 560px;
120 | }
121 |
122 | .oe_product section {
123 | padding: 0px 10px 10px 10px !important;
124 | }
125 |
126 | .oe_product .oe_subdescription {
127 | margin-bottom: 3px !important;
128 | }
129 |
130 | @media (max-width: 768px) {
131 | #products_grid table, #products_grid tbody, #products_grid tr, #products_grid td {
132 | float: left;
133 | width: 100%;
134 | display: inline-block;
135 | }
136 | #products_grid .oe_product {
137 | float: left;
138 | width: 100%;
139 | height: 550px;
140 | display: inline-block;
141 | }
142 |
143 | .products_pager .pagination {
144 | margin: 5px auto !important;
145 | }
146 |
147 | .product_categories_tree_div {
148 | border: none;
149 | }
150 |
151 | .col-md-9 .oe-height-2 {
152 | height: 460px !important;
153 | }
154 |
155 | .oe_product_image {
156 | margin-bottom: 0;
157 | height: 250px;
158 | }
159 | }
160 | @media (max-width: 400px) {
161 | #products_grid .oe_product {
162 | height: 550px;
163 | }
164 | #products_grid .oe_product section {
165 | background: rgba(255, 255, 255, 1);
166 | }
167 | #products_grid .oe_product .oe_product_image {
168 | top: 0;
169 | bottom: 65px;
170 | }
171 |
172 | #products_grid .oe_product.oe_image_full .oe_product_image {
173 | bottom: 50px;
174 | }
175 |
176 | .product_categories_tree_div {
177 | border: none;
178 | }
179 | }
180 | @media (min-width: 992px) {
181 | .col-md-12 .oe-height-1 {
182 | height: 95px;
183 | }
184 | .col-md-12 .oe-height-2 {
185 | height: 600px;
186 | }
187 | .col-md-12 .oe-height-4 {
188 | height: 380px;
189 | }
190 | .col-md-12 .oe-height-6 {
191 | height: 570px;
192 | }
193 | .col-md-12 .oe-height-8 {
194 | height: 760px;
195 | }
196 |
197 | .col-md-9 .oe-height-1 {
198 | height: 72px;
199 | }
200 | .col-md-9 .oe-height-2 {
201 | height: 310px !important;
202 | }
203 | .col-md-9 .oe-height-4 {
204 | height: 288px;
205 | }
206 | .col-md-9 .oe-height-6 {
207 | height: 432px;
208 | }
209 | .col-md-9 .oe-height-8 {
210 | height: 576px;
211 | }
212 | }
213 | @media (min-width: 1200px) {
214 | .col-md-12 .oe-height-1 {
215 | height: 125px;
216 | }
217 | .col-md-12 .oe-height-2 {
218 | height: 600px;
219 | }
220 | .col-md-12 .oe-height-4 {
221 | height: 600px;
222 | }
223 | .col-md-12 .oe-height-6 {
224 | height: 750px;
225 | }
226 | .col-md-12 .oe-height-8 {
227 | height: 1000px;
228 | }
229 |
230 | .col-md-9 .oe-height-1 {
231 | height: 95px;
232 | }
233 | .col-md-9 .oe-height-2 {
234 | height: 330px !important;
235 | }
236 | .col-md-9 .oe-height-4 {
237 | height: 430px;
238 | }
239 | .col-md-9 .oe-height-6 {
240 | height: 570px;
241 | }
242 | .col-md-9 .oe-height-8 {
243 | height: 760px;
244 | }
245 | }
246 |
247 | .oe_product .oe_product_image img {
248 | max-width: 100%;
249 | max-height: 100%;
250 | margin: auto;
251 | position: absolute;
252 | top: 0;
253 | left: 0;
254 | bottom: unset;
255 | right: 0;
256 | z-index: 4;
257 | }
258 |
--------------------------------------------------------------------------------
/crm_campaign_addons/crm_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | crm.campaign.object.tree
6 | crm.campaign.object
7 | tree
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | crm.campaign.object.form
19 | crm.campaign.object
20 | form
21 |
22 |
41 |
42 |
43 |
44 | crm.campaign.object.kanban
45 | crm.campaign.object
46 | kanban
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |