Skip to content
This repository has been archived by the owner on Dec 17, 2019. It is now read-only.

11.0 #27

Open
wants to merge 235 commits into
base: master
Choose a base branch
from
Open

11.0 #27

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
235 commits
Select commit Hold shift + click to select a range
cd056aa
Redesign and port to v11
Oct 23, 2017
f7a828a
port blog import to v11
Oct 24, 2017
2cf774b
image not rendering and transfer over featured image
Oct 29, 2017
04661da
* Fix import user issue introduced in previous version
Oct 29, 2017
1eabb20
quick port with min testing
Nov 27, 2017
0a43da4
* Fix character encoding issue
Dec 16, 2017
ec1e48f
* Fix duplicate my_pie and issue with Odoo always outputting http eve…
Dec 17, 2017
82ca505
zombie coding...
Dec 17, 2017
527b6df
quickport website_support
Jan 10, 2018
403e9da
* Forward fix custom field mismatch
Feb 11, 2018
ff003cf
forward fix many2one casting issue
Feb 13, 2018
2094898
port to version 11
Feb 14, 2018
1bd193f
* Fix settings screen and move menu
Feb 25, 2018
576666e
* Fix website ticket attachment issue
Feb 25, 2018
e25c0c2
* Remove obsolete support@ reply wrapper
Feb 25, 2018
3ed163f
* Change default email wrapper to user
Feb 26, 2018
ffb7f45
* Fix multiple ticket delete issue
Feb 26, 2018
a5fb2c5
* unhide voip account field in user form view
Mar 25, 2018
225cbfc
quick port to version 11
Mar 25, 2018
26d6441
quick port over to version 11
Mar 25, 2018
d7a65b2
quick port to version 11
Mar 25, 2018
c52dd1c
Quick port to version 11
Mar 25, 2018
4189a55
quick port to version 11
Mar 25, 2018
13074ea
Was not meant to put that into the released list...
Mar 26, 2018
bab2abd
* Convert sip_register, sip_invite and rtp code to python 3
Apr 3, 2018
d3a6006
* Fix subcategories
Apr 4, 2018
f9ff3db
v1.0.8
Apr 6, 2018
f3e3d9f
Support ticket bug fixes
Apr 9, 2018
59db69b
new channel field and bug fixes
Apr 11, 2018
883338d
* Extra field type and label is required
Apr 12, 2018
0e66b6e
* Changing subcategory now automatically adds the extra fields
Apr 15, 2018
33a8e77
v1.1.0
Apr 18, 2018
5b32790
* Move recaptcha to inline to avoid bundling issues
May 1, 2018
f8942d7
v1.0.4
May 9, 2018
78876b0
First part of new timesheet report
May 14, 2018
fc30084
* Fix access rule preventing adding timesheet line without project
May 21, 2018
4081b04
* Ability to tag support tickets
Jun 3, 2018
6c5aeab
Twilio WebRTC calling
Jun 5, 2018
b7b1d9c
* Permission fix for approval system
Jun 7, 2018
4364097
* Portal access key is generated when ticket is manually created or t…
Jun 18, 2018
8ae1bac
* Answer calls from within your browser
Jun 20, 2018
ff336b1
* Setting to adjust presense detection
Jun 20, 2018
0b7bdaa
* Fix incorrect voice URL
Jun 24, 2018
e145aa5
v1.2.3
Jun 25, 2018
501ccda
* Adjust permissions
Jun 25, 2018
84b1863
* Information only SLA
Jun 27, 2018
3a29308
tidy up
Jun 27, 2018
92995b5
* Ability to assign SLA to contact and ultimately to their tickets
Jun 28, 2018
2fdd8b6
small cleanup and start of call users fater automated call code
Jun 28, 2018
a624522
* SLA tickets now have a timer that counts down, you can select betwe…
Jun 29, 2018
e7d97e5
Failsafe inactive time setting fix
Jun 29, 2018
e038e8e
Need to think this one through if I'm going to go from automated call…
Jun 29, 2018
f7e975e
* reCAPTCHA implementation since the honey pot is not bullet proof
Jun 30, 2018
5d33ca3
* SLA alert emails
Jul 2, 2018
c140602
record calls setting
Jul 2, 2018
2578972
* Permission for SLA Alerts
Jul 3, 2018
03779be
permission and menu rearrange
Jul 3, 2018
0d5f0a7
Menu reaarange and rough implementation of call dialogs
Jul 4, 2018
eb02fe7
* Field employee_id is now automatically filled in from the support t…
Jul 5, 2018
2a01076
* Fix SLA business hours timer and add support for holidays via the h…
Jul 5, 2018
3dc9c9d
* Compact call menu
Jul 5, 2018
67ed3ba
* Set a default codec to reduce confusion and complexity
Jul 6, 2018
522768d
* Call dialogs and DTMF call action
Jul 6, 2018
8de37a1
* Unlinked page to list help pages by support group
Jul 9, 2018
42daa7d
shift most of the call setup code outside of the call action
Jul 9, 2018
bb291cc
* Twilio capability token generation (easy setup)
Jul 11, 2018
2da8a73
v1.2.12
Jul 12, 2018
7d8e97e
* Find local outgoing IP address button to make SIP setup a little ea…
Jul 15, 2018
5df0aeb
* Bug fix to also record outgoing SIP calls not just the Twilio javas…
Jul 15, 2018
3945b8b
* Optional priority field on website
Jul 15, 2018
67df2f0
Generate invoices based on amount of time spent on ticket / tasks
Jul 15, 2018
d86d671
v1.1.2
Jul 17, 2018
5ffb369
v1.0.9
Jul 17, 2018
7278c62
v1.0.10
Jul 18, 2018
31e2e3b
Spanish translation
aitorbouzas Jul 19, 2018
bce5ff8
Merge pull request #23 from aitorbouzas/11.0
Jul 19, 2018
5b4785b
Adding sequence for ticket number, deleting ticket number display
aitorbouzas Jul 20, 2018
fb6cc9e
Fixing spanish translations
aitorbouzas Jul 20, 2018
5a06160
More translations
aitorbouzas Jul 20, 2018
b98a3bf
Timezone in website view
aitorbouzas Jul 20, 2018
a711ae4
Timezone in website view
aitorbouzas Jul 20, 2018
249d2a0
Adding migration script
aitorbouzas Jul 23, 2018
ddfaa97
Views improvement, added author
aitorbouzas Jul 23, 2018
58c9b8c
* Textboxes now add the required attribute
Jul 29, 2018
b894a18
hmm outputs RTP but not hearing any audio???
Jul 29, 2018
d5ec3d4
Merge pull request #24 from aitorbouzas/11.0
Jul 31, 2018
7ca0dbb
v1.3.0
Aug 1, 2018
9279af1
* Remove dependency on CRM module
Aug 2, 2018
a16af47
* Fix input group generating incorrect html
Aug 2, 2018
b321fca
* No presence bug fix
Aug 6, 2018
05f6299
* Compatablility fix for version 1.3.1
Aug 15, 2018
5bf1b0a
Fixed problem with pedantic sip option
vasvlad Aug 19, 2018
6267498
Merge pull request #30 from vasvlad/11.0
Aug 20, 2018
3611314
* Assigned user filter for internal users (employees) only
Aug 22, 2018
2416afa
Fixed problem with Record-Route in sip protocol
vasvlad Aug 23, 2018
0e7825d
Merge pull request #33 from vasvlad/11.0
Aug 23, 2018
6635ac6
* Fix form javascript public access issue
Sep 9, 2018
f309eab
* Add close date to customer website portal
Sep 10, 2018
340f47b
* Ability to limit which user groups can select a category
Sep 10, 2018
bc7e188
* Fix business hours field missing resource module dependacy
Sep 11, 2018
2e7cf83
* User accounts created through the create account link are now added…
Sep 12, 2018
89d3126
v1.3.7
Sep 17, 2018
af0cf49
1.3.7
Sep 17, 2018
215de9b
* Fix help group page using old field
Sep 20, 2018
12571c0
* Fix custom actions from not working
Sep 25, 2018
6bd0645
* Fix csrf being saved in html
Oct 15, 2018
8f94eab
* Fix signed in users not being able to access help groups / pages
Oct 15, 2018
616fa35
* Help page unpublish / republish
Oct 15, 2018
d3d37f3
* Ability to call leads
Oct 17, 2018
61148f0
* Fix real time sms receive bug
Oct 24, 2018
0774772
app store port to version 11
Oct 24, 2018
84444ea
* Fix Send SMS automated action not appearing in list
Oct 24, 2018
8d8e831
quick port a few modules
Oct 29, 2018
cd0753b
* Ability to assign a customer to a dedicated support staff member
Oct 29, 2018
cfd5b59
custom store module udpate
Oct 30, 2018
096fb90
v1.3.12
Oct 30, 2018
940a40b
v1.0.3
Oct 30, 2018
93adc0b
v1.0.4
Oct 31, 2018
930603c
v1.4.0
Oct 31, 2018
0097372
* Fix issue with survey link appearing as _survey_url_ in chatter
Oct 31, 2018
fa950aa
summary = fields.Char(string="summary")
Nov 1, 2018
fa45d2d
* Automatically generate Twilio client name
Nov 5, 2018
ce85f96
* Fix mySound undefined bug on outgoing calls
Nov 5, 2018
7941873
* Port email submit function over to 11 buy use email template system…
Nov 13, 2018
25ed9f6
* Fix ticket submit issue with public users with existing emails subm…
Nov 14, 2018
2544a9d
* Ability to unpublish modules from the store
Nov 19, 2018
c253fb3
quick port custom css module to version 11
Nov 19, 2018
5b3986a
app store, html forms and voip bug fixes
Nov 26, 2018
20e0f40
* Fix permission issue with survey and change requests being inaccess…
Nov 29, 2018
122c791
v1.4.4
Dec 1, 2018
0c6d8a1
Quick port to version 11
Dec 3, 2018
f2d5474
* Resolve get record name when model does not have name field
Dec 3, 2018
f774cf9
Might redesign it to support not linear membership change
Dec 4, 2018
e9f0892
* Fix approval mail permissions
Dec 4, 2018
26bcfa5
demo data
Dec 5, 2018
1c47c23
* Tidy up repos on delete of account
Dec 5, 2018
780b9df
* Fix permission issue with public form submissions that had many2man…
Dec 7, 2018
4fd0ff3
* Fix permission issues with support clients assigned as department m…
Dec 10, 2018
5bdac94
Define which user groups can access a website menu
Dec 12, 2018
a751271
* Remove group restrictions on parent menus (fixes infinate loop bug)
Dec 13, 2018
498504c
* Install doesn't leave zip anymore
Dec 15, 2018
191d779
* Add ability to send to mail list contacts
Dec 15, 2018
d77c7e2
* Fix call history import
Dec 15, 2018
9408583
* Code out the need to have the Twilio Python library installed for c…
Dec 18, 2018
b7d07b8
v1.0.12
Dec 18, 2018
98b41c8
* Smart button on Twilio account screen that shows calls for that acc…
Dec 19, 2018
a1c43ad
drag in membership form into any page
Dec 19, 2018
246ecfe
* Display user friendly error if call fails for any reason e.g. no me…
Dec 20, 2018
c450a25
* Feature to assign a number to a user to speed up calling
Jan 1, 2019
d036e89
prep work for paid membership
Jan 3, 2019
40c7ca9
really need to review documentation more often as the modules main fo…
Jan 3, 2019
aabce0d
* Fix upgrade issue for people before version 1.1.0 related to approval
Jan 4, 2019
3c0bbbd
* Fix JWT renewal for incoming calls
Jan 4, 2019
935a2ba
* Fix to work in latest version of Google Chrome
Jan 8, 2019
5c6174a
* Fix Call History report and add ability to skip report (can be time…
Jan 8, 2019
af40ca2
v1.0.22
Jan 15, 2019
ffa602f
* Fix dropbox (many2one) domain filter so it actually works...
Jan 17, 2019
53bc386
[IMP] Adding some UX related logic to Support Ticket view.
lucode Jan 25, 2019
1489f8e
[IMP] Updating french / german language
lucode Jan 28, 2019
9d3332f
[IMP] Adding new client form view. Old view is still default one.
lucode Jan 28, 2019
4bb9267
[FIX] new client form view. state readonly in view.
lucode Jan 28, 2019
ed46137
[IMP] Adding .idea folder to gitignore
lucode Jan 28, 2019
316940c
[IMP] SaaS portal Adding ACL groups
lucode Jan 28, 2019
b66c8cc
Revert "[IMP] SaaS portal Adding ACL groups"
lucode Jan 28, 2019
621b812
Merge branch '11.0' of https://github.com/SythilTech/Odoo into 11.0
lucode Jan 28, 2019
e493f8c
pass domain as string
Jan 28, 2019
6a0b4a4
v1.4.8
Jan 29, 2019
7acc55d
prevent cread / write clashes spamming the error log
Jan 29, 2019
973c42f
merge versions 1.4.8 and 1.4.9(unreleased)
Jan 31, 2019
7c1d2d2
Merge branch '11.0' into 11.0
Jan 31, 2019
07545e0
Merge pull request #60 from coobyHQ/11.0
Jan 31, 2019
71922ec
* Fix form defaults for many2one
Feb 10, 2019
daa2852
* Rework auto e.164 converesion so it works if the data is imported, …
Feb 10, 2019
3164f0c
* Rework auto e.164 converesion so it works if the data is imported, …
Feb 10, 2019
f2837a2
* Suggest help pages that are similiar to ticket subject (reduces tic…
Feb 10, 2019
eb82614
* Button to restart Odoo
Feb 11, 2019
7deb2a9
Add support for any model
Feb 15, 2019
f7f3b7e
quick bug fix
Feb 16, 2019
e1ee1e9
* Fix delivery receipts
Feb 18, 2019
e38b316
* Add character and segment counter into UI as Twilio charges per seg…
Feb 19, 2019
2e8a23e
ManyChat Integration
Feb 19, 2019
9a678f9
* Add 'Make Twilio Call' button to activity screen to optimise workflow
Feb 20, 2019
f24bff1
* Add ability for clients to add attachments in there replies from th…
Feb 20, 2019
52037f6
* Ability to reimport all data (handy if you say manually added a tag…
Feb 25, 2019
7e7ded4
* Adjust permissions so employees can view contacts without access to…
Mar 3, 2019
b9026c1
* Add ability to add attachments on staff reply and staff ticket close
Mar 4, 2019
cd79506
* Add setting to auto create contact
Mar 4, 2019
b83d8a6
* Move timesheet into tab and fix permission issue
Mar 4, 2019
9738535
* Add Manychat tab to opportunbity view
Mar 5, 2019
0676496
* Redirect to record after making call comment
Mar 5, 2019
1801fba
* Serve Dynamic Content using record inside Odoo
Mar 6, 2019
4957878
* Add many2one type to custom fields
Mar 6, 2019
cb2c788
* Type converserion if going into many2one field
Mar 10, 2019
e7a9dfb
required to prevent mishaps
Mar 10, 2019
d53b315
better reporting if a varible on MC side is set to a no existant reco…
Mar 12, 2019
56ae667
* Dynamic content builder for text messages
Mar 19, 2019
f11f848
seems to create upgrade issue, pointless anyway as the same informati…
Mar 19, 2019
2b7b716
Can use posted variables in domain
Mar 19, 2019
5215879
v1.6.0
Apr 2, 2019
cce8ced
Port to version 11
Apr 3, 2019
abd18f4
* Change close template to allow blank closing comment
Apr 8, 2019
95c9f5f
* Fix an upgrade issue
Apr 8, 2019
b65bc8c
sorry been away, some small fixes, still dealing with backlog of emails
May 6, 2019
5495b86
* Clears sub category on category change to prevent saving with sub c…
May 27, 2019
b481800
* Prevent direct help page access
May 29, 2019
ec11943
* Add create support ticket button to form view
May 29, 2019
0b94811
missed portal subtype
Jun 4, 2019
633bf28
self contained version of the voip twilio module
Jun 4, 2019
4bfea9a
* Allows you to change where the module is downloaded too instead of …
Jun 11, 2019
d48a0fa
* Fixed bug with department manager not being able to view individual…
Jun 25, 2019
46ae242
* Skip repos on error (better error handling later...)
Jun 26, 2019
a4e8b58
* Ability to set a default body and cc depending on ticket contact, w…
Jul 8, 2019
22a8f4b
* Fix help pages 404
Jul 17, 2019
bcf3d5f
* Fix comment attachments in portal reply
Jul 17, 2019
6acd5e2
Set of tools to help with Search Engine Marketing / Optimisation
Aug 18, 2019
99ac75e
v1.0.1
Aug 24, 2019
7413f13
v1.0.2
Aug 29, 2019
26f92b1
v1.0.3
Sep 2, 2019
40dc269
v1.1.0
Sep 8, 2019
6c4221b
hotfix for search contexts
Sep 9, 2019
dca7f0b
* Ranking reports reintroduced
Sep 14, 2019
fc92370
* Private access to unpublished access to modules (alpha/beta access)
Sep 22, 2019
856da14
Odoo Framework Unwrap
Sep 23, 2019
018cb1f
Allows users to upload videos to your website
Sep 25, 2019
32d9a57
v1.1.2
Sep 27, 2019
de87f5d
* Bug fix for systems with old version of app_store client without ac…
Sep 28, 2019
38f5f57
* Stop updates from breaking if a module lacks a proper version number
Oct 6, 2019
819cf96
* Add a missing permission
Oct 6, 2019
0bfe74f
* Fix custom fields many2one with no filter producing an error
Oct 21, 2019
4a3a5d7
* Fix code syntax error
Oct 21, 2019
17e78f3
gotta avoid last minute edits post testing so many issues...
Oct 23, 2019
dd1522d
* Canonical URL check
Oct 29, 2019
3736b6c
* Skips analyses of view/models if an error is encountered
Nov 4, 2019
9b83b22
* Unpublished modules can not be updated
Nov 4, 2019
6781342
was meant to generate the zip even if xml parse fails
Nov 5, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
108 changes: 108 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# IDE
.idea

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

4 changes: 4 additions & 0 deletions INCOMPLETE/membership_subscription/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-

from . import models
from . import controllers
27 changes: 27 additions & 0 deletions INCOMPLETE/membership_subscription/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
'name': "Membership Subscription",
'version': "1.0.0",
'author': "Sythil Tech",
'category': "Tools",
'support': "[email protected]",
'summary':'Create membership programs that automatically manage subscriptions using payment tokens',
'description':'Create membership programs that automatically manage subscriptions using payment tokens',
'license':'LGPL-3',
'data': [
'security/ir.model.access.csv',
'security/ir_rule.xml',
'data/website.menu.csv',
'views/payment_membership_views.xml',
'views/membership_subscription_templates.xml',
],
'depends': ['payment_reoccuring'],
'demo': [
'demo/ir.module.category.csv',
'demo/res.groups.xml',
'demo/payment_membership.xml',
],
'images':[
'static/description/1.jpg',
],
'installable': True,
}
3 changes: 3 additions & 0 deletions INCOMPLETE/membership_subscription/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import main
104 changes: 104 additions & 0 deletions INCOMPLETE/membership_subscription/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# -*- coding: utf-8 -*-

import logging
_logger = logging.getLogger(__name__)
import werkzeug
import requests
import json

import odoo.http as http
from odoo.http import request
from odoo.addons.http_routing.models.ir_http import slug

class MembershipSubscriptionController(http.Controller):

@http.route('/membership/form/load', website=True, type='json', auth="user")
def membership_form_load(self, **kw):

values = {}
for field_name, field_value in kw.items():
values[field_name] = field_value

membership_form = request.env['payment.membership'].browse(int(values['form_id']))

return {'form_id': membership_form.id, 'payment_acquirer': membership_form.subscription_id.payment_acquirer_id.id}

@http.route('/membership/cancel', type="http", auth="user", website=True)
def membership_cancel(self):

#Remove the membership assignment
request.env.user.partner_id.payment_membership_id = False

#Remove all permissions
request.env.user.groups_id = False

#Also add them to the portal group so they can access the website
group_portal = request.env['ir.model.data'].sudo().get_object('base','group_portal')
group_portal.users = [(4, request.env.user.id)]

return werkzeug.utils.redirect("/")

@http.route('/membership/management', type="http", auth="user", website=True)
def membership_management(self):
return request.render('membership_subscription.membership_management', {'current_membership': request.env.user.partner_id.payment_membership_id})

@http.route('/membership/signup/thank-you', type="http", auth="user", website=True)
def membership_signup_thankyou(self):
return request.render('membership_subscription.signup_thank_you', {})

@http.route('/membership/signup/<model("payment.membership"):membership>', type="http", auth="public", website=True)
def membership_signup(self, membership):
return request.render('membership_subscription.signup_form', {'membership': membership})

@http.route('/membership/signup/process', type="http", auth="public", website=True)
def membership_signup_process(self, **kwargs):

values = {}
for field_name, field_value in kwargs.items():
values[field_name] = field_value

membership = request.env['payment.membership'].sudo().browse( int( values['membership_id'] ) )

# The user account is created now but access right are only given when payment has been received
if request.env['res.users'].sudo().search_count([('login', '=', values['email'])]) == 0:
new_user = request.env['res.users'].sudo().create({'name': values['name'], 'login': values['email'], 'email': values['email'], 'password': values['password'] })
else:
return "User account with this login already exists"

# Modify the users partner record only with the allowed fields
extra_fields_dict = {}
for extra_field in membership.extra_field_ids:
extra_fields_dict[extra_field.sudo().field_id.name] = values[extra_field.name]

new_user.partner_id.write(extra_fields_dict)

#Remove all permissions
new_user.groups_id = False

#Also add them to the portal group so they can access the website
group_portal = request.env['ir.model.data'].sudo().get_object('base','group_portal')
group_portal.users = [(4, new_user.id)]

# Add them to the membership
extra_fields_dict['payment_membership_id'] = membership.id

# Paid memberships get redirected to the payment gateway assigned to the subscription
if membership.subscription_id:
#Add the subscription product to the order
order = request.website.sale_get_order(force_create=1)
request.website.sale_reset()
order._cart_update(product_id=membership.subscription_id.product_id.id, set_qty=1)

return json.JSONEncoder().encode({'status': 'unpaid', 'acquirer': membership.subscription_id.payment_acquirer_id.id})
else:

# Users of free membership gain instant rights access
for user_group in membership.group_ids:
user_group.users = [(4, new_user.id)]

# Automatically sign the new user in
request.cr.commit() # as authenticate will use its own cursor we need to commit the current transaction
request.session.authenticate(request.env.cr.dbname, values['email'], values['password'])

# Redirect them to the thank you page
return json.JSONEncoder().encode({'status': 'paid', 'redirect_url': membership.redirect_url})
2 changes: 2 additions & 0 deletions INCOMPLETE/membership_subscription/data/website.menu.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"id","name","url","parent_id/id"
"membership_website_menu","Membership","/membership/management","website.main_menu"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"id","name"
"demo_membership","Membership Levels"
19 changes: 19 additions & 0 deletions INCOMPLETE/membership_subscription/demo/payment_membership.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="payment_membership_bronze" model="payment.membership">
<field name="name">Bronze</field>
<field name="group_ids" eval="[(4, ref('membership_subscription.bronze'))]"/>
</record>

<record id="payment_membership_silver" model="payment.membership">
<field name="name">Silver</field>
<field name="group_ids" eval="[(4, ref('membership_subscription.silver'))]"/>
</record>

<record id="payment_membership_gold" model="payment.membership">
<field name="name">Gold</field>
<field name="group_ids" eval="[(4, ref('membership_subscription.gold'))]"/>
</record>

</odoo>
26 changes: 26 additions & 0 deletions INCOMPLETE/membership_subscription/demo/res.groups.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

<record id="bronze" model="res.groups">
<field name="name">Bronze</field>
<field name="category_id" ref="demo_membership"/>
<field name="comment">Teir 1 Membership</field>
</record>

<record id="silver" model="res.groups">
<field name="name">Silver</field>
<field name="implied_ids" eval="[(4, ref('bronze'))]"/>
<field name="category_id" ref="demo_membership"/>
<field name="comment">Teir 2 Membership</field>
</record>

<record id="gold" model="res.groups">
<field name="name">Gold</field>
<field name="implied_ids" eval="[(4, ref('silver'))]"/>
<field name="category_id" ref="demo_membership"/>
<field name="comment">Teir 3 Membership</field>
</record>

</data>
</odoo>
3 changes: 3 additions & 0 deletions INCOMPLETE/membership_subscription/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
v1.0.0
======
* Initial Release
4 changes: 4 additions & 0 deletions INCOMPLETE/membership_subscription/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-

from . import payment_membership
from . import res_partner
40 changes: 40 additions & 0 deletions INCOMPLETE/membership_subscription/models/payment_membership.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, tools

class PaymentMembership(models.Model):

_name = "payment.membership"

name = fields.Char(string="Name", required=True)
subscription_id = fields.Many2one('payment.subscription', string="Subscription")
redirect_url = fields.Char(string="Redirect URL", default="/membership/signup/thank-you")
group_ids = fields.Many2many('res.groups', string="New User Groups", help="Determines what the user can access e.g. slide channels / support help groups")
extra_field_ids = fields.One2many('payment.membership.field', 'payment_membership_id', string="Extra Fields", help="More fields will appear on the website signup form")
member_ids = fields.One2many('res.partner', 'payment_membership_id', string="Members")

@api.multi
def view_singup_form(self):
self.ensure_one()

return {
'type': 'ir.actions.act_url',
'name': "Membership Signup Form",
'target': 'self',
'url': "/membership/signup/" + slug(self)
}

class PaymentMembershipField(models.Model):

_name = "payment.membership.field"

payment_membership_id = fields.Many2one('payment.membership', string="Payment Membership")
field_id = fields.Many2one('ir.model.fields', string="Field", domain="[('model_id.model','=','res.partner')]", required=True)
name = fields.Char(string="Name")
field_type = fields.Selection([('textbox','Textbox')], string="Field Type", default="textbox", required=True)
field_label = fields.Char(string="Field Label", required=True)

@api.onchange('field_id')
def _onchange_field_id(self):
if self.field_id:
self.field_label = self.field_id.field_description
self.name = self.field_id.name
8 changes: 8 additions & 0 deletions INCOMPLETE/membership_subscription/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, tools

class RespartnerMembership(models.Model):

_inherit = "res.partner"

payment_membership_id = fields.Many2one('payment.membership', string="Membership")
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_payment_membership","access payment.membership","model_payment_membership","sales_team.group_sale_manager",1,1,1,1
"public_access_payment_membership","public access payment.membership","model_payment_membership","",1,0,0,0
"access_payment_membership_field","access payment.membership.field","model_payment_membership_field","sales_team.group_sale_manager",1,1,1,1
"public_access_payment_membership_field","public access payment.membership.field","model_payment_membership_field","",1,0,0,0
14 changes: 14 additions & 0 deletions INCOMPLETE/membership_subscription/security/ir_rule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<odoo>
<data>

<record model="ir.rule" id="website_membership_access_rule">
<field name="name">Website Membership Menu Access</field>
<field name="model_id" ref="website.model_website_menu"/>
<field name="domain_force">[('url','!=', '/membership/management')]</field>
<field name="perm_read" eval="True"/>
</record>

</data>
</odoo>

Loading